From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id H7g6F2izZGHIPAAAWB0awg (envelope-from ) for ; Mon, 11 Oct 2021 17:58:00 -0400 Received: by simark.ca (Postfix, from userid 112) id 16C941F0B9; Mon, 11 Oct 2021 17:57:59 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 0739F1E813 for ; Mon, 11 Oct 2021 17:57:59 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8BFE73857C75 for ; Mon, 11 Oct 2021 21:57:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8BFE73857C75 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1633989478; bh=iorbcJ1RKisiA5gW1JlYo2yOskV4cI9EwtgAhQimvR8=; h=Subject:To:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=q6jxY8Zi3CeqoHhaja1gouc1XKW5lUb2jxavyQCrgsSEeglC5kE2CFhDRu5q5blb+ s/4aerj+Kmkw+X/Jq1z1qbA6Pfi7Kao5DJHNxyNbX84nPKao8zcTSsz3RyO6fBPSON Ob+odXxSTvXJPSNdA3ple8n8QUvr5faDQANvx4Pk= Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id B40DB3858C3A for ; Mon, 11 Oct 2021 21:57:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B40DB3858C3A Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 19BKfgJs019828 for ; Mon, 11 Oct 2021 17:57:38 -0400 Received: from ppma01wdc.us.ibm.com (fd.55.37a9.ip4.static.sl-reverse.com [169.55.85.253]) by mx0a-001b2d01.pphosted.com with ESMTP id 3bmup4286j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 11 Oct 2021 17:57:38 -0400 Received: from pps.filterd (ppma01wdc.us.ibm.com [127.0.0.1]) by ppma01wdc.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 19BLvGOD015107 for ; Mon, 11 Oct 2021 21:57:37 GMT Received: from b03cxnp07029.gho.boulder.ibm.com (b03cxnp07029.gho.boulder.ibm.com [9.17.130.16]) by ppma01wdc.us.ibm.com with ESMTP id 3bk2q9xva3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 11 Oct 2021 21:57:37 +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 19BLvZJ640042832 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 11 Oct 2021 21:57:35 GMT Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1A34FC6061; Mon, 11 Oct 2021 21:57:35 +0000 (GMT) Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B10F6C6059; Mon, 11 Oct 2021 21:57:34 +0000 (GMT) Received: from lexx (unknown [9.211.72.70]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP; Mon, 11 Oct 2021 21:57:34 +0000 (GMT) Message-ID: Subject: Re: [PATCH] Powerpc: Add support for openat and fstatat syscalls To: Carl Love , Ulrich Weigand Date: Mon, 11 Oct 2021 16:57:34 -0500 In-Reply-To: <287929e6460980eb4e0d12a52593689ebf4f309a.camel@us.ibm.com> References: <22a9ea816266f1b9e6948a396a1dc45cb5f8f153.camel@us.ibm.com> <287929e6460980eb4e0d12a52593689ebf4f309a.camel@us.ibm.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 (3.28.5-10.el7) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: o6difCGLtXI5xea_kIvDCxbGe7jvKEuT X-Proofpoint-ORIG-GUID: o6difCGLtXI5xea_kIvDCxbGe7jvKEuT X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.0.607.475 definitions=2021-10-11_11,2021-10-11_01,2020-04-07_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 phishscore=0 suspectscore=0 adultscore=0 impostorscore=0 mlxscore=0 mlxlogscore=999 clxscore=1015 spamscore=0 bulkscore=0 lowpriorityscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2109230001 definitions=main-2110110122 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: will schmidt via Gdb-patches Reply-To: will schmidt Cc: Rogerio Alves , gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On Mon, 2021-10-11 at 14:17 -0700, Carl Love wrote: > Ulrich: > > On Thu, 2021-10-07 at 19:52 +0200, Ulrich Weigand wrote: > > "Carl Love" wrote on 05.10.2021 22:59:06: > > > > > + else if (syscall == 286) > > > + result = gdb_sys_openat; > > > > This looks OK, but ... > > > > > + else if (syscall == 291) > > > + result = gdb_sys_fstatat64; > > > > syscall 291 is actually different between 32-bit > > and 64-bit: on 32-bit it is fstatat64, but on > > 64-bit it is newfstatat. Noting this comment for below. > > > > Given that this routine seems to be used for > > both flavors, it should be correct for both. > > > > (Also, there seem to be many more syscalls that > > are not handled even though they could be. But > > that can be left for another time I guess ...) > > I changed the fstatat64 to newfstat. I re-ran the regression tests > on > a Power 9 system. The patch does seem to work correctly. Don't have > a > 32-bit system to verify on. So.. the regression tests passed with both fstatat64 and newfstat ? That suggests there is not a significant difference between the two syscalls, or this particular corner is not being tested. > > Please let me know if the patch below looks acceptable. Thanks. > > Carl > > ------------------------------------------------------- > Powerpc: Add support for openat and fstatat syscalls > > [gdb] update ppc-linux-tdep.c > > Add else if syscall entries for the openat and fstatat system calls. > --- > gdb/ppc-linux-tdep.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c > index 1e94922f25a..895dacd7c1b 100644 > --- a/gdb/ppc-linux-tdep.c > +++ b/gdb/ppc-linux-tdep.c > @@ -1391,6 +1391,10 @@ ppc_canonicalize_syscall (int syscall) > result = syscall += 259 - 240; > else if (syscall >= 250 && syscall <= 251) /* tgkill */ > result = syscall + 270 - 250; > + else if (syscall == 286) > + result = gdb_sys_openat; > + else if (syscall == 291) > + result = gdb_sys_newfstatat; The above comment suggests that there needs to be some sort of if/else logic here to handle 32- or 64- bit. If there is rationale for fixing for one, and leaving broken or incorrect for the other, some commentary should be added. Thanks -Will > else if (syscall == 336) > result = gdb_sys_recv; > else if (syscall == 337)