From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 00A25385843D for ; Fri, 17 Dec 2021 18:55:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 00A25385843D Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1BHIAtGE032220 for ; Fri, 17 Dec 2021 18:55:17 GMT 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 3cys72428a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 17 Dec 2021 18:55:16 +0000 Received: from pps.filterd (ppma02wdc.us.ibm.com [127.0.0.1]) by ppma02wdc.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 1BHITnNJ018807 for ; Fri, 17 Dec 2021 18:55:15 GMT Received: from b03cxnp07029.gho.boulder.ibm.com (b03cxnp07029.gho.boulder.ibm.com [9.17.130.16]) by ppma02wdc.us.ibm.com with ESMTP id 3cy780g8e2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 17 Dec 2021 18:55:15 +0000 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 1BHItEcU28246330 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 17 Dec 2021 18:55:14 GMT Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 822A6C6055; Fri, 17 Dec 2021 18:55:14 +0000 (GMT) Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 40E8FC605F; Fri, 17 Dec 2021 18:55:13 +0000 (GMT) Received: from TP480.linux.ibm.com (unknown [9.160.110.141]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP; Fri, 17 Dec 2021 18:55:12 +0000 (GMT) References: <20211207185211.137019-1-msc@linux.ibm.com> <20211215143916.147403-1-msc@linux.ibm.com> <878rwkzc1g.fsf@linux.ibm.com> User-agent: mu4e 1.6.6; emacs 27.2 From: Matheus Castanho To: Paul E Murphy Cc: libc-alpha@sourceware.org, tuliom@linux.ibm.com, rzinsly@linux.ibm.com Subject: Re: [PATCH v2] powerpc64[le]: Allocate extra stack frame on syscall.S Date: Fri, 17 Dec 2021 15:54:47 -0300 In-reply-to: Message-ID: <87fsqrf4ds.fsf@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: h1rkYh0SbELnspkDjoeN8eJe4qQ8K9vm X-Proofpoint-GUID: h1rkYh0SbELnspkDjoeN8eJe4qQ8K9vm 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-17_07,2021-12-16_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 mlxlogscore=999 malwarescore=0 clxscore=1015 mlxscore=0 bulkscore=0 suspectscore=0 phishscore=0 spamscore=0 impostorscore=0 adultscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112170104 X-Spam-Status: No, score=-11.7 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-List-Received-Date: Fri, 17 Dec 2021 18:55:19 -0000 Paul E Murphy writes: > On 12/16/21 10:52 AM, Matheus Castanho wrote: >> Paul E Murphy writes: >> >>> 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. >>> >> That is an option. But I opted to allocate the dummy frame to make it >> consistent other uses of DO_CALL_SCV. I believe this will be easier to >> maintain, as there will be one less exceptional way to handle scv to >> worry about. >> And in the end, the benefit of not allocating the dummy frame is >> probably negligible, as the overall syscall latency will be dominated by >> the context switch + kernel-side handling. > > OK. I agree with that. LGTM. Pushed as ae91d3df24a4a1b1f264d101a71a298bff310d14 Thanks, Matheus Castanho