Thread (7 messages) 7 messages, 4 authors, 2022-07-29

Re: [PATCH v2] powerpc: add documentation for HWCAPs

From: Nicholas Piggin <npiggin@gmail.com>
Date: 2022-07-20 09:29:15

Excerpts from Tulio Magno Quites Machado Filho's message of July 16, 2022 6:17 am:
Segher Boessenkool [off-list ref] writes:
quoted
That is a usability problem.  Can it be fixed, or will that create its
own compatibility problems?  In practice I mean.  If it is, the C
libraries could fix it up, for new programs, and then after a while the
kernel can do the sane thing?

How big is the problem, anyway?  Is it only 2.05, or also 2.04, 2.03?
PPC_FEATURE_ARCH_2_05 is the first bit referring to an ISA level.
Before that, AT_HWCAP used to have bits for specific processors, e.g.
PPC_FEATURE_CELL and PPC_FEATURE_POWER4.

Notice that glibc creates its own hwcap-based information that is used by
__builtin_cpu_supports().  In this case bits PPC_FEATURE_ARCH_2_05,
PPC_FEATURE_POWER5_PLUS, PPC_FEATURE_POWER5 and PPC_FEATURE_POWER4 are enabled
whenever if the processor is compatible with the features provided by any of
the previous processors [1].
AT_HWCAP and AT_HWCAP2 are kept intact, though.

[1] https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/powerpc/hwcapinfo.c;h=afde05f86382413ce1f0c38e33c9bdd38d6b7e9d;hb=HEAD#l45
Hmm, this doesn't seem very nice. That said, before possibly changing 
that in the kernel, documenting existing unexpected behaviour is 
probably a good idea. Good catch, I obviously wasn't careful enough
reviewing these bits.

I'll send out a final patch with this adjustment in a week or so in
case any more comments come in the meantime.

Thanks,
Nick
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help