From patchwork Fri Mar 2 20:39:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tulio Magno Quites Machado Filho X-Patchwork-Id: 26165 Received: (qmail 104341 invoked by alias); 2 Mar 2018 20:39:44 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 104326 invoked by uid 89); 2 Mar 2018 20:39:43 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, KAM_NUMSUBJECT, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy=POWER X-HELO: mx0a-001b2d01.pphosted.com From: "Tulio Magno Quites Machado Filho" To: libc-alpha@sourceware.org Subject: [PATCH] powerpc: Fix tst-set_ppr.c on 32-bit POWER7 Date: Fri, 2 Mar 2018 17:39:31 -0300 X-TM-AS-GCONF: 00 x-cbid: 18030220-0044-0000-0000-000003ED464B X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008610; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000254; SDB=6.00997423; UDB=6.00507163; IPR=6.00776742; MB=3.00019824; MTD=3.00000008; XFM=3.00000015; UTC=2018-03-02 20:39:38 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18030220-0045-0000-0000-0000081D4826 Message-Id: <20180302203931.30149-1-tuliom@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-03-02_11:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1803020243 Instruction mfppr32 is categorized as phased-in in the POWER ISA 2.06, which means that servers do not implement it. It started to be available in POWER ISA 2.07. 2018-03-02 Tulio Magno Quites Machado Filho * sysdeps/powerpc/tst-set_ppr.c (do_test): Test for PPC_FEATURE2_ARCH_2_07 before trying to read the PPR32 on a POWER7 system. Signed-off-by: Tulio Magno Quites Machado Filho --- sysdeps/powerpc/tst-set_ppr.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sysdeps/powerpc/tst-set_ppr.c b/sysdeps/powerpc/tst-set_ppr.c index c4f8096..da8c4cd 100644 --- a/sysdeps/powerpc/tst-set_ppr.c +++ b/sysdeps/powerpc/tst-set_ppr.c @@ -73,13 +73,21 @@ static int do_test (void) { /* Check for the minimum required Power ISA to run these tests. */ +#ifdef __powerpc64__ if ((getauxval (AT_HWCAP) & PPC_FEATURE_ARCH_2_06) == 0) { printf ("Requires an environment that implements the Power ISA version" " 2.06 or greater.\n"); return EXIT_UNSUPPORTED; } - +#else + if ((getauxval (AT_HWCAP2) & PPC_FEATURE2_ARCH_2_07) == 0) + { + printf ("Requires an environment that implements the Power ISA version" + " 2.07 or greater.\n"); + return EXIT_UNSUPPORTED; + } +#endif uint8_t rc = 0; #ifdef _ARCH_PWR8