From nobody Sun May 19 03:12:51 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1653475909454253.03374076108787; Wed, 25 May 2022 03:51:49 -0700 (PDT) Received: from localhost ([::1]:40082 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ntocG-0005VO-4d for importer@patchew.org; Wed, 25 May 2022 06:51:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49434) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntoRv-0005iI-6n for qemu-devel@nongnu.org; Wed, 25 May 2022 06:41:07 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:55637) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntoRt-0002Ez-1Q for qemu-devel@nongnu.org; Wed, 25 May 2022 06:41:06 -0400 Received: from quad ([82.142.8.70]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.183]) with ESMTPSA (Nemesis) id 1Mlvmv-1nTJ7I1VsR-00j5N1; Wed, 25 May 2022 12:40:59 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Cc: Richard Henderson , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier Subject: [PULL 1/8] linux-user: Clean up arg_start/arg_end confusion Date: Wed, 25 May 2022 12:40:50 +0200 Message-Id: <20220525104057.543354-2-laurent@vivier.eu> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220525104057.543354-1-laurent@vivier.eu> References: <20220525104057.543354-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:KUpEMC3ior1D/hsJiWrtM0d+b5G0ENpjZKmmApIAFJC5/TK7Was g9EntNZEMZZ+ODoue00pxcL3HLB9wEXSX7E5xRADCGZUIM50QJ/5/fZJcNHCHbYjLblqt0o /feTCxEhyX5aMWAGiJyCyDu4LqhtOfpoi3wVIW+9AxDsDoAWk+C4tVeDLZaRGOE7F/5EECP EmbOMPWxAnFXkS3LHAb4w== X-UI-Out-Filterresults: notjunk:1;V03:K0:G4vrW7JqFP0=:zYzGrUh1bL/xLQHBl5QH4D 72Y44OkVKE41KBiTBXUwXmG/rNiOXxfemtTdRy4eh5wxaxYYfcbLRFJKdriaa1osffBcttSL0 FuZcK5DgcFuhlCywtKus4J4me/vDKbBftUIjkZlBvgw94SpWr5RjdHvUbRkjPQPFPMp6A5j3c BF8K33DHXFxvyaMuZHaCJy3Sg7AF5Al+aHApJf3iJ56P36ZPzWsFibBSDrU8boWkm2CVy753r qrSvnKwSeWWYoHaIgLUfhIaa5jz5HV4FI7wtSpQFNWbm2KGphRH1/+nLAD8x/j9G0Infw+bVz 4+atUU8eASYKXlNUXAQFSiase+aTzEGDEkhvaBJDT3yMHz8QDVs2Ml63LXGc5gluvDbs5yDLM vPm+0et2mNEH4pL9RNPCxjdbcGnE1y/QXYZyas/aat1G+6PW8XUo6DobYp+vr8F5hywFqUveQ LSsOgmAcGX9TUbYqNUYe3lZMT7LkFJ+efTUNIlUDQONnONHB03JqwlJUoZxWSjrSzxZRuS5T9 nLSXKlVR63Ed8CGwdFH6N9v6/e0UjRawBTMWG3CR2N/1dYoCNvDX4JMe7ERgTrG44vFxT4Fer pUcu+bVE72gT6dk8xH5wiwBDkLpv4R184mLUgAaUphjCTt+zMo2qyb7BojhBv6Ala5a99rP2z 7pS0ga4HCqwVSzNpWNvh3M+j4Jmj+jyHh0hgOKJBuQlMNynACI+AfG+NGbo90ngtWFjtpMAUz eaN6GfJRPVxSg3hGYRvPaPN6w6pHC7g+/DWBpA== Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=212.227.17.24; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1653475910065100001 From: Richard Henderson We had two sets of variables: arg_start/arg_end, and arg_strings/env_strings. In linuxload.c, we set the first pair to the bounds of the argv strings, but in elfload.c, we set the first pair to the bounds of the argv pointers and the second pair to the bounds of the argv strings. Remove arg_start/arg_end, replacing them with the standard argc/argv/envc/envp values. Retain arg_strings/env_strings with the meaning we were using in elfload.c. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/714 Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Richard Henderson Message-Id: <20220427025129.160184-1-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/elfload.c | 10 ++++++---- linux-user/linuxload.c | 12 ++++++++++-- linux-user/main.c | 4 ++-- linux-user/qemu.h | 12 ++++++++---- semihosting/arm-compat-semi.c | 4 ++-- 5 files changed, 28 insertions(+), 14 deletions(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 61063fd974e5..8c0765dd4b12 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -1516,8 +1516,8 @@ static inline void init_thread(struct target_pt_regs = *regs, regs->iaoq[0] =3D infop->entry; regs->iaoq[1] =3D infop->entry + 4; regs->gr[23] =3D 0; - regs->gr[24] =3D infop->arg_start; - regs->gr[25] =3D (infop->arg_end - infop->arg_start) / sizeof(abi_ulon= g); + regs->gr[24] =3D infop->argv; + regs->gr[25] =3D infop->argc; /* The top-of-stack contains a linkage buffer. */ regs->gr[30] =3D infop->start_stack + 64; regs->gr[31] =3D infop->entry; @@ -2120,8 +2120,10 @@ static abi_ulong create_elf_tables(abi_ulong p, int = argc, int envc, u_envp =3D u_argv + (argc + 1) * n; u_auxv =3D u_envp + (envc + 1) * n; info->saved_auxv =3D u_auxv; - info->arg_start =3D u_argv; - info->arg_end =3D u_argv + argc * n; + info->argc =3D argc; + info->envc =3D envc; + info->argv =3D u_argv; + info->envp =3D u_envp; =20 /* This is correct because Linux defines * elf_addr_t as Elf32_Off / Elf64_Off diff --git a/linux-user/linuxload.c b/linux-user/linuxload.c index 2ed5fc45ed8c..745cce70abfa 100644 --- a/linux-user/linuxload.c +++ b/linux-user/linuxload.c @@ -92,6 +92,11 @@ abi_ulong loader_build_argptr(int envc, int argc, abi_ul= ong sp, envp =3D sp; sp -=3D (argc + 1) * n; argv =3D sp; + ts->info->envp =3D envp; + ts->info->envc =3D envc; + ts->info->argv =3D argv; + ts->info->argc =3D argc; + if (push_ptr) { /* FIXME - handle put_user() failures */ sp -=3D n; @@ -99,19 +104,22 @@ abi_ulong loader_build_argptr(int envc, int argc, abi_= ulong sp, sp -=3D n; put_user_ual(argv, sp); } + sp -=3D n; /* FIXME - handle put_user() failures */ put_user_ual(argc, sp); - ts->info->arg_start =3D stringp; + + ts->info->arg_strings =3D stringp; while (argc-- > 0) { /* FIXME - handle put_user() failures */ put_user_ual(stringp, argv); argv +=3D n; stringp +=3D target_strlen(stringp) + 1; } - ts->info->arg_end =3D stringp; /* FIXME - handle put_user() failures */ put_user_ual(0, argv); + + ts->info->env_strings =3D stringp; while (envc-- > 0) { /* FIXME - handle put_user() failures */ put_user_ual(stringp, envp); diff --git a/linux-user/main.c b/linux-user/main.c index 7ca48664e447..651e32f5f248 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -878,9 +878,9 @@ int main(int argc, char **argv, char **envp) fprintf(f, "entry 0x" TARGET_ABI_FMT_lx "\n", info->entry); fprintf(f, "argv_start 0x" TARGET_ABI_FMT_lx "\n", - info->arg_start); + info->argv); fprintf(f, "env_start 0x" TARGET_ABI_FMT_lx "\n", - info->arg_end + (abi_ulong)sizeof(abi_ulong)); + info->envp); fprintf(f, "auxv_start 0x" TARGET_ABI_FMT_lx "\n", info->saved_auxv); qemu_log_unlock(f); diff --git a/linux-user/qemu.h b/linux-user/qemu.h index 46550f5e2178..7d90de1b1549 100644 --- a/linux-user/qemu.h +++ b/linux-user/qemu.h @@ -40,15 +40,19 @@ struct image_info { abi_ulong data_offset; abi_ulong saved_auxv; abi_ulong auxv_len; - abi_ulong arg_start; - abi_ulong arg_end; - abi_ulong arg_strings; - abi_ulong env_strings; + abi_ulong argc; + abi_ulong argv; + abi_ulong envc; + abi_ulong envp; abi_ulong file_string; uint32_t elf_flags; int personality; abi_ulong alignment; =20 + /* Generic semihosting knows about these pointers. */ + abi_ulong arg_strings; /* strings for argv */ + abi_ulong env_strings; /* strings for envp; ends arg_strin= gs */ + /* The fields below are used in FDPIC mode. */ abi_ulong loadmap_addr; uint16_t nsegs; diff --git a/semihosting/arm-compat-semi.c b/semihosting/arm-compat-semi.c index 7a51fd0737d1..b6ddaf863ade 100644 --- a/semihosting/arm-compat-semi.c +++ b/semihosting/arm-compat-semi.c @@ -1106,7 +1106,7 @@ target_ulong do_common_semihosting(CPUState *cs) #else unsigned int i; =20 - output_size =3D ts->info->arg_end - ts->info->arg_start; + output_size =3D ts->info->env_strings - ts->info->arg_strings; if (!output_size) { /* * We special-case the "empty command line" case (argc=3D= =3D0). @@ -1146,7 +1146,7 @@ target_ulong do_common_semihosting(CPUState *cs) goto out; } =20 - if (copy_from_user(output_buffer, ts->info->arg_start, + if (copy_from_user(output_buffer, ts->info->arg_strings, output_size)) { errno =3D EFAULT; status =3D set_swi_errno(cs, -1); --=20 2.36.1 From nobody Sun May 19 03:12:51 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1653475445699387.1195922603258; Wed, 25 May 2022 03:44:05 -0700 (PDT) Received: from localhost ([::1]:60576 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ntoUl-0008J0-Su for importer@patchew.org; Wed, 25 May 2022 06:44:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49408) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntoRs-0005hA-Us for qemu-devel@nongnu.org; Wed, 25 May 2022 06:41:05 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:40869) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntoRr-0002Eg-4B for qemu-devel@nongnu.org; Wed, 25 May 2022 06:41:04 -0400 Received: from quad ([82.142.8.70]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MOiU5-1oCK843Pjj-00Q8MV; Wed, 25 May 2022 12:41:00 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Cc: Fabrice Fontaine , Laurent Vivier Subject: [PULL 2/8] linux-user/syscall.c: fix build without RLIMIT_RTTIME Date: Wed, 25 May 2022 12:40:51 +0200 Message-Id: <20220525104057.543354-3-laurent@vivier.eu> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220525104057.543354-1-laurent@vivier.eu> References: <20220525104057.543354-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:91PlVt1mt/Uv5diSQzvOx/MDj0Nq+267cAXwd2ByrdBr7ni5BNQ L/C9QQevGn826pHOTWo5rb692eSnOnLDw1yy2f/7S6nB+w2C5w+HaCPJF9VjhG76o3noJan syvpUHtSABdI5MBFoJ7tSG63hvXfm+Y7I+V8/JjomHpBHBnPJq8tSdsEKlA4BhufVlvOTZd OiTRpgXvjmku+flKmESnQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:Wo11K1zsA6w=:F4US/Xh/juAiXygAgVT3rw Wd9Qrgi4+XkQAPW9hkrXR+05D7otkrShspCliiTFBdkozENnNb8gbl967HzowZwtEvMmlPmf/ h7KwtldNEqDFagX2i0sqPzHaSbjByXTreoN3b2SO09+N3EnpkPH3lMmldYmMQMeeeQvTNkuZ7 DmIoqKTUkXbHJ6FI0g1MK4WXius9SBSL/GFu4xHjEv+e0hNE5ZUMfSK7moBzAwRHQF7LK/Hgy NJYqBGvuXjDAki+oXHX5rygY29hdVNV330UlA+wIkx5f+uAicdrxHOCPCdub3BoXYUROSMs0l hFGOE1ZI/SI/HjKLAHekjInSBZiR3MUty64j53NJQJFYcNsFch40F93YMC+Sh7Ko8dQukg5MN +LhAl6GtcrTUgEaABY4B9bvp7axbZFEINycU+/+v92yphTCy0wSfVlEIagFwU++YdOEN+WF4i yDJe4R/RtDhCjljHwqhzmICMc/NYC3yniJVOjtN+GPAlkY1Yc7DQ1GN5pgQEB42ZQACLFV+Tn jnqSsd78ZxB2RQ9BP9e68ynLJ94a9NJxnEXoVRBkw73IXsRJjNQ4hvHVkoAoVsDWx2xpfHzy+ mbQW6q5aep1w/U6WU1ntHKatGcA+uT3rr2ZW/KbzfhuuHz4Dxoz1dgvbLGtSgnx31MApm3YPI t8yC3ZBED+CuZQshfDpYwlfwPvi/0DvSAHCjbM7liryn2SV+Ircz4wBDy3Ep9fWHSpJflvcRC EKf436J9h5LZ5ZlYyIrHXkAzHan9CAzwvWV1hg== Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=212.227.17.24; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1653475447002100001 Content-Type: text/plain; charset="utf-8" From: Fabrice Fontaine RLIMIT_RTTIME is not provided by uclibc-ng or by musl prior to version 1.2.0 and https://github.com/bminor/musl/commit/2507e7f5312e79620f6337935d0a6c9045ccb= a09 resulting in the following build failure since https://git.qemu.org/?p=3Dqemu.git;a=3Dcommit;h=3D244fd08323088db73590ff231= 7dfe86f810b51d7: ../linux-user/syscall.c: In function 'target_to_host_resource': ../linux-user/syscall.c:1057:16: error: 'RLIMIT_RTTIME' undeclared (first u= se in this function); did you mean 'RLIMIT_NOFILE'? 1057 | return RLIMIT_RTTIME; | ^~~~~~~~~~~~~ | RLIMIT_NOFILE Fixes: - http://autobuild.buildroot.org/results/22d3b584b704613d030e1ea9e6b709b71= 3e4cc26 Signed-off-by: Fabrice Fontaine Reviewed-by: Laurent Vivier Message-Id: <20220523105239.1499162-1-fontaine.fabrice@gmail.com> Signed-off-by: Laurent Vivier --- linux-user/syscall.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index dd0d92ba4ee0..488facb3560e 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -1053,8 +1053,10 @@ static inline int target_to_host_resource(int code) return RLIMIT_RSS; case TARGET_RLIMIT_RTPRIO: return RLIMIT_RTPRIO; +#ifdef RLIMIT_RTTIME case TARGET_RLIMIT_RTTIME: return RLIMIT_RTTIME; +#endif case TARGET_RLIMIT_SIGPENDING: return RLIMIT_SIGPENDING; case TARGET_RLIMIT_STACK: --=20 2.36.1 From nobody Sun May 19 03:12:51 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1653476104428836.3856628788162; Wed, 25 May 2022 03:55:04 -0700 (PDT) Received: from localhost ([::1]:46512 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ntofP-0001pr-Bi for importer@patchew.org; Wed, 25 May 2022 06:55:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49536) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntoS1-0005pV-4o for qemu-devel@nongnu.org; Wed, 25 May 2022 06:41:13 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:34649) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntoRz-0002GA-Fv for qemu-devel@nongnu.org; Wed, 25 May 2022 06:41:12 -0400 Received: from quad ([82.142.8.70]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MXpQA-1oLR441HY4-00Y8qu; Wed, 25 May 2022 12:41:00 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Laurent Vivier Subject: [PULL 3/8] linux-user/elfload: Remove pointless non-const CPUArchState cast Date: Wed, 25 May 2022 12:40:52 +0200 Message-Id: <20220525104057.543354-4-laurent@vivier.eu> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220525104057.543354-1-laurent@vivier.eu> References: <20220525104057.543354-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:bM+WLcsGlPlls6hjfH/3Osg94oevRBi2qkgbU/olCcYs5YRXl2+ YTOkXx7Qf+79cim4ll+0Q7zMC2J/FsEp5+kE76abf/1DrysjW0o0fRHMX/JQWrQbnLLOCza hqfe9vRw4eSEIiUa9zpF4vrH1NGe4C8ma37Sy4AHL+KwsiuhJa2OqDS3Oab62s2XM9Tb0Ep FhO7Wrv0/VPYkFZ0Rp27g== X-UI-Out-Filterresults: notjunk:1;V03:K0:czYOaR77KBo=:9hA3B5tyWZBuLLvyjikYhq GufDfNbQavHkNC9XUnPFFpmu+w62/T2aXCzQKfUYLUkrSU3d5cH/eCqSGEInw21FSZldPfbU+ gRf1adN5iZ+4pw0TwqKaOYRIJd2tvoPrJ8xPOvURlfFnyc24bv6PdzG4QLSfmW5gGqj6gDTgS WaUBjUgFKpnYoqnYNbg1k1iHmfmXn3ue+ODnJEY0xePlUnVy1Fu2ICA7bpwT9Q3YyGC7IVt7g zjEdtN9lGRM8NO2tTa8VRVkIMmzgyYir81gk7vVnaO/WUVI7Vy+EL7hw6qphH/sEh9RgPBKTJ PaRxQu8hFe46DKr3xibcbLG1XU7mrv6WBARmLQV7En2VAOpDuu8XJiUTaz3KPaJTX8lR28xoF giRzViXPzOKUWx11KdvVvSzx1urwONCminN4CJYneNE8p4pd1pssoze3O8jgALDhtTWSvey4i RyQUHxzA1SwtKWtDab3PbK+z2EjjdUg/deKSmc9Ha/P3maRPao5dNmg+xGe9B9g180XISj7sL VuDh1lEOZlchbv3YJ+/TuURmTP7aALWyyE5HjOqUntD2+0998AVSUNawCYVAMHNIY4ifAkmAK mVQRKTLg5ppChO2nvrbA73RMrEShZBfCOfh6TwTumr7UOyOBHIUF5CO2W9fdb+WquJxm24ztI nHzIbx4OHXKxrDRv2Wjf9/VB5AbOIt3tG3R5UQ8BZlIbF2lIgfgFr6ClcWoPa7edT9wFLNDbz 9QtyFEg76eysVD9zJP+435kPK2AvfWZ6HmMx8Q== Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=217.72.192.74; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1653476104736100001 From: Philippe Mathieu-Daud=C3=A9 fill_thread_info() takes a pointer to const. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20220509205728.51912-2-philippe.mathieu.daude@gmail.com> Signed-off-by: Laurent Vivier --- linux-user/elfload.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 8c0765dd4b12..acc21748f993 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -3973,7 +3973,7 @@ static int fill_note_info(struct elf_note_info *info, if (cpu =3D=3D thread_cpu) { continue; } - fill_thread_info(info, (CPUArchState *)cpu->env_ptr); + fill_thread_info(info, cpu->env_ptr); } cpu_list_unlock(); =20 --=20 2.36.1 From nobody Sun May 19 03:12:51 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1653475470670703.3457606764257; Wed, 25 May 2022 03:44:30 -0700 (PDT) Received: from localhost ([::1]:33066 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ntoVA-0000OU-SV for importer@patchew.org; Wed, 25 May 2022 06:44:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49494) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntoRz-0005nA-85 for qemu-devel@nongnu.org; Wed, 25 May 2022 06:41:11 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:40229) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntoRu-0002FG-HG for qemu-devel@nongnu.org; Wed, 25 May 2022 06:41:10 -0400 Received: from quad ([82.142.8.70]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MnZwp-1nSksz3MYf-00jd4D; Wed, 25 May 2022 12:41:01 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Laurent Vivier Subject: [PULL 4/8] linux-user: Have do_syscall() use CPUArchState* instead of void* Date: Wed, 25 May 2022 12:40:53 +0200 Message-Id: <20220525104057.543354-5-laurent@vivier.eu> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220525104057.543354-1-laurent@vivier.eu> References: <20220525104057.543354-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:1TWpHDo3e0PbiWCWZB7BVBS9OGvdZVJNK80WqzBcUVvoDKrqMZy wlHvwfcdWJrxKaeFwelOc8hIeAIRZ4f2mwv4GwbzevJuRKVcgPp8v43pLsok8GLJNKyTvyn wWy6Rz42rvc5botlcFPuO8jq0cwPMbWMkTDiZofpAhivs1Daz05Slt/4LelMUhxNK1Elcc7 lnZ/pZXUrwhSRA5isEV5A== X-UI-Out-Filterresults: notjunk:1;V03:K0:JEIGb+/W8e8=:zvF8oeCIS9pwJPJdzUuqFt aGT1+AdsZKI4mSXzpWfW/xLrGt29Q2NcqrnBsfoC6e2th6tJpUgLXY+Bwv47XyaxLY9Gbwdkq 1c3FxaTD4K0onB9/wgRHhcEZsxlQHRC1jqNyOnfGrHqb3Qj//G2tp5GZo50IuJ6a9sE0aQ7xg yH9uhlk+7y6Z0n6/qauxZy1ssZd0S78YhTpPo7BcFBM3Sa5XYQvnCwgs7u/QId6uG+k8iHkWG hQBCWaor4GW2ncuLWxQilnnAv3qMMZBXkeUV7WJHwNDDlTpdUhdZFC7vpEVptuKZsmJUTmS/z JHgUgJ8Xo/hvzSzwRs2oMsiYs9isgawPjdIFx7sjlKUqw7FX4gr+KIw9ZbjIMgA3b2zSDMmp2 XlMVdopUFr38/Td5tlhuoV5hDP80GMTyZ8PU/DSjZocQkZs5EZa112uZaOmuig9JyfcacsDkI rbALGJwdQAq9RmS47JsEw05MIP0OPQtq7dARJ/s5+4SE3Yl6f75+g9uggznNMmAP1Ds36w4tA 8MeAJPs6KlsojaaiIq/nmmp5niEXIpnHmQjqimLM0O03k2gxF4yX6TMD+qBihFKtJjpYkjHq+ t9gJO5vwp4mFi2pPbGsV9Tesf0Ps0UAQkJBCDSGuierQjzCRVgeTc3oLs9TQkKXm5l0rXN1bw yXdXsILx78k7XiuW8fLZsWz7YWr2CQD8hXHKrVBeIqxgLcYZ8GG4EveI1H0FP02iJ2EtdJn0M Q9jXlIhdUPLuCgr5GGbZyjz1wTOfFcoFEPrUjQ== Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=212.227.17.13; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1653475472891100001 From: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20220509205728.51912-3-philippe.mathieu.daude@gmail.com> Signed-off-by: Laurent Vivier --- linux-user/strace.c | 202 ++++++++++++++++++------------------ linux-user/strace.h | 4 +- linux-user/syscall.c | 32 +++--- linux-user/uname.c | 2 +- linux-user/uname.h | 2 +- linux-user/user-internals.h | 16 +-- 6 files changed, 129 insertions(+), 129 deletions(-) diff --git a/linux-user/strace.c b/linux-user/strace.c index 2cdbf030ba44..9fa681dea9bb 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -22,10 +22,10 @@ struct syscallname { int nr; const char *name; const char *format; - void (*call)(void *, const struct syscallname *, + void (*call)(CPUArchState *, const struct syscallname *, abi_long, abi_long, abi_long, abi_long, abi_long, abi_long); - void (*result)(void *, const struct syscallname *, abi_long, + void (*result)(CPUArchState *, const struct syscallname *, abi_long, abi_long, abi_long, abi_long, abi_long, abi_long, abi_long); }; @@ -593,7 +593,7 @@ print_fdset(int n, abi_ulong target_fds_addr) /* select */ #ifdef TARGET_NR__newselect static void -print_newselect(void *cpu_env, const struct syscallname *name, +print_newselect(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5, abi_long arg6) { @@ -611,7 +611,7 @@ print_newselect(void *cpu_env, const struct syscallname= *name, =20 #ifdef TARGET_NR_semctl static void -print_semctl(void *cpu_env, const struct syscallname *name, +print_semctl(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5, abi_long arg6) { @@ -623,7 +623,7 @@ print_semctl(void *cpu_env, const struct syscallname *n= ame, #endif =20 static void -print_execve(void *cpu_env, const struct syscallname *name, +print_execve(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5, abi_long arg6) { @@ -656,7 +656,7 @@ print_execve(void *cpu_env, const struct syscallname *n= ame, =20 #ifdef TARGET_NR_ipc static void -print_ipc(void *cpu_env, const struct syscallname *name, +print_ipc(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5, abi_long arg6) { @@ -700,7 +700,7 @@ print_syscall_err(abi_long ret) } =20 static void -print_syscall_ret_addr(void *cpu_env, const struct syscallname *name, +print_syscall_ret_addr(CPUArchState *cpu_env, const struct syscallname *na= me, abi_long ret, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) @@ -721,7 +721,7 @@ print_syscall_ret_raw(struct syscallname *name, abi_lon= g ret) =20 #ifdef TARGET_NR__newselect static void -print_syscall_ret_newselect(void *cpu_env, const struct syscallname *name, +print_syscall_ret_newselect(CPUArchState *cpu_env, const struct syscallnam= e *name, abi_long ret, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) @@ -751,7 +751,7 @@ print_syscall_ret_newselect(void *cpu_env, const struct= syscallname *name, #define TARGET_TIME_ERROR 5 /* clock not synchronized */ #ifdef TARGET_NR_adjtimex static void -print_syscall_ret_adjtimex(void *cpu_env, const struct syscallname *name, +print_syscall_ret_adjtimex(CPUArchState *cpu_env, const struct syscallname= *name, abi_long ret, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) @@ -786,7 +786,7 @@ print_syscall_ret_adjtimex(void *cpu_env, const struct = syscallname *name, =20 #if defined(TARGET_NR_clock_gettime) || defined(TARGET_NR_clock_getres) static void -print_syscall_ret_clock_gettime(void *cpu_env, const struct syscallname *n= ame, +print_syscall_ret_clock_gettime(CPUArchState *cpu_env, const struct syscal= lname *name, abi_long ret, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg= 4, abi_long arg5) @@ -805,7 +805,7 @@ print_syscall_ret_clock_gettime(void *cpu_env, const st= ruct syscallname *name, =20 #ifdef TARGET_NR_gettimeofday static void -print_syscall_ret_gettimeofday(void *cpu_env, const struct syscallname *na= me, +print_syscall_ret_gettimeofday(CPUArchState *cpu_env, const struct syscall= name *name, abi_long ret, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) @@ -824,7 +824,7 @@ print_syscall_ret_gettimeofday(void *cpu_env, const str= uct syscallname *name, =20 #ifdef TARGET_NR_getitimer static void -print_syscall_ret_getitimer(void *cpu_env, const struct syscallname *name, +print_syscall_ret_getitimer(CPUArchState *cpu_env, const struct syscallnam= e *name, abi_long ret, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) @@ -843,7 +843,7 @@ print_syscall_ret_getitimer(void *cpu_env, const struct= syscallname *name, =20 #ifdef TARGET_NR_getitimer static void -print_syscall_ret_setitimer(void *cpu_env, const struct syscallname *name, +print_syscall_ret_setitimer(CPUArchState *cpu_env, const struct syscallnam= e *name, abi_long ret, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) @@ -862,7 +862,7 @@ print_syscall_ret_setitimer(void *cpu_env, const struct= syscallname *name, #if defined(TARGET_NR_listxattr) || defined(TARGET_NR_llistxattr) \ || defined(TARGGET_NR_flistxattr) static void -print_syscall_ret_listxattr(void *cpu_env, const struct syscallname *name, +print_syscall_ret_listxattr(CPUArchState *cpu_env, const struct syscallnam= e *name, abi_long ret, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) @@ -894,7 +894,7 @@ print_syscall_ret_listxattr(void *cpu_env, const struct= syscallname *name, =20 #ifdef TARGET_NR_ioctl static void -print_syscall_ret_ioctl(void *cpu_env, const struct syscallname *name, +print_syscall_ret_ioctl(CPUArchState *cpu_env, const struct syscallname *n= ame, abi_long ret, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) @@ -1760,7 +1760,7 @@ print_termios(void *arg) =20 #ifdef TARGET_NR_accept static void -print_accept(void *cpu_env, const struct syscallname *name, +print_accept(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -1774,7 +1774,7 @@ print_accept(void *cpu_env, const struct syscallname = *name, =20 #ifdef TARGET_NR_access static void -print_access(void *cpu_env, const struct syscallname *name, +print_access(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -1787,7 +1787,7 @@ print_access(void *cpu_env, const struct syscallname = *name, =20 #ifdef TARGET_NR_acct static void -print_acct(void *cpu_env, const struct syscallname *name, +print_acct(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -1799,7 +1799,7 @@ print_acct(void *cpu_env, const struct syscallname *n= ame, =20 #ifdef TARGET_NR_brk static void -print_brk(void *cpu_env, const struct syscallname *name, +print_brk(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -1811,7 +1811,7 @@ print_brk(void *cpu_env, const struct syscallname *na= me, =20 #ifdef TARGET_NR_chdir static void -print_chdir(void *cpu_env, const struct syscallname *name, +print_chdir(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -1823,7 +1823,7 @@ print_chdir(void *cpu_env, const struct syscallname *= name, =20 #ifdef TARGET_NR_chroot static void -print_chroot(void *cpu_env, const struct syscallname *name, +print_chroot(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -1835,7 +1835,7 @@ print_chroot(void *cpu_env, const struct syscallname = *name, =20 #ifdef TARGET_NR_chmod static void -print_chmod(void *cpu_env, const struct syscallname *name, +print_chmod(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -1848,7 +1848,7 @@ print_chmod(void *cpu_env, const struct syscallname *= name, =20 #if defined(TARGET_NR_chown) || defined(TARGET_NR_lchown) static void -print_chown(void *cpu_env, const struct syscallname *name, +print_chown(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -1863,7 +1863,7 @@ print_chown(void *cpu_env, const struct syscallname *= name, =20 #ifdef TARGET_NR_clock_adjtime static void -print_clock_adjtime(void *cpu_env, const struct syscallname *name, +print_clock_adjtime(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -1887,7 +1887,7 @@ static void do_print_clone(unsigned int flags, abi_ul= ong newsp, } =20 static void -print_clone(void *cpu_env, const struct syscallname *name, +print_clone(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5, abi_long arg6) { @@ -1907,7 +1907,7 @@ print_clone(void *cpu_env, const struct syscallname *= name, =20 #ifdef TARGET_NR_creat static void -print_creat(void *cpu_env, const struct syscallname *name, +print_creat(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -1920,7 +1920,7 @@ print_creat(void *cpu_env, const struct syscallname *= name, =20 #ifdef TARGET_NR_execv static void -print_execv(void *cpu_env, const struct syscallname *name, +print_execv(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -1933,7 +1933,7 @@ print_execv(void *cpu_env, const struct syscallname *= name, =20 #ifdef TARGET_NR_faccessat static void -print_faccessat(void *cpu_env, const struct syscallname *name, +print_faccessat(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -1948,7 +1948,7 @@ print_faccessat(void *cpu_env, const struct syscallna= me *name, =20 #ifdef TARGET_NR_fallocate static void -print_fallocate(void *cpu_env, const struct syscallname *name, +print_fallocate(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -1968,7 +1968,7 @@ print_fallocate(void *cpu_env, const struct syscallna= me *name, =20 #ifdef TARGET_NR_fchmodat static void -print_fchmodat(void *cpu_env, const struct syscallname *name, +print_fchmodat(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -1983,7 +1983,7 @@ print_fchmodat(void *cpu_env, const struct syscallnam= e *name, =20 #ifdef TARGET_NR_fchownat static void -print_fchownat(void *cpu_env, const struct syscallname *name, +print_fchownat(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -1999,7 +1999,7 @@ print_fchownat(void *cpu_env, const struct syscallnam= e *name, =20 #if defined(TARGET_NR_fcntl) || defined(TARGET_NR_fcntl64) static void -print_fcntl(void *cpu_env, const struct syscallname *name, +print_fcntl(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -2135,7 +2135,7 @@ print_fcntl(void *cpu_env, const struct syscallname *= name, =20 #ifdef TARGET_NR_fgetxattr static void -print_fgetxattr(void *cpu_env, const struct syscallname *name, +print_fgetxattr(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -2150,7 +2150,7 @@ print_fgetxattr(void *cpu_env, const struct syscallna= me *name, =20 #ifdef TARGET_NR_flistxattr static void -print_flistxattr(void *cpu_env, const struct syscallname *name, +print_flistxattr(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -2164,7 +2164,7 @@ print_flistxattr(void *cpu_env, const struct syscalln= ame *name, =20 #if defined(TARGET_NR_getxattr) || defined(TARGET_NR_lgetxattr) static void -print_getxattr(void *cpu_env, const struct syscallname *name, +print_getxattr(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -2180,7 +2180,7 @@ print_getxattr(void *cpu_env, const struct syscallnam= e *name, =20 #if defined(TARGET_NR_listxattr) || defined(TARGET_NR_llistxattr) static void -print_listxattr(void *cpu_env, const struct syscallname *name, +print_listxattr(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -2195,7 +2195,7 @@ print_listxattr(void *cpu_env, const struct syscallna= me *name, =20 #if defined(TARGET_NR_fremovexattr) static void -print_fremovexattr(void *cpu_env, const struct syscallname *name, +print_fremovexattr(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -2208,7 +2208,7 @@ print_fremovexattr(void *cpu_env, const struct syscal= lname *name, =20 #if defined(TARGET_NR_removexattr) || defined(TARGET_NR_lremovexattr) static void -print_removexattr(void *cpu_env, const struct syscallname *name, +print_removexattr(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -2222,7 +2222,7 @@ print_removexattr(void *cpu_env, const struct syscall= name *name, =20 #ifdef TARGET_NR_futimesat static void -print_futimesat(void *cpu_env, const struct syscallname *name, +print_futimesat(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -2237,7 +2237,7 @@ print_futimesat(void *cpu_env, const struct syscallna= me *name, =20 #ifdef TARGET_NR_gettimeofday static void -print_gettimeofday(void *cpu_env, const struct syscallname *name, +print_gettimeofday(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -2250,7 +2250,7 @@ print_gettimeofday(void *cpu_env, const struct syscal= lname *name, =20 #ifdef TARGET_NR_settimeofday static void -print_settimeofday(void *cpu_env, const struct syscallname *name, +print_settimeofday(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -2263,7 +2263,7 @@ print_settimeofday(void *cpu_env, const struct syscal= lname *name, =20 #if defined(TARGET_NR_clock_gettime) || defined(TARGET_NR_clock_getres) static void -print_clock_gettime(void *cpu_env, const struct syscallname *name, +print_clock_gettime(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -2277,7 +2277,7 @@ print_clock_gettime(void *cpu_env, const struct sysca= llname *name, =20 #ifdef TARGET_NR_clock_settime static void -print_clock_settime(void *cpu_env, const struct syscallname *name, +print_clock_settime(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -2290,7 +2290,7 @@ print_clock_settime(void *cpu_env, const struct sysca= llname *name, =20 #ifdef TARGET_NR_getitimer static void -print_getitimer(void *cpu_env, const struct syscallname *name, +print_getitimer(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -2303,7 +2303,7 @@ print_getitimer(void *cpu_env, const struct syscallna= me *name, =20 #ifdef TARGET_NR_setitimer static void -print_setitimer(void *cpu_env, const struct syscallname *name, +print_setitimer(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -2317,7 +2317,7 @@ print_setitimer(void *cpu_env, const struct syscallna= me *name, =20 #ifdef TARGET_NR_link static void -print_link(void *cpu_env, const struct syscallname *name, +print_link(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -2330,7 +2330,7 @@ print_link(void *cpu_env, const struct syscallname *n= ame, =20 #ifdef TARGET_NR_linkat static void -print_linkat(void *cpu_env, const struct syscallname *name, +print_linkat(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -2346,7 +2346,7 @@ print_linkat(void *cpu_env, const struct syscallname = *name, =20 #if defined(TARGET_NR__llseek) || defined(TARGET_NR_llseek) static void -print__llseek(void *cpu_env, const struct syscallname *name, +print__llseek(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -2369,7 +2369,7 @@ print__llseek(void *cpu_env, const struct syscallname= *name, =20 #ifdef TARGET_NR_lseek static void -print_lseek(void *cpu_env, const struct syscallname *name, +print_lseek(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -2400,7 +2400,7 @@ print_lseek(void *cpu_env, const struct syscallname *= name, =20 #ifdef TARGET_NR_truncate static void -print_truncate(void *cpu_env, const struct syscallname *name, +print_truncate(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -2413,7 +2413,7 @@ print_truncate(void *cpu_env, const struct syscallnam= e *name, =20 #ifdef TARGET_NR_truncate64 static void -print_truncate64(void *cpu_env, const struct syscallname *name, +print_truncate64(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -2430,7 +2430,7 @@ print_truncate64(void *cpu_env, const struct syscalln= ame *name, =20 #ifdef TARGET_NR_ftruncate64 static void -print_ftruncate64(void *cpu_env, const struct syscallname *name, +print_ftruncate64(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -2447,7 +2447,7 @@ print_ftruncate64(void *cpu_env, const struct syscall= name *name, =20 #ifdef TARGET_NR_mlockall static void -print_mlockall(void *cpu_env, const struct syscallname *name, +print_mlockall(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -2459,7 +2459,7 @@ print_mlockall(void *cpu_env, const struct syscallnam= e *name, =20 #if defined(TARGET_NR_socket) static void -print_socket(void *cpu_env, const struct syscallname *name, +print_socket(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -2920,7 +2920,7 @@ static struct { }; =20 static void -print_socketcall(void *cpu_env, const struct syscallname *name, +print_socketcall(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -2941,7 +2941,7 @@ print_socketcall(void *cpu_env, const struct syscalln= ame *name, =20 #if defined(TARGET_NR_bind) static void -print_bind(void *cpu_env, const struct syscallname *name, +print_bind(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -2955,7 +2955,7 @@ print_bind(void *cpu_env, const struct syscallname *n= ame, #if defined(TARGET_NR_stat) || defined(TARGET_NR_stat64) || \ defined(TARGET_NR_lstat) || defined(TARGET_NR_lstat64) static void -print_stat(void *cpu_env, const struct syscallname *name, +print_stat(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -2971,7 +2971,7 @@ print_stat(void *cpu_env, const struct syscallname *n= ame, =20 #if defined(TARGET_NR_fstat) || defined(TARGET_NR_fstat64) static void -print_fstat(void *cpu_env, const struct syscallname *name, +print_fstat(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -2985,7 +2985,7 @@ print_fstat(void *cpu_env, const struct syscallname *= name, =20 #ifdef TARGET_NR_mkdir static void -print_mkdir(void *cpu_env, const struct syscallname *name, +print_mkdir(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -2998,7 +2998,7 @@ print_mkdir(void *cpu_env, const struct syscallname *= name, =20 #ifdef TARGET_NR_mkdirat static void -print_mkdirat(void *cpu_env, const struct syscallname *name, +print_mkdirat(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -3012,7 +3012,7 @@ print_mkdirat(void *cpu_env, const struct syscallname= *name, =20 #ifdef TARGET_NR_rmdir static void -print_rmdir(void *cpu_env, const struct syscallname *name, +print_rmdir(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -3024,7 +3024,7 @@ print_rmdir(void *cpu_env, const struct syscallname *= name, =20 #ifdef TARGET_NR_rt_sigaction static void -print_rt_sigaction(void *cpu_env, const struct syscallname *name, +print_rt_sigaction(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -3038,7 +3038,7 @@ print_rt_sigaction(void *cpu_env, const struct syscal= lname *name, =20 #ifdef TARGET_NR_rt_sigprocmask static void -print_rt_sigprocmask(void *cpu_env, const struct syscallname *name, +print_rt_sigprocmask(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -3058,7 +3058,7 @@ print_rt_sigprocmask(void *cpu_env, const struct sysc= allname *name, =20 #ifdef TARGET_NR_rt_sigqueueinfo static void -print_rt_sigqueueinfo(void *cpu_env, const struct syscallname *name, +print_rt_sigqueueinfo(CPUArchState *cpu_env, const struct syscallname *nam= e, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -3083,7 +3083,7 @@ print_rt_sigqueueinfo(void *cpu_env, const struct sys= callname *name, =20 #ifdef TARGET_NR_rt_tgsigqueueinfo static void -print_rt_tgsigqueueinfo(void *cpu_env, const struct syscallname *name, +print_rt_tgsigqueueinfo(CPUArchState *cpu_env, const struct syscallname *n= ame, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -3167,7 +3167,7 @@ print_syslog_action(abi_ulong arg, int last) } =20 static void -print_syslog(void *cpu_env, const struct syscallname *name, +print_syslog(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -3181,7 +3181,7 @@ print_syslog(void *cpu_env, const struct syscallname = *name, =20 #ifdef TARGET_NR_mknod static void -print_mknod(void *cpu_env, const struct syscallname *name, +print_mknod(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -3200,7 +3200,7 @@ print_mknod(void *cpu_env, const struct syscallname *= name, =20 #ifdef TARGET_NR_mknodat static void -print_mknodat(void *cpu_env, const struct syscallname *name, +print_mknodat(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -3220,7 +3220,7 @@ print_mknodat(void *cpu_env, const struct syscallname= *name, =20 #ifdef TARGET_NR_mq_open static void -print_mq_open(void *cpu_env, const struct syscallname *name, +print_mq_open(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -3239,7 +3239,7 @@ print_mq_open(void *cpu_env, const struct syscallname= *name, =20 #ifdef TARGET_NR_open static void -print_open(void *cpu_env, const struct syscallname *name, +print_open(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -3256,7 +3256,7 @@ print_open(void *cpu_env, const struct syscallname *n= ame, =20 #ifdef TARGET_NR_openat static void -print_openat(void *cpu_env, const struct syscallname *name, +print_openat(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -3274,7 +3274,7 @@ print_openat(void *cpu_env, const struct syscallname = *name, =20 #ifdef TARGET_NR_mq_unlink static void -print_mq_unlink(void *cpu_env, const struct syscallname *name, +print_mq_unlink(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -3286,7 +3286,7 @@ print_mq_unlink(void *cpu_env, const struct syscallna= me *name, =20 #if defined(TARGET_NR_fstatat64) || defined(TARGET_NR_newfstatat) static void -print_fstatat64(void *cpu_env, const struct syscallname *name, +print_fstatat64(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -3302,7 +3302,7 @@ print_fstatat64(void *cpu_env, const struct syscallna= me *name, =20 #ifdef TARGET_NR_readlink static void -print_readlink(void *cpu_env, const struct syscallname *name, +print_readlink(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -3316,7 +3316,7 @@ print_readlink(void *cpu_env, const struct syscallnam= e *name, =20 #ifdef TARGET_NR_readlinkat static void -print_readlinkat(void *cpu_env, const struct syscallname *name, +print_readlinkat(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -3331,7 +3331,7 @@ print_readlinkat(void *cpu_env, const struct syscalln= ame *name, =20 #ifdef TARGET_NR_rename static void -print_rename(void *cpu_env, const struct syscallname *name, +print_rename(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -3344,7 +3344,7 @@ print_rename(void *cpu_env, const struct syscallname = *name, =20 #ifdef TARGET_NR_renameat static void -print_renameat(void *cpu_env, const struct syscallname *name, +print_renameat(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -3359,7 +3359,7 @@ print_renameat(void *cpu_env, const struct syscallnam= e *name, =20 #ifdef TARGET_NR_statfs static void -print_statfs(void *cpu_env, const struct syscallname *name, +print_statfs(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -3372,7 +3372,7 @@ print_statfs(void *cpu_env, const struct syscallname = *name, =20 #ifdef TARGET_NR_statfs64 static void -print_statfs64(void *cpu_env, const struct syscallname *name, +print_statfs64(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -3385,7 +3385,7 @@ print_statfs64(void *cpu_env, const struct syscallnam= e *name, =20 #ifdef TARGET_NR_symlink static void -print_symlink(void *cpu_env, const struct syscallname *name, +print_symlink(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -3398,7 +3398,7 @@ print_symlink(void *cpu_env, const struct syscallname= *name, =20 #ifdef TARGET_NR_symlinkat static void -print_symlinkat(void *cpu_env, const struct syscallname *name, +print_symlinkat(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -3412,7 +3412,7 @@ print_symlinkat(void *cpu_env, const struct syscallna= me *name, =20 #ifdef TARGET_NR_mount static void -print_mount(void *cpu_env, const struct syscallname *name, +print_mount(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -3428,7 +3428,7 @@ print_mount(void *cpu_env, const struct syscallname *= name, =20 #ifdef TARGET_NR_umount static void -print_umount(void *cpu_env, const struct syscallname *name, +print_umount(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -3440,7 +3440,7 @@ print_umount(void *cpu_env, const struct syscallname = *name, =20 #ifdef TARGET_NR_umount2 static void -print_umount2(void *cpu_env, const struct syscallname *name, +print_umount2(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -3453,7 +3453,7 @@ print_umount2(void *cpu_env, const struct syscallname= *name, =20 #ifdef TARGET_NR_unlink static void -print_unlink(void *cpu_env, const struct syscallname *name, +print_unlink(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -3465,7 +3465,7 @@ print_unlink(void *cpu_env, const struct syscallname = *name, =20 #ifdef TARGET_NR_unlinkat static void -print_unlinkat(void *cpu_env, const struct syscallname *name, +print_unlinkat(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -3479,7 +3479,7 @@ print_unlinkat(void *cpu_env, const struct syscallnam= e *name, =20 #ifdef TARGET_NR_unshare static void -print_unshare(void *cpu_env, const struct syscallname *name, +print_unshare(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -3491,7 +3491,7 @@ print_unshare(void *cpu_env, const struct syscallname= *name, =20 #ifdef TARGET_NR_utime static void -print_utime(void *cpu_env, const struct syscallname *name, +print_utime(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -3504,7 +3504,7 @@ print_utime(void *cpu_env, const struct syscallname *= name, =20 #ifdef TARGET_NR_utimes static void -print_utimes(void *cpu_env, const struct syscallname *name, +print_utimes(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -3517,7 +3517,7 @@ print_utimes(void *cpu_env, const struct syscallname = *name, =20 #ifdef TARGET_NR_utimensat static void -print_utimensat(void *cpu_env, const struct syscallname *name, +print_utimensat(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -3532,7 +3532,7 @@ print_utimensat(void *cpu_env, const struct syscallna= me *name, =20 #if defined(TARGET_NR_mmap) || defined(TARGET_NR_mmap2) static void -print_mmap(void *cpu_env, const struct syscallname *name, +print_mmap(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -3550,7 +3550,7 @@ print_mmap(void *cpu_env, const struct syscallname *n= ame, =20 #ifdef TARGET_NR_mprotect static void -print_mprotect(void *cpu_env, const struct syscallname *name, +print_mprotect(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -3564,7 +3564,7 @@ print_mprotect(void *cpu_env, const struct syscallnam= e *name, =20 #ifdef TARGET_NR_munmap static void -print_munmap(void *cpu_env, const struct syscallname *name, +print_munmap(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -3617,7 +3617,7 @@ if( cmd =3D=3D val ) { \ } =20 static void -print_futex(void *cpu_env, const struct syscallname *name, +print_futex(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -3634,7 +3634,7 @@ print_futex(void *cpu_env, const struct syscallname *= name, =20 #ifdef TARGET_NR_kill static void -print_kill(void *cpu_env, const struct syscallname *name, +print_kill(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -3647,7 +3647,7 @@ print_kill(void *cpu_env, const struct syscallname *n= ame, =20 #ifdef TARGET_NR_tkill static void -print_tkill(void *cpu_env, const struct syscallname *name, +print_tkill(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -3660,7 +3660,7 @@ print_tkill(void *cpu_env, const struct syscallname *= name, =20 #ifdef TARGET_NR_tgkill static void -print_tgkill(void *cpu_env, const struct syscallname *name, +print_tgkill(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -3674,7 +3674,7 @@ print_tgkill(void *cpu_env, const struct syscallname = *name, =20 #ifdef TARGET_NR_statx static void -print_statx(void *cpu_env, const struct syscallname *name, +print_statx(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -3690,7 +3690,7 @@ print_statx(void *cpu_env, const struct syscallname *= name, =20 #ifdef TARGET_NR_ioctl static void -print_ioctl(void *cpu_env, const struct syscallname *name, +print_ioctl(CPUArchState *cpu_env, const struct syscallname *name, abi_long arg0, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5) { @@ -3775,7 +3775,7 @@ static int nsyscalls =3D ARRAY_SIZE(scnames); * The public interface to this module. */ void -print_syscall(void *cpu_env, int num, +print_syscall(CPUArchState *cpu_env, int num, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5, abi_long arg6) { @@ -3804,7 +3804,7 @@ print_syscall(void *cpu_env, int num, =20 =20 void -print_syscall_ret(void *cpu_env, int num, abi_long ret, +print_syscall_ret(CPUArchState *cpu_env, int num, abi_long ret, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5, abi_long arg6) { diff --git a/linux-user/strace.h b/linux-user/strace.h index 1e232d07fc85..d5e7f26bcb83 100644 --- a/linux-user/strace.h +++ b/linux-user/strace.h @@ -18,10 +18,10 @@ #ifndef LINUX_USER_STRACE_H #define LINUX_USER_STRACE_H =20 -void print_syscall(void *cpu_env, int num, +void print_syscall(CPUArchState *cpu_env, int num, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5, abi_long arg6); -void print_syscall_ret(void *cpu_env, int num, abi_long ret, +void print_syscall_ret(CPUArchState *cpu_env, int num, abi_long ret, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5, abi_long arg6); /** diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 488facb3560e..2395988e66cb 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -1598,7 +1598,7 @@ static abi_long do_pipe2(int host_pipe[], int flags) #endif } =20 -static abi_long do_pipe(void *cpu_env, abi_ulong pipedes, +static abi_long do_pipe(CPUArchState *cpu_env, abi_ulong pipedes, int flags, int is_pipe2) { int host_pipe[2]; @@ -7252,7 +7252,7 @@ void syscall_init(void) } =20 #ifdef TARGET_NR_truncate64 -static inline abi_long target_truncate64(void *cpu_env, const char *arg1, +static inline abi_long target_truncate64(CPUArchState *cpu_env, const char= *arg1, abi_long arg2, abi_long arg3, abi_long arg4) @@ -7266,7 +7266,7 @@ static inline abi_long target_truncate64(void *cpu_en= v, const char *arg1, #endif =20 #ifdef TARGET_NR_ftruncate64 -static inline abi_long target_ftruncate64(void *cpu_env, abi_long arg1, +static inline abi_long target_ftruncate64(CPUArchState *cpu_env, abi_long = arg1, abi_long arg2, abi_long arg3, abi_long arg4) @@ -7561,7 +7561,7 @@ static inline int target_to_host_mlockall_arg(int arg) #if (defined(TARGET_NR_stat64) || defined(TARGET_NR_lstat64) || \ defined(TARGET_NR_fstat64) || defined(TARGET_NR_fstatat64) || \ defined(TARGET_NR_newfstatat)) -static inline abi_long host_to_target_stat64(void *cpu_env, +static inline abi_long host_to_target_stat64(CPUArchState *cpu_env, abi_ulong target_addr, struct stat *host_st) { @@ -7963,7 +7963,7 @@ int host_to_target_waitstatus(int status) return status; } =20 -static int open_self_cmdline(void *cpu_env, int fd) +static int open_self_cmdline(CPUArchState *cpu_env, int fd) { CPUState *cpu =3D env_cpu((CPUArchState *)cpu_env); struct linux_binprm *bprm =3D ((TaskState *)cpu->opaque)->bprm; @@ -7980,7 +7980,7 @@ static int open_self_cmdline(void *cpu_env, int fd) return 0; } =20 -static int open_self_maps(void *cpu_env, int fd) +static int open_self_maps(CPUArchState *cpu_env, int fd) { CPUState *cpu =3D env_cpu((CPUArchState *)cpu_env); TaskState *ts =3D cpu->opaque; @@ -8042,7 +8042,7 @@ static int open_self_maps(void *cpu_env, int fd) return 0; } =20 -static int open_self_stat(void *cpu_env, int fd) +static int open_self_stat(CPUArchState *cpu_env, int fd) { CPUState *cpu =3D env_cpu((CPUArchState *)cpu_env); TaskState *ts =3D cpu->opaque; @@ -8080,7 +8080,7 @@ static int open_self_stat(void *cpu_env, int fd) return 0; } =20 -static int open_self_auxv(void *cpu_env, int fd) +static int open_self_auxv(CPUArchState *cpu_env, int fd) { CPUState *cpu =3D env_cpu((CPUArchState *)cpu_env); TaskState *ts =3D cpu->opaque; @@ -8143,7 +8143,7 @@ static int is_proc(const char *filename, const char *= entry) #endif =20 #if HOST_BIG_ENDIAN !=3D TARGET_BIG_ENDIAN -static int open_net_route(void *cpu_env, int fd) +static int open_net_route(CPUArchState *cpu_env, int fd) { FILE *fp; char *line =3D NULL; @@ -8188,7 +8188,7 @@ static int open_net_route(void *cpu_env, int fd) #endif =20 #if defined(TARGET_SPARC) -static int open_cpuinfo(void *cpu_env, int fd) +static int open_cpuinfo(CPUArchState *cpu_env, int fd) { dprintf(fd, "type\t\t: sun4u\n"); return 0; @@ -8196,7 +8196,7 @@ static int open_cpuinfo(void *cpu_env, int fd) #endif =20 #if defined(TARGET_HPPA) -static int open_cpuinfo(void *cpu_env, int fd) +static int open_cpuinfo(CPUArchState *cpu_env, int fd) { dprintf(fd, "cpu family\t: PA-RISC 1.1e\n"); dprintf(fd, "cpu\t\t: PA7300LC (PCX-L2)\n"); @@ -8208,18 +8208,18 @@ static int open_cpuinfo(void *cpu_env, int fd) #endif =20 #if defined(TARGET_M68K) -static int open_hardware(void *cpu_env, int fd) +static int open_hardware(CPUArchState *cpu_env, int fd) { dprintf(fd, "Model:\t\tqemu-m68k\n"); return 0; } #endif =20 -static int do_openat(void *cpu_env, int dirfd, const char *pathname, int f= lags, mode_t mode) +static int do_openat(CPUArchState *cpu_env, int dirfd, const char *pathnam= e, int flags, mode_t mode) { struct fake_open { const char *filename; - int (*fill)(void *cpu_env, int fd); + int (*fill)(CPUArchState *cpu_env, int fd); int (*cmp)(const char *s1, const char *s2); }; const struct fake_open *fake_open; @@ -8531,7 +8531,7 @@ _syscall2(int, pivot_root, const char *, new_root, co= nst char *, put_old) * of syscall results, can be performed. * All errnos that do_syscall() returns must be -TARGET_. */ -static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, +static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5, abi_long arg6, abi_long arg7, abi_long arg8) @@ -13155,7 +13155,7 @@ static abi_long do_syscall1(void *cpu_env, int num,= abi_long arg1, return ret; } =20 -abi_long do_syscall(void *cpu_env, int num, abi_long arg1, +abi_long do_syscall(CPUArchState *cpu_env, int num, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5, abi_long arg6, abi_long arg7, abi_long arg8) diff --git a/linux-user/uname.c b/linux-user/uname.c index 415fdf31b62d..1e3e98156da0 100644 --- a/linux-user/uname.c +++ b/linux-user/uname.c @@ -28,7 +28,7 @@ * NB: the default emulated CPU ("any") might not match any existing CPU, = e.g. * on ARM it has all features turned on, so there is no perfect arch strin= g to * return here */ -const char *cpu_to_uname_machine(void *cpu_env) +const char *cpu_to_uname_machine(CPUArchState *cpu_env) { #if defined(TARGET_ARM) && !defined(TARGET_AARCH64) =20 diff --git a/linux-user/uname.h b/linux-user/uname.h index 4503094211f9..4ae563f46c29 100644 --- a/linux-user/uname.h +++ b/linux-user/uname.h @@ -4,7 +4,7 @@ #include #include =20 -const char *cpu_to_uname_machine(void *cpu_env); +const char *cpu_to_uname_machine(CPUArchState *cpu_env); int sys_uname(struct new_utsname *buf); =20 #endif /* UNAME_H */ diff --git a/linux-user/user-internals.h b/linux-user/user-internals.h index ddc260e465dc..0bb26331c171 100644 --- a/linux-user/user-internals.h +++ b/linux-user/user-internals.h @@ -59,7 +59,7 @@ int info_is_fdpic(struct image_info *info); =20 void target_set_brk(abi_ulong new_brk); void syscall_init(void); -abi_long do_syscall(void *cpu_env, int num, abi_long arg1, +abi_long do_syscall(CPUArchState *cpu_env, int num, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5, abi_long arg6, abi_long arg7, abi_long arg8); @@ -132,22 +132,22 @@ void print_termios(void *arg); =20 /* ARM EABI and MIPS expect 64bit types aligned even on pairs or registers= */ #ifdef TARGET_ARM -static inline int regpairs_aligned(void *cpu_env, int num) +static inline int regpairs_aligned(CPUArchState *cpu_env, int num) { return ((((CPUARMState *)cpu_env)->eabi) =3D=3D 1) ; } #elif defined(TARGET_MIPS) && defined(TARGET_ABI_MIPSO32) -static inline int regpairs_aligned(void *cpu_env, int num) { return 1; } +static inline int regpairs_aligned(CPUArchState *cpu_env, int num) { retur= n 1; } #elif defined(TARGET_PPC) && !defined(TARGET_PPC64) /* * SysV AVI for PPC32 expects 64bit parameters to be passed on odd/even pa= irs * of registers which translates to the same as ARM/MIPS, because we start= with * r3 as arg1 */ -static inline int regpairs_aligned(void *cpu_env, int num) { return 1; } +static inline int regpairs_aligned(CPUArchState *cpu_env, int num) { retur= n 1; } #elif defined(TARGET_SH4) /* SH4 doesn't align register pairs, except for p{read,write}64 */ -static inline int regpairs_aligned(void *cpu_env, int num) +static inline int regpairs_aligned(CPUArchState *cpu_env, int num) { switch (num) { case TARGET_NR_pread64: @@ -159,11 +159,11 @@ static inline int regpairs_aligned(void *cpu_env, int= num) } } #elif defined(TARGET_XTENSA) -static inline int regpairs_aligned(void *cpu_env, int num) { return 1; } +static inline int regpairs_aligned(CPUArchState *cpu_env, int num) { retur= n 1; } #elif defined(TARGET_HEXAGON) -static inline int regpairs_aligned(void *cpu_env, int num) { return 1; } +static inline int regpairs_aligned(CPUArchState *cpu_env, int num) { retur= n 1; } #else -static inline int regpairs_aligned(void *cpu_env, int num) { return 0; } +static inline int regpairs_aligned(CPUArchState *cpu_env, int num) { retur= n 0; } #endif =20 /** --=20 2.36.1 From nobody Sun May 19 03:12:51 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1653476108418841.0275589295277; Wed, 25 May 2022 03:55:08 -0700 (PDT) Received: from localhost ([::1]:46694 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ntofS-0001xA-SQ for importer@patchew.org; Wed, 25 May 2022 06:55:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49560) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntoS3-0005v4-En for qemu-devel@nongnu.org; Wed, 25 May 2022 06:41:15 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:43119) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntoS1-0002GZ-79 for qemu-devel@nongnu.org; Wed, 25 May 2022 06:41:15 -0400 Received: from quad ([82.142.8.70]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MJEpp-1o90kQ3sEd-00Keil; Wed, 25 May 2022 12:41:02 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Laurent Vivier Subject: [PULL 5/8] linux-user: Remove pointless CPU{ARCH}State casts Date: Wed, 25 May 2022 12:40:54 +0200 Message-Id: <20220525104057.543354-6-laurent@vivier.eu> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220525104057.543354-1-laurent@vivier.eu> References: <20220525104057.543354-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:qezJhPFbYxjdEvtAE43RPKHQquSuwHXBDNPdbUvGAlbuENG4ZoA f3Fj7fItQ3cvuo8AWUrw2gDLVjYPzwpRKWLTiXYFwr9i4XsdnZHBUmlW3lnb7vJ5kvp10He XHxfplZESQXdVgnlW72hPxDBzix25M5jFYQQA5rdpPLZyU8BmmVegKxTA/cdGHEA/il/Ywz aQeP/xs2CID2o4l06y6kQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:opHdLaSMFIg=:qIPs0ywGTpHV7UUDfXg507 F0PTwrzAVPjpJQ8dPTqZ3WvDogFwFD7h+yGd8zwy5TiHHVsV+3gxdYdMhK9we0e5hVQif+yqd yEL03kRzA1sgoQAzrc6qBOofbcxXhc4bWGQfhJCEQh3l6HrrEMN6AtDqZUrGcziUNZAbFhg4t nwMQSgynm1jMdqfhnfKmFG9IhccunHGTc9p3y0Ow6I6fFp6Pt4wDkgh5mCof6jWuEK4FZ12/X 4xWgjkKKQ+HGkcHo+vUSq1MkwgmxkFbAGel+tx4fH7ocFeVQh3uiEduekmxq0vEMA89bggL6g hJ1hCodA7PJJgBSTGCsSW80GOwbomWmp4PeBtE0WbPHnSUbIzdtSHeCrTSeVIVS9+gp4rGFx7 Ypmphw6c+NxNILsCVeLUzELdbHoxjlRIQcKqB5MakfRWq9oNH0YB5VQVgLsnXikS1bjCgXnwu r5k+oMHvOvFZZyEQSRAUt82WOZDNvn2dW6n9NmDrHAe9+4IZvTywFuRAZcof8lOqBzZWuA45T /oChngiu9br0XTcAcz/sTIRl2iai2wi11oFEwVJw8ViWXw1zVTx6Tt8VXLCEtupfgt6EAX9k4 N8/yRncbfXECZCJJFnOfK5+I3RXY9DXhm6iF8LpBl/iwoLysy0UsBfd8ucxcA/YSeccwGuTZY XJIgpiwUSaZ1GPDHjr/MPhiiNpEU4zOfh+GYAk0nQUvCN8WrdcgYZAE8f27RjL4u0D8QNeVDq POB3wN2L8FNCTIy0PqfgsXgvcUHhsaTAyugtsw== Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=217.72.192.73; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1653476108690100001 From: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20220509205728.51912-4-philippe.mathieu.daude@gmail.com> Signed-off-by: Laurent Vivier --- linux-user/syscall.c | 49 +++++++++++++++++-------------------- linux-user/uname.c | 2 +- linux-user/user-internals.h | 2 +- 3 files changed, 25 insertions(+), 28 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 2395988e66cb..f55cdebee5ab 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -1612,16 +1612,16 @@ static abi_long do_pipe(CPUArchState *cpu_env, abi_= ulong pipedes, pipe syscall, but didn't replicate this into the pipe2 syscall. */ if (!is_pipe2) { #if defined(TARGET_ALPHA) - ((CPUAlphaState *)cpu_env)->ir[IR_A4] =3D host_pipe[1]; + cpu_env->ir[IR_A4] =3D host_pipe[1]; return host_pipe[0]; #elif defined(TARGET_MIPS) - ((CPUMIPSState*)cpu_env)->active_tc.gpr[3] =3D host_pipe[1]; + cpu_env->active_tc.gpr[3] =3D host_pipe[1]; return host_pipe[0]; #elif defined(TARGET_SH4) - ((CPUSH4State*)cpu_env)->gregs[1] =3D host_pipe[1]; + cpu_env->gregs[1] =3D host_pipe[1]; return host_pipe[0]; #elif defined(TARGET_SPARC) - ((CPUSPARCState*)cpu_env)->regwptr[1] =3D host_pipe[1]; + cpu_env->regwptr[1] =3D host_pipe[1]; return host_pipe[0]; #endif } @@ -7566,7 +7566,7 @@ static inline abi_long host_to_target_stat64(CPUArchS= tate *cpu_env, struct stat *host_st) { #if defined(TARGET_ARM) && defined(TARGET_ABI32) - if (((CPUARMState *)cpu_env)->eabi) { + if (cpu_env->eabi) { struct target_eabi_stat64 *target_st; =20 if (!lock_user_struct(VERIFY_WRITE, target_st, target_addr, 0)) @@ -7965,7 +7965,7 @@ int host_to_target_waitstatus(int status) =20 static int open_self_cmdline(CPUArchState *cpu_env, int fd) { - CPUState *cpu =3D env_cpu((CPUArchState *)cpu_env); + CPUState *cpu =3D env_cpu(cpu_env); struct linux_binprm *bprm =3D ((TaskState *)cpu->opaque)->bprm; int i; =20 @@ -7982,7 +7982,7 @@ static int open_self_cmdline(CPUArchState *cpu_env, i= nt fd) =20 static int open_self_maps(CPUArchState *cpu_env, int fd) { - CPUState *cpu =3D env_cpu((CPUArchState *)cpu_env); + CPUState *cpu =3D env_cpu(cpu_env); TaskState *ts =3D cpu->opaque; GSList *map_info =3D read_self_maps(); GSList *s; @@ -8044,7 +8044,7 @@ static int open_self_maps(CPUArchState *cpu_env, int = fd) =20 static int open_self_stat(CPUArchState *cpu_env, int fd) { - CPUState *cpu =3D env_cpu((CPUArchState *)cpu_env); + CPUState *cpu =3D env_cpu(cpu_env); TaskState *ts =3D cpu->opaque; g_autoptr(GString) buf =3D g_string_new(NULL); int i; @@ -8082,7 +8082,7 @@ static int open_self_stat(CPUArchState *cpu_env, int = fd) =20 static int open_self_auxv(CPUArchState *cpu_env, int fd) { - CPUState *cpu =3D env_cpu((CPUArchState *)cpu_env); + CPUState *cpu =3D env_cpu(cpu_env); TaskState *ts =3D cpu->opaque; abi_ulong auxv =3D ts->info->saved_auxv; abi_ulong len =3D ts->info->auxv_len; @@ -8892,7 +8892,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, in= t num, abi_long arg1, #if defined(TARGET_NR_getxpid) && defined(TARGET_ALPHA) /* Alpha specific */ case TARGET_NR_getxpid: - ((CPUAlphaState *)cpu_env)->ir[IR_A4] =3D getppid(); + cpu_env->ir[IR_A4] =3D getppid(); return get_errno(getpid()); #endif #ifdef TARGET_NR_getpid @@ -9415,7 +9415,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, in= t num, abi_long arg1, if (!is_error(ret)) { host_to_target_old_sigset(&mask, &oldset); ret =3D mask; - ((CPUAlphaState *)cpu_env)->ir[IR_V0] =3D 0; /* force no e= rror */ + cpu_env->ir[IR_V0] =3D 0; /* force no error */ } #else sigset_t set, oldset, *set_ptr; @@ -10035,7 +10035,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, = int num, abi_long arg1, } #ifdef TARGET_ALPHA /* Return value is the unbiased priority. Signal no error. */ - ((CPUAlphaState *)cpu_env)->ir[IR_V0] =3D 0; + cpu_env->ir[IR_V0] =3D 0; #else /* Return value is a biased priority to avoid negative numbers. */ ret =3D 20 - ret; @@ -11415,7 +11415,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, = int num, abi_long arg1, { uid_t euid; euid=3Dgeteuid(); - ((CPUAlphaState *)cpu_env)->ir[IR_A4]=3Deuid; + cpu_env->ir[IR_A4]=3Deuid; } return get_errno(getuid()); #endif @@ -11425,7 +11425,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, = int num, abi_long arg1, { uid_t egid; egid=3Dgetegid(); - ((CPUAlphaState *)cpu_env)->ir[IR_A4]=3Degid; + cpu_env->ir[IR_A4]=3Degid; } return get_errno(getgid()); #endif @@ -11437,7 +11437,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, = int num, abi_long arg1, case TARGET_GSI_IEEE_FP_CONTROL: { uint64_t fpcr =3D cpu_alpha_load_fpcr(cpu_env); - uint64_t swcr =3D ((CPUAlphaState *)cpu_env)->swcr; + uint64_t swcr =3D cpu_env->swcr; =20 swcr &=3D ~SWCR_STATUS_MASK; swcr |=3D (fpcr >> 35) & SWCR_STATUS_MASK; @@ -11479,8 +11479,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, = int num, abi_long arg1, * could be queried. Therefore, we store the status * bits only in FPCR. */ - ((CPUAlphaState *)cpu_env)->swcr - =3D swcr & (SWCR_TRAP_ENABLE_MASK | SWCR_MAP_MASK); + cpu_env->swcr =3D swcr & (SWCR_TRAP_ENABLE_MASK | SWCR_MAP= _MASK); =20 fpcr =3D cpu_alpha_load_fpcr(cpu_env); fpcr &=3D ((uint64_t)FPCR_DYN_MASK << 32); @@ -11504,7 +11503,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, = int num, abi_long arg1, fex =3D alpha_ieee_fpcr_to_swcr(fpcr); fex =3D exc & ~fex; fex >>=3D SWCR_STATUS_TO_EXCSUM_SHIFT; - fex &=3D ((CPUArchState *)cpu_env)->swcr; + fex &=3D (cpu_env)->swcr; =20 /* Update the hardware fpcr. */ fpcr |=3D alpha_ieee_swcr_to_fpcr(exc); @@ -11536,9 +11535,8 @@ static abi_long do_syscall1(CPUArchState *cpu_env, = int num, abi_long arg1, info.si_signo =3D SIGFPE; info.si_errno =3D 0; info.si_code =3D si_code; - info._sifields._sigfault._addr - =3D ((CPUArchState *)cpu_env)->pc; - queue_signal((CPUArchState *)cpu_env, info.si_signo, + info._sifields._sigfault._addr =3D (cpu_env)->pc; + queue_signal(cpu_env, info.si_signo, QEMU_SI_FAULT, &info); } ret =3D 0; @@ -11824,7 +11822,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, = int num, abi_long arg1, to_flock64_fn *copyto =3D copy_to_user_flock64; =20 #ifdef TARGET_ARM - if (!((CPUARMState *)cpu_env)->eabi) { + if (!cpu_env->eabi) { copyfrom =3D copy_from_user_oabi_flock64; copyto =3D copy_to_user_oabi_flock64; } @@ -12052,13 +12050,13 @@ static abi_long do_syscall1(CPUArchState *cpu_env= , int num, abi_long arg1, #ifdef TARGET_NR_set_thread_area case TARGET_NR_set_thread_area: #if defined(TARGET_MIPS) - ((CPUMIPSState *) cpu_env)->active_tc.CP0_UserLocal =3D arg1; + cpu_env->active_tc.CP0_UserLocal =3D arg1; return 0; #elif defined(TARGET_CRIS) if (arg1 & 0xff) ret =3D -TARGET_EINVAL; else { - ((CPUCRISState *) cpu_env)->pregs[PR_PID] =3D arg1; + cpu_env->pregs[PR_PID] =3D arg1; ret =3D 0; } return ret; @@ -12785,8 +12783,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, = int num, abi_long arg1, info.si_errno =3D 0; info.si_code =3D TARGET_SEGV_MAPERR; info._sifields._sigfault._addr =3D arg6; - queue_signal((CPUArchState *)cpu_env, info.si_signo, - QEMU_SI_FAULT, &info); + queue_signal(cpu_env, info.si_signo, QEMU_SI_FAULT, &info); ret =3D 0xdeadbeef; =20 } diff --git a/linux-user/uname.c b/linux-user/uname.c index 1e3e98156da0..32f71f24920d 100644 --- a/linux-user/uname.c +++ b/linux-user/uname.c @@ -54,7 +54,7 @@ const char *cpu_to_uname_machine(CPUArchState *cpu_env) return "armv5te" utsname_suffix; #elif defined(TARGET_I386) && !defined(TARGET_X86_64) /* see arch/x86/kernel/cpu/bugs.c: check_bugs(), 386, 486, 586, 686 */ - CPUState *cpu =3D env_cpu((CPUX86State *)cpu_env); + CPUState *cpu =3D env_cpu(cpu_env); int family =3D object_property_get_int(OBJECT(cpu), "family", NULL); if (family =3D=3D 4) { return "i486"; diff --git a/linux-user/user-internals.h b/linux-user/user-internals.h index 0bb26331c171..6175ce53dbd6 100644 --- a/linux-user/user-internals.h +++ b/linux-user/user-internals.h @@ -134,7 +134,7 @@ void print_termios(void *arg); #ifdef TARGET_ARM static inline int regpairs_aligned(CPUArchState *cpu_env, int num) { - return ((((CPUARMState *)cpu_env)->eabi) =3D=3D 1) ; + return cpu_env->eabi =3D=3D 1; } #elif defined(TARGET_MIPS) && defined(TARGET_ABI_MIPSO32) static inline int regpairs_aligned(CPUArchState *cpu_env, int num) { retur= n 1; } --=20 2.36.1 From nobody Sun May 19 03:12:51 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1653475922238773.4183015487364; Wed, 25 May 2022 03:52:02 -0700 (PDT) Received: from localhost ([::1]:41018 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ntocT-0006L3-5C for importer@patchew.org; Wed, 25 May 2022 06:52:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49500) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntoRz-0005nE-Aa for qemu-devel@nongnu.org; Wed, 25 May 2022 06:41:11 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:51231) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntoRx-0002Ff-9m for qemu-devel@nongnu.org; Wed, 25 May 2022 06:41:11 -0400 Received: from quad ([82.142.8.70]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.183]) with ESMTPSA (Nemesis) id 1Mv2l4-1ncQ5W2lTE-00qxKu; Wed, 25 May 2022 12:41:02 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Cc: Ilya Leoshkevich , Ulrich Weigand , David Hildenbrand , Richard Henderson , Laurent Vivier Subject: [PULL 6/8] linux-user/s390x: Fix unwinding from signal handlers Date: Wed, 25 May 2022 12:40:55 +0200 Message-Id: <20220525104057.543354-7-laurent@vivier.eu> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220525104057.543354-1-laurent@vivier.eu> References: <20220525104057.543354-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:zlaMkugIeztHuXgK+DK4TY9xoeK/gHxUPt/ojG/yQIHlrt15CRf o2ehMOJA3yplLB0VKotSZsHXmLjYmIN0gf0236NZfnIHSk6kyZJzIm9rdqCSWItBkzpHVms DmRm4OK3jz98ezh4boxaq58pIWh2GPDPSQ2jvpP29x1syvURxxZ5dCrACzIUo9w9ysPqGVO wloyJyjwdO/b1SO0WjkLA== X-UI-Out-Filterresults: notjunk:1;V03:K0:NbzMt8CTH2Y=:bUg4K1pQgJvb7etBKuhg5R UyGX0B0ZWjcotFyYwWNNRz9yQjEczTkjMNz91o+F25eFEsJwuAEIHkDhUTItXESGh+oSZb5s1 /BoDATpnAA/zUNWdhbmBa3CTTgU3qn6bd4WB+NF7ogUgz1n+YDhJGPzQyocolcI/i1huCv0e2 O53ZViAY1EUcRaf91txyN8mJj7kZ+w7xJlasmB1E9ZQkJtfROZ8UHzD4sA39HRVn2lsF7RGft 03ZwBCdntjlWA9gTU5NBuupKZMxxgy14mKXsGCfvMMd0RAjJdcT9AQaCjA7FbEw6KD48+2gzR t4gWbR+YbH1aNBIqfFScSTeZi+ufJZ13rmlNBhiL8S6t2bMQFRkWJnfOLj8azkpwHgdAFgMRT YYUQH4vHjaL+82CUcAUy4KVRW/zgczYCgVOHrl/fuxhREQqSW+hzg3njjVqiNbcs8xGHBHEsh zydaaZVsOJ4sHfVNrhrNjZf6612NgrMmjFDsZv+waatRLwsgps4D2NjHP2PvtjmPfei/F023e i51thk72RHRxH2NE4PhWhuG6T79wERjUyW9UzOodD0aNI28LgydABWlu+fE55Flx/wPUWZwLy Vn2uo89SNPcfe5s5N3JgpczpjCwDsKagsHY/Cc2yU3W6eFG1lLhLHGLD+Qo0AeD5XRGDvCd5A DACD763T6wPWOc4sCJGZPNjlSfnpxp5CI4uTjM0nsN8SHgDAjiPRo4r6SozRP3kP2hNH3nNUC hFSZZ5WuhMtLHw+u+JpUbZLjBu0Wt7Cw1PyZng== Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=212.227.17.13; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1653475923835100003 Content-Type: text/plain; charset="utf-8" From: Ilya Leoshkevich Commit 31330e6cecfd ("linux-user/s390x: Implement setup_sigtramp") removed an unused field from rt_sigframe, disturbing offsets of other fields and breaking unwinding from signal handlers (e.g. libgcc's s390_fallback_frame() relies on this struct having a specific layout). Restore the field and add a comment. Reported-by: Ulrich Weigand Signed-off-by: Ilya Leoshkevich Fixes: 31330e6cecfd ("linux-user/s390x: Implement setup_sigtramp") Reviewed-by: David Hildenbrand Reviewed-by: Richard Henderson Message-Id: <20220503225157.1696774-2-iii@linux.ibm.com> Signed-off-by: Laurent Vivier --- linux-user/s390x/signal.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/linux-user/s390x/signal.c b/linux-user/s390x/signal.c index f47713e04a07..4979c4b01791 100644 --- a/linux-user/s390x/signal.c +++ b/linux-user/s390x/signal.c @@ -84,6 +84,11 @@ struct target_ucontext { =20 typedef struct { uint8_t callee_used_stack[__SIGNAL_FRAMESIZE]; + /* + * This field is no longer initialized by the kernel, but it's still a= part + * of the ABI. + */ + uint16_t svc_insn; struct target_siginfo info; struct target_ucontext uc; } rt_sigframe; --=20 2.36.1 From nobody Sun May 19 03:12:51 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1653475454285100.70910845287335; Wed, 25 May 2022 03:44:14 -0700 (PDT) Received: from localhost ([::1]:60762 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ntoUv-0008Ro-3t for importer@patchew.org; Wed, 25 May 2022 06:44:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49472) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntoRy-0005lU-3X for qemu-devel@nongnu.org; Wed, 25 May 2022 06:41:10 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:37541) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntoRw-0002FV-6h for qemu-devel@nongnu.org; Wed, 25 May 2022 06:41:09 -0400 Received: from quad ([82.142.8.70]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MvJjz-1nch4Q0N1d-00rEJp; Wed, 25 May 2022 12:41:03 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Cc: Ilya Leoshkevich , Laurent Vivier Subject: [PULL 7/8] tests/tcg/s390x: Test unwinding from signal handlers Date: Wed, 25 May 2022 12:40:56 +0200 Message-Id: <20220525104057.543354-8-laurent@vivier.eu> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220525104057.543354-1-laurent@vivier.eu> References: <20220525104057.543354-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:fRZA+tzyOT9d6/WxR5L01ODdOPS5x6KMhoxkChQlRDaoRkvVMk0 1F8RqbfBnFs8WJZmi0PdOfX9NqHMSOf6zVntQHVrjdDIuAg3+CBfc0ZnOY2CwJDq5KNnxa9 E1cOEDpqMtWXRIRBbB0js2+vK8vnKQjRQ1az6ueQA1ho8FN7LZV2ibWitTuBWsMx376Ez8i UVotYaQ0Je8oMC/TfeRwg== X-UI-Out-Filterresults: notjunk:1;V03:K0:Z/ilKW8M4V8=:P79UPbmagJGxjGraoV8M1i ukxXlYS5WSxSG6mQB2jXH2zsxYXq7oIDtd1qNDHg3Is5kqPsfxaG69wN9le+hjSLLymFNcPcb iHLDsOa+33kQflLbiko8pmjWvzdg+yfyd0yFuPilTPxRwFITgDAY6aXEtvCXRaM8bxC0xG9dY ICHzxtp30YhsEsn38JYo4sq365mW00Hkv5s6z14OA7++lSXcEDQNaWjWNSCvZID8YY0BaZomh /GEFo815JMpu8hHina0+5ASSC1dItha7LQZnoKTsdaofi6+QrTbrRlUoJTkYSaEdpwqBN06mm eEvw3nvpAlIMEaqFGlH5bKEh4lwkhlXN8DIyJGplfFcYl1ubMkwQbNe/th6PxHtnii7xx3puv XtBi30HtdvYgidzHTjTAq0PnAjsKEAOp/5oVAKxao0Zu1uiNeCUdVhGsNbjsLvrAPER2E07Ub Tw93OpNu0SRROwGvcV9HmMq3QTry10XWRbI1LBT/OWvWKJzRMcFvyjfafwRcj/vGMLTc9i6xh m2llOZ3Vbe4ZVho9ui4IExN33qejMatiW9fW03bfVVVLa63hf0JcVcfABimwQl/b3dYw+rUHT bBxpBCKmEb/g5E4qQqy21x7migO3WJVNM2aIDN5GCnb1XjwC+VA8Q9IwuRROaX3XStb//CZkq buJp08nwLm6synRCN/dCTq4CnzK51vIDgPIdPfejA3nTcIayCYl2oMSAoYn1rR8yysTqLEieJ eCpL589A3wpqO8Z70dbcGX7HOFcTAzs5onaENA== Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=212.227.17.24; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1653475454710100001 Content-Type: text/plain; charset="utf-8" From: Ilya Leoshkevich Add a small test to prevent regressions. Signed-off-by: Ilya Leoshkevich Message-Id: <20220503225157.1696774-3-iii@linux.ibm.com> Signed-off-by: Laurent Vivier --- tests/tcg/s390x/signals-s390x.c | 69 ++++++++++++++++++++++++++------- 1 file changed, 55 insertions(+), 14 deletions(-) diff --git a/tests/tcg/s390x/signals-s390x.c b/tests/tcg/s390x/signals-s390= x.c index dc2f8ee59ac7..48c3b6cdfdd3 100644 --- a/tests/tcg/s390x/signals-s390x.c +++ b/tests/tcg/s390x/signals-s390x.c @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -11,22 +12,28 @@ * inline asm is used instead. */ =20 +#define DEFINE_ASM_FUNCTION(name, body) \ + asm(".globl " #name "\n" \ + #name ":\n" \ + ".cfi_startproc\n" \ + body "\n" \ + "br %r14\n" \ + ".cfi_endproc"); + void illegal_op(void); -void after_illegal_op(void); -asm(".globl\tillegal_op\n" - "illegal_op:\t.byte\t0x00,0x00\n" - "\t.globl\tafter_illegal_op\n" - "after_illegal_op:\tbr\t%r14"); +extern const char after_illegal_op; +DEFINE_ASM_FUNCTION(illegal_op, + ".byte 0x00,0x00\n" + ".globl after_illegal_op\n" + "after_illegal_op:") =20 void stg(void *dst, unsigned long src); -asm(".globl\tstg\n" - "stg:\tstg\t%r3,0(%r2)\n" - "\tbr\t%r14"); +DEFINE_ASM_FUNCTION(stg, "stg %r3,0(%r2)") =20 void mvc_8(void *dst, void *src); -asm(".globl\tmvc_8\n" - "mvc_8:\tmvc\t0(8,%r2),0(%r3)\n" - "\tbr\t%r14"); +DEFINE_ASM_FUNCTION(mvc_8, "mvc 0(8,%r2),0(%r3)") + +extern const char return_from_main_1; =20 static void safe_puts(const char *s) { @@ -49,8 +56,9 @@ static struct { =20 static void handle_signal(int sig, siginfo_t *info, void *ucontext) { + int err, i, n_frames; + void *frames[16]; void *page; - int err; =20 if (sig !=3D expected.sig) { safe_puts("[ FAILED ] wrong signal"); @@ -86,6 +94,17 @@ static void handle_signal(int sig, siginfo_t *info, void= *ucontext) default: break; } + + n_frames =3D backtrace(frames, sizeof(frames) / sizeof(frames[0])); + for (i =3D 0; i < n_frames; i++) { + if (frames[i] =3D=3D &return_from_main_1) { + break; + } + } + if (i =3D=3D n_frames) { + safe_puts("[ FAILED ] backtrace() is broken"); + _exit(1); + } } =20 static void check_sigsegv(void *func, enum exception exception, @@ -122,7 +141,7 @@ static void check_sigsegv(void *func, enum exception ex= ception, assert(err =3D=3D 0); } =20 -int main(void) +int main_1(void) { struct sigaction act; int err; @@ -138,7 +157,7 @@ int main(void) safe_puts("[ RUN ] Operation exception"); expected.sig =3D SIGILL; expected.addr =3D illegal_op; - expected.psw_addr =3D (unsigned long)after_illegal_op; + expected.psw_addr =3D (unsigned long)&after_illegal_op; expected.exception =3D exception_operation; illegal_op(); safe_puts("[ OK ]"); @@ -163,3 +182,25 @@ int main(void) =20 _exit(0); } + +/* + * Define main() in assembly in order to test that unwinding from signal + * handlers until main() works. This way we can define a specific point th= at + * the unwinder should reach. This is also better than defining main() in C + * and using inline assembly to call main_1(), since it's not easy to get = all + * the clobbers right. + */ + +DEFINE_ASM_FUNCTION(main, + "stmg %r14,%r15,112(%r15)\n" + ".cfi_offset 14,-48\n" + ".cfi_offset 15,-40\n" + "lay %r15,-160(%r15)\n" + ".cfi_def_cfa_offset 320\n" + "brasl %r14,main_1\n" + ".globl return_from_main_1\n" + "return_from_main_1:\n" + "lmg %r14,%r15,272(%r15)\n" + ".cfi_restore 15\n" + ".cfi_restore 14\n" + ".cfi_def_cfa_offset 160"); --=20 2.36.1 From nobody Sun May 19 03:12:51 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1653475912843426.5560567444851; Wed, 25 May 2022 03:51:52 -0700 (PDT) Received: from localhost ([::1]:40298 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ntocJ-0005fT-Go for importer@patchew.org; Wed, 25 May 2022 06:51:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49534) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntoS0-0005p6-QT for qemu-devel@nongnu.org; Wed, 25 May 2022 06:41:12 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:49399) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntoRy-0002G9-U3 for qemu-devel@nongnu.org; Wed, 25 May 2022 06:41:12 -0400 Received: from quad ([82.142.8.70]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.183]) with ESMTPSA (Nemesis) id 1N9d4t-1noq8g2YhJ-015XfF; Wed, 25 May 2022 12:41:03 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Cc: Ilya Leoshkevich , Thomas Huth , Richard Henderson , Laurent Vivier Subject: [PULL 8/8] linux-user/host/s390: Treat EX and EXRL as writes Date: Wed, 25 May 2022 12:40:57 +0200 Message-Id: <20220525104057.543354-9-laurent@vivier.eu> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220525104057.543354-1-laurent@vivier.eu> References: <20220525104057.543354-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:E7uktIn8xEbiP07ChoUZHCqQF6p6COz+l7TMfJ5Aq9qqJ9mV3d+ texx2foWmpKZvOj4Z/XJCHEDG4pu0K8OSa0SSKPF+PNmfXp5sYv8yTr6s+aaLaKoHtxYZ9x REpQ7/bcUS7eUFvV4YO/DD0sdkbF6NbymP0cJTm0nQuMLWhvgjDgEgrO4Cgf68bv7pX7uYQ 8nqq6f55EeyFOUzAsyDkQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:2M9bJnVpquw=:+9QfgQ1VKXdfICrh2v7KSc SWHxmMsf/1JoA0N7lVtc2O5/5tOH4AAte6gC9Km8KSa18kCtKvJnOmNR5RTrk8KGWtx0KeaEh 6Iop4DXTnwPMBS8aGXUN+GSGrl76sYQPDbJge/ZrZK031hEbuDKJRDUzM+wR7y/6Dm0KNge5D 9Hf/IULpuPPsw6n03vuzbDP+nyudzc6JqCulMKOVPZ2gTE4qxaGTWIvK9nCzxTUgY08ipGzif yaypeAa1jIKh83VEsukwRMiBbcuX/58wk9ZIJ8K+6jwqJ7FOOLgQeTcHQC6600mDBdYCPJHbs uKRrMMUZrcp8K+NNmsOS9Qbr3uZNavSL6kfPUs4qtJXEZqRkF3ogxpIz1istWJ6o4pFs0WBdb dD4jpGdqv8puIWtxbci0vjXmvrVI/kWAqL/AzyJaxS3jKLdf8+eCvgOarJLYGpldlw3/iJ5EY hib8Tb3K/TckpaABKl4jTV97Hxj4++ttqJafbfv0N9c0TIFOKSzIcdqM2kYHY69Pv8B2pvtrh BR1gMs4jXZ0+aXOZsQStHvI5XA2gA3+YZYh6goha3qNHF8/+GweMXZB7BtI+azc+lAFgWgS2K jTD45ZTJPo/A2L0iYVhEArh3N3wlXjMYosZp6ZfC/F8jzHkh3l041Sx31gya9A/TuVYERqz+f 0jsovVCEErE+Ye9xnNjf2suQNu/DcM8YirGEmGvY1j41dueTW4WhRzeBB56T8YRUgxxxMunfj 1pnkRguDVxpBlnT7Ui2Ofdv2fSZ6QiFN5BopAw== Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=212.227.17.13; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1653475913941100001 Content-Type: text/plain; charset="utf-8" From: Ilya Leoshkevich clang-built s390x branch-relative-long test fails on clang-built s390x QEMU due to the following sequence of events: - The test zeroes out a code page, clang generates exrl+xc for this. - do_helper_xc() is called. Clang generates exrl+xc there as well. - Since there already exists a TB for the code in question, its page is read-only and SIGSEGV is raised. - host_signal_handler() calls host_signal_write() and the latter does not recognize exrl as a write. Therefore page_unprotect() is not called and the signal is forwarded to the test. Fix by treating EXRL (and EX, just in case) as writes. There may be false positives, but they will lead only to an extra page_unprotect() call. Reported-by: Thomas Huth Signed-off-by: Ilya Leoshkevich Tested-by: Thomas Huth Reviewed-by: Richard Henderson Message-Id: <20220504114819.1729737-1-iii@linux.ibm.com> Signed-off-by: Laurent Vivier --- linux-user/include/host/s390/host-signal.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/linux-user/include/host/s390/host-signal.h b/linux-user/includ= e/host/s390/host-signal.h index 6f191e64d7b5..25fefa00bd48 100644 --- a/linux-user/include/host/s390/host-signal.h +++ b/linux-user/include/host/s390/host-signal.h @@ -50,6 +50,7 @@ static inline bool host_signal_write(siginfo_t *info, hos= t_sigcontext *uc) case 0x50: /* ST */ case 0x42: /* STC */ case 0x40: /* STH */ + case 0x44: /* EX */ case 0xba: /* CS */ case 0xbb: /* CDS */ return true; @@ -61,6 +62,12 @@ static inline bool host_signal_write(siginfo_t *info, ho= st_sigcontext *uc) return true; } break; + case 0xc6: /* RIL-b format insns */ + switch (pinsn[0] & 0xf) { + case 0x0: /* EXRL */ + return true; + } + break; case 0xc8: /* SSF format insns */ switch (pinsn[0] & 0xf) { case 0x2: /* CSST */ --=20 2.36.1