This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] power: Fix VSCR position on ucontext
- From: "Gabriel F. T. Gomes" <gabriel at inconstante dot eti dot br>
- To: Rogerio Alves <rcardoso at linux dot ibm dot com>
- Cc: Florian Weimer <fweimer at redhat dot com>, <libc-alpha at sourceware dot org>
- Date: Fri, 7 Dec 2018 16:29:59 -0200
- Subject: Re: [PATCH] power: Fix VSCR position on ucontext
- References: <8a619ad1-b7f2-04f8-f9a7-0a19cbf98f4c@linux.ibm.com> <87lg5va6a6.fsf@oldenburg.str.redhat.com> <20181116111825.43b60283@tereshkova.br.ibm.com> <5e1d1cab-7c91-90f8-82d2-fd38f8676f30@linux.ibm.com>
On Fri, 07 Dec 2018, Rogerio Alves wrote:
>+/* This test is supported only on POWER 5 or higher. */
>+#define PPC_CPU_SUPPORTED (PPC_FEATURE_POWER5 | PPC_FEATURE_POWER5_PLUS | \
>+ PPC_FEATURE_ARCH_2_05 | PPC_FEATURE_ARCH_2_06 | \
>+ PPC_FEATURE2_ARCH_2_07)
Is this actually needed? Glibc has code to fill all the bits for older
architectures in sysdeps/powerpc/hwcapinfo.c [1]. So, as far as I can
see, you only need to test for AT_HWCAP & PPC_FEATURE_POWER5.
[1] https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/powerpc/hwcapinfo.c;h=a09b18309324423d0cdf04e88367899a4396bab7;hb=HEAD#l47
>+static int
>+do_test (void)
>+{
>+
>+ if (!(getauxval(AT_HWCAP2) & PPC_CPU_SUPPORTED))
>+ {
>+ if (!(getauxval(AT_HWCAP) & PPC_CPU_SUPPORTED))
>+ FAIL_UNSUPPORTED("This test is unsupported on POWER < 5\n");
>+ }
Similarly.