From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 130791 invoked by alias); 7 Dec 2018 18:31:04 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 130003 invoked by uid 89); 7 Dec 2018 18:30:18 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE autolearn=no version=3.3.2 spammy=H*F:D*br X-HELO: mo19.mail-out.ovh.net Date: Fri, 07 Dec 2018 19:23:00 -0000 From: "Gabriel F. T. Gomes" To: Rogerio Alves CC: Florian Weimer , Subject: Re: [PATCH] power: Fix VSCR position on ucontext Message-ID: <20181207162959.5e5d8933@tereshkova> In-Reply-To: <5e1d1cab-7c91-90f8-82d2-fd38f8676f30@linux.ibm.com> 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> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Ovh-Tracer-Id: 13561745854816833216 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtkedrudefledgudduvdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd X-SW-Source: 2018-12/txt/msg00253.txt.bz2 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.