From patchwork Wed Dec 15 14:39:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matheus Castanho X-Patchwork-Id: 48940 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 EEC623858412 for ; Wed, 15 Dec 2021 14:39:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EEC623858412 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1639579185; bh=knQRg6vvRctqULw/6+bzG/UGwpuDq9ZyS6V04M1WWe8=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=tpBNQy2wGVBWxXW2X0K4Rz2j9uqUQ0W4uxxxYoIRbtGSRqTyJMUwRKw8k0dbJv5VN 6fFJGf9CYhRJNyrvuDDuhJVG/nMohNY1dy2ApfZsdYXo43694DAt++XqJ/92aNol28 yR1zu0Y43ZhCtXo2MLGdEcvH6aKFG88T+1GuUNkk= 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 7C4FF3858C27 for ; Wed, 15 Dec 2021 14:39:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7C4FF3858C27 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1BFDUMIl029057 for ; Wed, 15 Dec 2021 14:39:22 GMT Received: from ppma01dal.us.ibm.com (83.d6.3fa9.ip4.static.sl-reverse.com [169.63.214.131]) by mx0a-001b2d01.pphosted.com with ESMTP id 3cyfrp3w6u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 15 Dec 2021 14:39:22 +0000 Received: from pps.filterd (ppma01dal.us.ibm.com [127.0.0.1]) by ppma01dal.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 1BFEcVpn009255 for ; Wed, 15 Dec 2021 14:39:21 GMT Received: from b01cxnp22036.gho.pok.ibm.com (b01cxnp22036.gho.pok.ibm.com [9.57.198.26]) by ppma01dal.us.ibm.com with ESMTP id 3cy7e36hvq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 15 Dec 2021 14:39:21 +0000 Received: from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com [9.57.199.110]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 1BFEdJvf13697458 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 Dec 2021 14:39:19 GMT Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 43194AE067; Wed, 15 Dec 2021 14:39:19 +0000 (GMT) Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A87A3AE062; Wed, 15 Dec 2021 14:39:18 +0000 (GMT) Received: from localhost (unknown [9.160.53.174]) by b01ledav005.gho.pok.ibm.com (Postfix) with ESMTP; Wed, 15 Dec 2021 14:39:18 +0000 (GMT) To: libc-alpha@sourceware.org Subject: [PATCH v2] powerpc64[le]: Allocate extra stack frame on syscall.S Date: Wed, 15 Dec 2021 11:39:16 -0300 Message-Id: <20211215143916.147403-1-msc@linux.ibm.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211207185211.137019-1-msc@linux.ibm.com> References: <20211207185211.137019-1-msc@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: sGI5xZEaOyHnB27SwPs_lDs2uEP66kSY X-Proofpoint-ORIG-GUID: sGI5xZEaOyHnB27SwPs_lDs2uEP66kSY X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2021-12-15_09,2021-12-14_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 spamscore=0 clxscore=1015 phishscore=0 bulkscore=0 malwarescore=0 mlxscore=0 priorityscore=1501 suspectscore=0 lowpriorityscore=0 mlxlogscore=801 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112150082 X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Matheus Castanho via Libc-alpha From: Matheus Castanho Reply-To: Matheus Castanho Cc: murphyp@linux.ibm.com, tuliom@linux.ibm.com, rzinsly@linux.ibm.com Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" v1 was not working properly on hosts without scv support, so some tests were failing in such systems. This is fixed now in this new version. --8<-- The syscall function does not allocate the extra stack frame for scv like other assembly syscalls using DO_CALL_SCV. So after commit d120fb9941 changed the offset that is used to save LR, syscall ended up using an invalid offset, causing regressions on powerpc64. So make sure the extra stack frame is allocated in syscall.S as well to make it consistent with other uses of DO_CALL_SCV and avoid similar issues in the future. Tested on powerpc, powerpc64, and powerpc64le (with and without scv) Reviewed-by: Raphael M Zinsly --- sysdeps/unix/sysv/linux/powerpc/syscall.S | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sysdeps/unix/sysv/linux/powerpc/syscall.S b/sysdeps/unix/sysv/linux/powerpc/syscall.S index a29652feaf..a5497c8370 100644 --- a/sysdeps/unix/sysv/linux/powerpc/syscall.S +++ b/sysdeps/unix/sysv/linux/powerpc/syscall.S @@ -27,7 +27,11 @@ ENTRY (syscall) mr r8,r9 #if defined(USE_PPC_SCV) && !IS_IN(rtld) && (defined(__PPC64__) || defined(__powerpc64__)) CHECK_SCV_SUPPORT r9 0f + stdu r1,-SCV_FRAME_SIZE(r1) + cfi_adjust_cfa_offset(SCV_FRAME_SIZE) DO_CALL_SCV + addi r1,r1,SCV_FRAME_SIZE + cfi_adjust_cfa_offset(-SCV_FRAME_SIZE) RET_SCV b 1f #endif