From patchwork Mon May 4 15:25:03 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: 38910 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 9B7BA3876059; Mon, 4 May 2020 15:25:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9B7BA3876059 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1588605908; bh=ymJsiiuF/n4gM/tOIlNlYqmwyuse9eKuH5SPKyaLtSY=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=xzLtlnoxJM2cFiRkKDuExrIa77a+0legILyVb//l8PNV9q0ykvbXgRviLQ1cG9ntK bF58Cp5+xd8zN6HCFUulRmSsCFGgLdCwn6+PKnSvFMR2uCl/lKCPyCqtFDtblN+ATQ VuehYD66TSJv+bPHjGvnMeo3Qn8YcoKj649lXb08= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id C7938383E838 for ; Mon, 4 May 2020 15:25:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C7938383E838 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 044F2NHw189967; Mon, 4 May 2020 11:25:04 -0400 Received: from ppma04wdc.us.ibm.com (1a.90.2fa9.ip4.static.sl-reverse.com [169.47.144.26]) by mx0a-001b2d01.pphosted.com with ESMTP id 30s4v6yjgv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 04 May 2020 11:25:04 -0400 Received: from pps.filterd (ppma04wdc.us.ibm.com [127.0.0.1]) by ppma04wdc.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 044FJvue020045; Mon, 4 May 2020 15:25:04 GMT Received: from b01cxnp22035.gho.pok.ibm.com (b01cxnp22035.gho.pok.ibm.com [9.57.198.25]) by ppma04wdc.us.ibm.com with ESMTP id 30s0g6hj68-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 04 May 2020 15:25:04 +0000 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp22035.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 044FP3rq49480066 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 4 May 2020 15:25:03 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D15CEB2064; Mon, 4 May 2020 15:25:03 +0000 (GMT) Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8BEF6B2065; Mon, 4 May 2020 15:25:03 +0000 (GMT) Received: from brokenarrow.ibmuc.com (unknown [9.85.137.49]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP; Mon, 4 May 2020 15:25:03 +0000 (GMT) To: libc-alpha@sourceware.org, adhemerval.zanella@linaro.org Subject: [PATCHv2] powerpc64le/power9: guard power9 strcmp against rtld usage [BZ# 25905] Date: Mon, 4 May 2020 10:25:03 -0500 Message-Id: <20200504152503.9608-1-murphyp@linux.vnet.ibm.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <27007d15-933d-8d13-161f-cab2b26b37f2@linaro.org> References: 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-04_09:2020-05-04, 2020-05-04 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 spamscore=0 suspectscore=0 adultscore=0 clxscore=1011 impostorscore=0 lowpriorityscore=0 bulkscore=0 phishscore=0 mlxscore=0 mlxlogscore=876 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2005040121 X-Spam-Status: No, score=-21.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, 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" Use rtld-strcpy.S file in power9 to redirect to power8 implementation instead. This builds the power8 strcpy rtld with --with-cpu=power9 and --disable-multi-arch. The existing behavior is unchanged when multi-arch is enabled. ---8<--- 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. Reviewed-by: Adhemerval Zanella --- sysdeps/powerpc/powerpc64/le/power9/rtld-strcmp.S | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sysdeps/powerpc/powerpc64/le/power9/rtld-strcmp.S diff --git a/sysdeps/powerpc/powerpc64/le/power9/rtld-strcmp.S b/sysdeps/powerpc/powerpc64/le/power9/rtld-strcmp.S new file mode 100644 index 0000000000..afdb492b3d --- /dev/null +++ b/sysdeps/powerpc/powerpc64/le/power9/rtld-strcmp.S @@ -0,0 +1,2 @@ +/* Fallback to P8 which does not use vector regs for rtld. */ +#include