From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 112AA3858D28 for ; Wed, 15 Dec 2021 17:18:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 112AA3858D28 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1BFGfbtN012449 for ; Wed, 15 Dec 2021 17:18:28 GMT Received: from ppma03wdc.us.ibm.com (ba.79.3fa9.ip4.static.sl-reverse.com [169.63.121.186]) by mx0b-001b2d01.pphosted.com with ESMTP id 3cygmvxbqs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 15 Dec 2021 17:18:28 +0000 Received: from pps.filterd (ppma03wdc.us.ibm.com [127.0.0.1]) by ppma03wdc.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 1BFHCopN024425 for ; Wed, 15 Dec 2021 17:18:27 GMT Received: from b01cxnp22035.gho.pok.ibm.com (b01cxnp22035.gho.pok.ibm.com [9.57.198.25]) by ppma03wdc.us.ibm.com with ESMTP id 3cy7gb7mmw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 15 Dec 2021 17:18:27 +0000 Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp22035.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 1BFHIQa730081412 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 Dec 2021 17:18:26 GMT Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 85C53112062; Wed, 15 Dec 2021 17:18:26 +0000 (GMT) Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 060A611206B; Wed, 15 Dec 2021 17:18:25 +0000 (GMT) Received: from [9.160.111.63] (unknown [9.160.111.63]) by b01ledav004.gho.pok.ibm.com (Postfix) with ESMTP; Wed, 15 Dec 2021 17:18:25 +0000 (GMT) Message-ID: Date: Wed, 15 Dec 2021 11:18:25 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 Subject: Re: [PATCH v2] powerpc64[le]: Allocate extra stack frame on syscall.S Content-Language: en-US To: Matheus Castanho , libc-alpha@sourceware.org Cc: tuliom@linux.ibm.com, rzinsly@linux.ibm.com References: <20211207185211.137019-1-msc@linux.ibm.com> <20211215143916.147403-1-msc@linux.ibm.com> From: Paul E Murphy In-Reply-To: <20211215143916.147403-1-msc@linux.ibm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: vd73ItW9cv-BzydU2czj76870Xo5slFr X-Proofpoint-ORIG-GUID: vd73ItW9cv-BzydU2czj76870Xo5slFr 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_10,2021-12-14_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 spamscore=0 phishscore=0 clxscore=1015 lowpriorityscore=0 malwarescore=0 mlxlogscore=999 mlxscore=0 impostorscore=0 adultscore=0 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112150098 X-Spam-Status: No, score=-13.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, 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-List-Received-Date: Wed, 15 Dec 2021 17:18:30 -0000 On 12/15/21 8:39 AM, Matheus Castanho wrote: > 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) > --- > 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) I think this fixes the issue, but it seems like a workaround of a deficiency in the DO_CALL_SCV macro. Should DO_CALL_SCV take a parameter with current frame size? It would avoid the need to push a dummy frame here. > DO_CALL_SCV > + addi r1,r1,SCV_FRAME_SIZE > + cfi_adjust_cfa_offset(-SCV_FRAME_SIZE) > RET_SCV > b 1f > #endif >