From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id OYpUKBOqZGEzOwAAWB0awg (envelope-from ) for ; Mon, 11 Oct 2021 17:18:11 -0400 Received: by simark.ca (Postfix, from userid 112) id 916FA1F0B9; Mon, 11 Oct 2021 17:18:11 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.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 4AD991E79C for ; Mon, 11 Oct 2021 17:18:10 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A7B953858C3A for ; Mon, 11 Oct 2021 21:18:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A7B953858C3A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1633987086; bh=SyCQpKxpt/DJDRhEpGc9hqrq2FSyzUEGN2OoaY5PLR0=; 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=LwpksHL1B4UqU4+qI/PI3n9hggCzxJTbDTVHrKfhAd3cwzfPqDV6WLfMZZ6NOTZOE wy7zN8+b3u9hbPz5RRIXgF5/6k1HovZ5s75RCvjgiR3DKEihdqzy1Qj1/8ZakxQGYv FwOJLMlsQolpCUi50waT0bju6qtn2oge36eiTspY= Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id A24A93858C3A for ; Mon, 11 Oct 2021 21:17:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A24A93858C3A 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 19BLC9Eg018742 for ; Mon, 11 Oct 2021 17:17:48 -0400 Received: from ppma02dal.us.ibm.com (a.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.10]) by mx0b-001b2d01.pphosted.com with ESMTP id 3bmvyfr2ru-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 11 Oct 2021 17:17:48 -0400 Received: from pps.filterd (ppma02dal.us.ibm.com [127.0.0.1]) by ppma02dal.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 19BLCdeN005375 for ; Mon, 11 Oct 2021 21:17:47 GMT Received: from b01cxnp22034.gho.pok.ibm.com (b01cxnp22034.gho.pok.ibm.com [9.57.198.24]) by ppma02dal.us.ibm.com with ESMTP id 3bk2qaqv03-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 11 Oct 2021 21:17:47 +0000 Received: from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com [9.57.199.110]) by b01cxnp22034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 19BLHj6S44564908 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 11 Oct 2021 21:17:45 GMT Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0A0E9AE062; Mon, 11 Oct 2021 21:17:45 +0000 (GMT) Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 68E74AE060; Mon, 11 Oct 2021 21:17:44 +0000 (GMT) Received: from li-e362e14c-2378-11b2-a85c-87d605f3c641.ibm.com (unknown [9.211.42.145]) by b01ledav005.gho.pok.ibm.com (Postfix) with ESMTP; Mon, 11 Oct 2021 21:17:44 +0000 (GMT) Message-ID: <287929e6460980eb4e0d12a52593689ebf4f309a.camel@us.ibm.com> Subject: Re: [PATCH] Powerpc: Add support for openat and fstatat syscalls To: Ulrich Weigand Date: Mon, 11 Oct 2021 14:17:43 -0700 In-Reply-To: References: <22a9ea816266f1b9e6948a396a1dc45cb5f8f153.camel@us.ibm.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 (3.28.5-16.el8) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: FeGLP3mPBrkubvQnDtM01sDp3NDMco9Q X-Proofpoint-GUID: FeGLP3mPBrkubvQnDtM01sDp3NDMco9Q 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_10,2021-10-11_01,2020-04-07_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=573 suspectscore=0 lowpriorityscore=0 phishscore=0 malwarescore=0 priorityscore=1501 spamscore=0 mlxscore=0 bulkscore=0 impostorscore=0 clxscore=1015 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2109230001 definitions=main-2110110119 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: Carl Love via Gdb-patches Reply-To: Carl Love Cc: Rogerio Alves , gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" 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. > > 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. 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; else if (syscall == 336) result = gdb_sys_recv; else if (syscall == 337) -- 2.25.1