From patchwork Fri May 1 20:32:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. Murphy" X-Patchwork-Id: 38902 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A96B33972415; Fri, 1 May 2020 20:32:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A96B33972415 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1588365145; bh=OxTQIZ1dMr4AY8wJ7r8kKBgkGGMPPYZQshuYw3tyazs=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=cdne1CRWBO468/YP8uKgneuZN9Kq7eYGw6YNZz37fwKL+BM9XoS3JjAVB1WFFIXJF ffWqi0CfmR1EOhbRrPWayQ5Sv1/vaCuGMexCr2i461Q7dnGRNaVjJrVg/PaEBkdSVD a1kzVsw3DXnfFBsKM+16P3m+AleT8Kj07SGNL7cI= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 184503938C3F for ; Fri, 1 May 2020 20:32:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 184503938C3F Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 041KWBFE111598 for ; Fri, 1 May 2020 16:32:21 -0400 Received: from ppma02wdc.us.ibm.com (aa.5b.37a9.ip4.static.sl-reverse.com [169.55.91.170]) by mx0a-001b2d01.pphosted.com with ESMTP id 30r82t3qdg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 01 May 2020 16:32:21 -0400 Received: from pps.filterd (ppma02wdc.us.ibm.com [127.0.0.1]) by ppma02wdc.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 041KU8wJ014273 for ; Fri, 1 May 2020 20:32:20 GMT Received: from b01cxnp22034.gho.pok.ibm.com (b01cxnp22034.gho.pok.ibm.com [9.57.198.24]) by ppma02wdc.us.ibm.com with ESMTP id 30mcu77ubh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 01 May 2020 20:32:20 +0000 Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp22034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 041KWJmh39846336 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 1 May 2020 20:32:19 GMT Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A0F3F112062 for ; Fri, 1 May 2020 20:32:19 +0000 (GMT) Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 69103112061 for ; Fri, 1 May 2020 20:32:19 +0000 (GMT) Received: from brokenarrow.ibmuc.com (unknown [9.85.179.241]) by b01ledav004.gho.pok.ibm.com (Postfix) with ESMTP for ; Fri, 1 May 2020 20:32:19 +0000 (GMT) To: libc-alpha@sourceware.org Subject: [PATCH] powerpc64le/power9: guard power9 strcmp against rtld usage [BZ# 25905] Date: Fri, 1 May 2020 15:32:19 -0500 Message-Id: <20200501203219.8738-1-murphyp@linux.vnet.ibm.com> X-Mailer: git-send-email 2.21.1 MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.676 definitions=2020-05-01_14:2020-05-01, 2020-05-01 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 clxscore=1015 spamscore=0 lowpriorityscore=0 impostorscore=0 priorityscore=1501 mlxlogscore=854 malwarescore=0 bulkscore=0 phishscore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2005010146 X-Spam-Status: No, score=-30.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, KAM_SHORT, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: "Paul E. Murphy via Libc-alpha" From: "Paul E. Murphy" Reply-To: "Paul E. Murphy" Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" strcmp is used while resolving PLT references. Vector registers should not be used during this. The P9 strcmp makes heavy use of vector registers, so it should be avoided in rtld. This prevents quiet vector register corruption when glibc is configured with --disable-multi-arch and --with-cpu=power9. This can be seen with test-float64x-compat_totalordermag during the first call into totalordermagf64x@GLIBC_2.27. Add a guard to fallback to the power8 implementation when building power9 strcmp for libraries other than libc. --- sysdeps/powerpc/powerpc64/le/power9/strcmp.S | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sysdeps/powerpc/powerpc64/le/power9/strcmp.S b/sysdeps/powerpc/powerpc64/le/power9/strcmp.S index 412a13599d..b29ea7c020 100644 --- a/sysdeps/powerpc/powerpc64/le/power9/strcmp.S +++ b/sysdeps/powerpc/powerpc64/le/power9/strcmp.S @@ -17,6 +17,11 @@ . */ #include +#if !IS_IN(libc) +/* Fallback to P8 which does not use vector regs for rtld. */ +#include +#else + #ifndef STRCMP # define STRCMP strcmp #endif @@ -262,3 +267,5 @@ L(pagecross_nullfound): b L(pagecross_retdiff) END (STRCMP) libc_hidden_builtin_def (strcmp) + +#endif