From nobody Thu May 2 06:56:47 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 16419308494971019.6270760965696; Tue, 11 Jan 2022 11:54:09 -0800 (PST) Received: from localhost ([::1]:50746 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NDc-000212-HI for importer@patchew.org; Tue, 11 Jan 2022 14:54:08 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44334) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCO-0007hP-RY for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:52:52 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:36301) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCN-0008DV-5o for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:52:52 -0500 Received: from quad ([82.142.23.158]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1Mhl0I-1mTej23Kkq-00djif; Tue, 11 Jan 2022 20:52:48 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 01/30] linux-user/alpha: Set TRAP_UNK for bugchk and unknown gentrap Date: Tue, 11 Jan 2022 20:52:18 +0100 Message-Id: <20220111195247.1737641-2-laurent@vivier.eu> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220111195247.1737641-1-laurent@vivier.eu> References: <20220111195247.1737641-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:ibdZVCnju50Z4Kf2kGgfuz4SoeL8wxiyjlA9EHuvc6TtQ30xsRV vJmSGhPvTqRWv4yMpH3Lqsq30Mani5Vd+VeJ38DE3m6ut4BcH/miaTjRFL5gNqXJl/h5giO V2Cq0aVcpxropoS7Pxr4ezCEWYrrrtpMIwjoJw7ygaxCKBvkHkDLKfSYMb2E62+UjYjcKPz FtmDr/3CMqhZ9W5lPKsBw== X-UI-Out-Filterresults: notjunk:1;V03:K0:VRU4QkP+I4o=:JfkPtJtMOfi5nHCntIYBV9 QY2kfmhqfwZUQYU9B3kqUZ70i2dep532kPgeMVuUJ1KXjGGR5BVgSp2LgLuM3g3ErNg9a9X4i /5CCRGGui20Rsjg0n4nUVXNPR2i9bOdCcDVc7CgXFG+2hgUWskfL8IKROxapPAl9bjgT1KtLz GsRNLqjRM7jQJg14+Qy6QBTSN6Qwir1NvphTS6MI0OpJQP/+wr9IXa32zV5NnRoSH8cVZO+wH YfjHqrvfcCPf/5wHEpuyW5DkWH2QS229riSlWCMxpv0iK7UGL2I+Mahi0H2OiPOs6+A6DTZVo yREPsRw0ao95KYRLWAa8J/euuKHKdaeA00KMxcOfzpLwc9AfAfIXJWXjufMvQIuFMdfdX3bgf D7o8iGTd/Ew7rsdoyI4++LaxOWN6INRsYt5iBQBc6gQ4pAzzB2witL7s4PGQgfulhXUAcC0Dd qeJy8D08VGDgsThyINupPRK5dpvTAhY0LoHFFEPMW77lpp4L3XWGskcWAhDn7Asl195zFpkw0 ttwhb58edYeDl8hSwz2MtUDSQEM7h57hsnl6QZOX3DyLPqD31VxmoyXdOyn9kRJ3j2ca5MlJO MgKpg0bkNQZDOvCKDr4bcrvtZgugBib22wMZIWd5m7eP5O0iw1X8RkYyqnG+sH/60QYrwoqIS p41IptSZAkE4MaCs0eJLq2CR/m8Dhy6wX9+o10s6BcGZeJUoIU5EvDh0dCZSEMGRcUmE= 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.10; 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 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: , Cc: Peter Maydell , Richard Henderson , Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1641930851850100002 Content-Type: text/plain; charset="utf-8" From: Richard Henderson These si_codes were changed in 535906c684fca, for linux 4.17. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-Id: <20220107213243.212806-2-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/alpha/cpu_loop.c | 4 ++-- linux-user/syscall_defs.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/linux-user/alpha/cpu_loop.c b/linux-user/alpha/cpu_loop.c index 37c33f0ccd07..96466b23f969 100644 --- a/linux-user/alpha/cpu_loop.c +++ b/linux-user/alpha/cpu_loop.c @@ -86,7 +86,7 @@ void cpu_loop(CPUAlphaState *env) /* BUGCHK */ info.si_signo =3D TARGET_SIGTRAP; info.si_errno =3D 0; - info.si_code =3D 0; + info.si_code =3D TARGET_TRAP_UNK; info._sifields._sigfault._addr =3D env->pc; queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); break; @@ -155,7 +155,7 @@ void cpu_loop(CPUAlphaState *env) break; default: info.si_signo =3D TARGET_SIGTRAP; - info.si_code =3D 0; + info.si_code =3D TARGET_TRAP_UNK; break; } info.si_errno =3D 0; diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index cca561f62268..18bed558fe6b 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -715,6 +715,7 @@ typedef struct target_siginfo { #define TARGET_TRAP_TRACE (2) /* process trace trap */ #define TARGET_TRAP_BRANCH (3) /* process taken branch trap */ #define TARGET_TRAP_HWBKPT (4) /* hardware breakpoint/watchpoint = */ +#define TARGET_TRAP_UNK (5) /* undiagnosed trap */ =20 struct target_rlimit { abi_ulong rlim_cur; --=20 2.33.1 From nobody Thu May 2 06:56:47 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 16419311019191020.5767086311572; Tue, 11 Jan 2022 11:58:21 -0800 (PST) Received: from localhost ([::1]:59420 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NHe-0000Xt-UX for importer@patchew.org; Tue, 11 Jan 2022 14:58:20 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44372) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCQ-0007iF-3h for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:52:54 -0500 Received: from mout.kundenserver.de ([217.72.192.73]:37169) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCN-0008Da-Cv for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:52:53 -0500 Received: from quad ([82.142.23.158]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MJn8J-1mnEz216LZ-00KAfU; Tue, 11 Jan 2022 20:52:49 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 02/30] linux-user/alpha: Set FPE_FLTUNK for gentrap ROPRAND Date: Tue, 11 Jan 2022 20:52:19 +0100 Message-Id: <20220111195247.1737641-3-laurent@vivier.eu> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220111195247.1737641-1-laurent@vivier.eu> References: <20220111195247.1737641-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:8cfmD5ULKC42iIBATjpKxBbDMB+Mqjkld+mbuot+69r9/EDRuUo kzPzl2Y+LSi2juQMq+QRpINJFEJ2jVznAYrsYqrC36+lQfcUHHKJwXTnxH2yoIcM3yXiEYC Dkmn++reN3e31nyAkg+SKVTlvJXuImiOKaEyY88Xa7dQXxaug/LErHTCH9p9X0JL5t9mZhk LKoSC9Aoz0/oIpO7jJs6Q== X-UI-Out-Filterresults: notjunk:1;V03:K0:+t3FlDKkqMg=:IIjYGKLfnsM4ETLCQg4ONe mWPrgFad51zWjUmSv7jmNkuuogWkuBubItPQXeCsg5WyC7RMRnf0aLUPhkqnrRvh7DgoAvVz7 3bNHYx9X+4hlL2GV7DPujq0MY+/JagaYCIc4Ws+7PTHiGDBBn3DmCfV+31yyIJDXrbu2f2v++ 4RewKNP1FHx+WlF8GbRpGhylLfVMpobEiCGpq7U4M+uf2giAPdPoklIBHeLHi1B5AzrHfYoeg zId/j9Iv3auNKmTisK6PywcOkEQ4R9y851BQ23sEokvAROGhsPahkHtfjDYRi/hrgkb4De2Tr U4/m8jRIO+36p1bd3ZtxNP6UX3ORXVT62CKkQDn/MBQIkCnHTtzX+PB5LiA+IKKi1QQWaS89O 54K9S4xkcAC3jd5M4JpTN3UlSvhE9nXgSWIotBm2bhcIKgXFK/zyUzukHtzXfA5UK04mGjYL7 zBvK9WFN3gdmQuSloiZRlzqXWsajIIMwZoOIgURYAQ4qHbJh8TZLaYH3rN6yKWMbbJyRRS2KF ByiWBUwkURIFpIhROI/GYsxJzXXGDV1sZ2yh/bHpr8N9AozdmQSPeNOF/+oebp8JB1Q8wwrpP EtOZ9kIhuNiOdA2iHK8vh2u0pjUYVkVPPPJKQ68wukj8MZqMBfKp/sMRIcjgiJF64AdObk+eY 6/MznirW0Eep9l2AfEkuPJJIAqNzz6rYx/okkl+w3dvn0/J970jze2Ay+WKDAUlJqDUQ= 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 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: , Cc: Peter Maydell , Richard Henderson , Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1641931104132100001 Content-Type: text/plain; charset="utf-8" From: Richard Henderson This si_code was changed in 4cc13e4f6d441, for linux 4.17. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-Id: <20220107213243.212806-3-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/alpha/cpu_loop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/alpha/cpu_loop.c b/linux-user/alpha/cpu_loop.c index 96466b23f969..caeea97b9d96 100644 --- a/linux-user/alpha/cpu_loop.c +++ b/linux-user/alpha/cpu_loop.c @@ -151,7 +151,7 @@ void cpu_loop(CPUAlphaState *env) info.si_code =3D TARGET_FPE_FLTRES; break; case TARGET_GEN_ROPRAND: - info.si_code =3D 0; + info.si_code =3D TARGET_FPE_FLTUNK; break; default: info.si_signo =3D TARGET_SIGTRAP; --=20 2.33.1 From nobody Thu May 2 06:56:47 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 1641931108852327.55144676747386; Tue, 11 Jan 2022 11:58:28 -0800 (PST) Received: from localhost ([::1]:59646 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NHn-0000tf-Ps for importer@patchew.org; Tue, 11 Jan 2022 14:58:27 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44386) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCQ-0007iH-5C for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:52:54 -0500 Received: from mout.kundenserver.de ([217.72.192.73]:33853) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCN-0008Df-Mc for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:52:53 -0500 Received: from quad ([82.142.23.158]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1M5PVb-1n60Hs334P-001Opc; Tue, 11 Jan 2022 20:52:49 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 03/30] linux-user/alpha: Use force_sig_fault Date: Tue, 11 Jan 2022 20:52:20 +0100 Message-Id: <20220111195247.1737641-4-laurent@vivier.eu> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220111195247.1737641-1-laurent@vivier.eu> References: <20220111195247.1737641-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:m3Vaeu/omFkKSeda42RnV+zY9Rj40yHIsn0LbpTH8PGaUck6+XT MbAuOiELMg7/xfkTR6rrVU20w7EDxxN9BJqt45q6GPXJuUTEhLSk/Fht5e0zLhodRo50rU7 nDgH/zZy/xk8ZrBmyZfOMysTh1TIxXNUyHE4eT6LuUEVt2w8NqnkLzyjVMLLE6S2xoDTgEH L+2FWzVu2Tu0e5I5psaUQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:39tqvgblDUs=:KENi40eP65SBp1R3J2WJH5 RDhPguMymeBQSyUeF1eFvVvrxsM0BWsOibg54lNmfSXwL/8dFFbYpK8i1gvMTGrk6CKIYPZp9 zXapX75Iiwzvs8ygUtLHB09nDVuRfhY7yYh0jjwFn714yvg5B1NSn2bLmMkb/uKlizVoO873j PbbsSV0TJZRsSJ/tadOtO0y/3/CDuSt7JvfbH0dk1578TE/AFEDHN3PfC2PmvolFaju/gunIM 4/fBz4OlWtAPpLHJLwEa+IilOEEcn+wPj2bSHndu+Lu5s26YJ6+dYuR8o3ol84B/oOwPvzbzU 4ZLTxNmazJHiP9iiMIxcIEk/CaRwRtO1ghHU9IYDy4xMfGf1N5XEMak1QZMk85mIndA4dVb8c V13u7aqDxeEerjMgoLTbsrEdKG2FZU4YU0/SpNvzNkwCEsDCkkJ1DjsTkvdqmt1bTH7YZx3Js iWHEYZjjpOH9mP7K0NT2yXflNqDfx8diZPCkTocZFnKZKLMobv2iYLOpYiti8pRwY8kFUps10 GtIFDrxACV7E6+eeYkWyUrMgsyCVJsoqvm5+uiRJZ2P97FuXrUxl2LmTPLlObVSx4yV1cS29c /sL9ce9F2wUb6YkCxFBDNx2F8RpPnUt0LirbTeMM4Qwy0blq+hrZ9HKi/LmazwmB+s99x4FfZ P2hRLpWAi0x03vdcJT0+SoYmnnzQpOML8Yt7V9SW+QUqQSDzcMcAvRLcCfmmTcnIP+yM= 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 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: , Cc: Peter Maydell , Richard Henderson , Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1641931111087100001 Content-Type: text/plain; charset="utf-8" From: Richard Henderson Use the new function instead of setting up a target_siginfo_t and calling queue_signal. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-Id: <20220107213243.212806-4-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/alpha/cpu_loop.c | 61 ++++++++++++------------------------- 1 file changed, 19 insertions(+), 42 deletions(-) diff --git a/linux-user/alpha/cpu_loop.c b/linux-user/alpha/cpu_loop.c index caeea97b9d96..de6e0c901cdf 100644 --- a/linux-user/alpha/cpu_loop.c +++ b/linux-user/alpha/cpu_loop.c @@ -27,8 +27,7 @@ void cpu_loop(CPUAlphaState *env) { CPUState *cs =3D env_cpu(env); - int trapnr; - target_siginfo_t info; + int trapnr, si_code; abi_long sysret; =20 while (1) { @@ -56,18 +55,10 @@ void cpu_loop(CPUAlphaState *env) break; case EXCP_OPCDEC: do_sigill: - info.si_signo =3D TARGET_SIGILL; - info.si_errno =3D 0; - info.si_code =3D TARGET_ILL_ILLOPC; - info._sifields._sigfault._addr =3D env->pc; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); + force_sig_fault(TARGET_SIGILL, TARGET_ILL_ILLOPC, env->pc); break; case EXCP_ARITH: - info.si_signo =3D TARGET_SIGFPE; - info.si_errno =3D 0; - info.si_code =3D TARGET_FPE_FLTINV; - info._sifields._sigfault._addr =3D env->pc; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); + force_sig_fault(TARGET_SIGFPE, TARGET_FPE_FLTINV, env->pc); break; case EXCP_FEN: /* No-op. Linux simply re-enables the FPU. */ @@ -76,20 +67,10 @@ void cpu_loop(CPUAlphaState *env) switch (env->error_code) { case 0x80: /* BPT */ - info.si_signo =3D TARGET_SIGTRAP; - info.si_errno =3D 0; - info.si_code =3D TARGET_TRAP_BRKPT; - info._sifields._sigfault._addr =3D env->pc; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); - break; + goto do_sigtrap_brkpt; case 0x81: /* BUGCHK */ - info.si_signo =3D TARGET_SIGTRAP; - info.si_errno =3D 0; - info.si_code =3D TARGET_TRAP_UNK; - info._sifields._sigfault._addr =3D env->pc; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); - break; + goto do_sigtrap_unk; case 0x83: /* CALLSYS */ trapnr =3D env->ir[IR_V0]; @@ -130,47 +111,43 @@ void cpu_loop(CPUAlphaState *env) abort(); case 0xAA: /* GENTRAP */ - info.si_signo =3D TARGET_SIGFPE; switch (env->ir[IR_A0]) { case TARGET_GEN_INTOVF: - info.si_code =3D TARGET_FPE_INTOVF; + si_code =3D TARGET_FPE_INTOVF; break; case TARGET_GEN_INTDIV: - info.si_code =3D TARGET_FPE_INTDIV; + si_code =3D TARGET_FPE_INTDIV; break; case TARGET_GEN_FLTOVF: - info.si_code =3D TARGET_FPE_FLTOVF; + si_code =3D TARGET_FPE_FLTOVF; break; case TARGET_GEN_FLTUND: - info.si_code =3D TARGET_FPE_FLTUND; + si_code =3D TARGET_FPE_FLTUND; break; case TARGET_GEN_FLTINV: - info.si_code =3D TARGET_FPE_FLTINV; + si_code =3D TARGET_FPE_FLTINV; break; case TARGET_GEN_FLTINE: - info.si_code =3D TARGET_FPE_FLTRES; + si_code =3D TARGET_FPE_FLTRES; break; case TARGET_GEN_ROPRAND: - info.si_code =3D TARGET_FPE_FLTUNK; + si_code =3D TARGET_FPE_FLTUNK; break; default: - info.si_signo =3D TARGET_SIGTRAP; - info.si_code =3D TARGET_TRAP_UNK; - break; + goto do_sigtrap_unk; } - info.si_errno =3D 0; - info._sifields._sigfault._addr =3D env->pc; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); + force_sig_fault(TARGET_SIGFPE, si_code, env->pc); break; default: goto do_sigill; } break; case EXCP_DEBUG: - info.si_signo =3D TARGET_SIGTRAP; - info.si_errno =3D 0; - info.si_code =3D TARGET_TRAP_BRKPT; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); + do_sigtrap_brkpt: + force_sig_fault(TARGET_SIGTRAP, TARGET_TRAP_BRKPT, env->pc); + break; + do_sigtrap_unk: + force_sig_fault(TARGET_SIGTRAP, TARGET_TRAP_UNK, env->pc); break; case EXCP_INTERRUPT: /* Just indicate that signals should be handled asap. */ --=20 2.33.1 From nobody Thu May 2 06:56:47 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 1641931356803728.7296273871142; Tue, 11 Jan 2022 12:02:36 -0800 (PST) Received: from localhost ([::1]:40272 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NLn-0007CW-QM for importer@patchew.org; Tue, 11 Jan 2022 15:02:35 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44400) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCQ-0007ib-MT for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:52:54 -0500 Received: from mout.kundenserver.de ([217.72.192.75]:33723) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCO-0008E1-LA for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:52:54 -0500 Received: from quad ([82.142.23.158]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1N64FC-1mIYw60qsK-016Rin; Tue, 11 Jan 2022 20:52:50 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 04/30] linux-user/cris: Use force_sig_fault Date: Tue, 11 Jan 2022 20:52:21 +0100 Message-Id: <20220111195247.1737641-5-laurent@vivier.eu> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220111195247.1737641-1-laurent@vivier.eu> References: <20220111195247.1737641-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:zqtwRw+ig3JKJVHP9PCTZrVb6v55lA8kSHVK1gRfKq84IuG4imq /9jxzDi0yFL1tlLhYnolVnFQZAFFGThp+a6x1WhC7kxm1RBryPpYpDp0c3a0Qq+T8mbbUav s/E/CP8SpBqT/WnTxfGuH1Vlyhec05nBRT7RI0RsFuO3YtrYv2c6lO72SX7o0sHzhjlvWMs nZgexZztaQiSdPjXjb3bw== X-UI-Out-Filterresults: notjunk:1;V03:K0:GkQKE3HP49M=:6UL42okBykWQhIv2IdlTEf 34OPeRndZTAPm0kM4dJYacFKuGaTOiiq2Qllccv1ZZkvqJiDmJHuds9GO8Xo2WyGhqqxvmOFA yESzM3BjVaLdkiah5w36F4zmqXcWi7ZA5S9ePXG5DvMX2AE1RGJS9ybdsQJsLoCtqfJwB9kDW 7pVDzBp+UWRCCgiMljSNMfXtDl0xzqEZkryJF3JlRw5wu9LSm5BVNpsqqkE+miLi9cUbNeJe8 X3TTgTfkBm7QMIsVZrZ7GcOhaXfvyN6TaRBWZ1Q4BUNtz3oz7K886UXlA/STu56TP0tI6WqsS Yi4WD8B31I+BUbbfZ1l2qUXMOXzhje8aTdeYOz7fmer9L9ey91txyhgWGhPVN++jNgSGL8kRx N42YicW4W9S+osKXB9bDm0Ns0vPR9G/973zx7Je4hqEBV6w9HaXOSJp7lJOMpVzSfZqLzKoNA z/nkb+657cIA/pAH60TKgp6gCBvNjTMUJNtRmzbTVtfjTzSv6oR6TysOA9rMrMvC007iVyU++ nsmnFzRDGLFG04bPyhQ6TEUqZljaapmwiTGWX+NdI5Eu3QWXoET+0OYM489uNwGtIhUZpxkCx LZ+RnNj0dKoR3aQoZYYdgdoZNXyzhWld3fvh1B2bRk+U6F5T0pYVlfFMUyELMNjvq5tBaxvap Pz47f4LqMMcNAqdhCOCBWv/6XHcFxhv116UsE+L2ZpNH4eGWGXwKiAMOR7R/ibbGJctE= 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.75; 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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 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: , Cc: Peter Maydell , Richard Henderson , Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1641931357987100005 Content-Type: text/plain; charset="utf-8" From: Richard Henderson Use the new function instead of setting up a target_siginfo_t and calling queue_signal. Fill in the missing PC for SIGTRAP. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-Id: <20220107213243.212806-5-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/cris/cpu_loop.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/linux-user/cris/cpu_loop.c b/linux-user/cris/cpu_loop.c index 5213aebf5549..0f46b3c1a87a 100644 --- a/linux-user/cris/cpu_loop.c +++ b/linux-user/cris/cpu_loop.c @@ -28,8 +28,7 @@ void cpu_loop(CPUCRISState *env) { CPUState *cs =3D env_cpu(env); int trapnr, ret; - target_siginfo_t info; - =20 + while (1) { cpu_exec_start(cs); trapnr =3D cpu_exec(cs); @@ -38,8 +37,8 @@ void cpu_loop(CPUCRISState *env) =20 switch (trapnr) { case EXCP_INTERRUPT: - /* just indicate that signals should be handled asap */ - break; + /* just indicate that signals should be handled asap */ + break; case EXCP_BREAK: ret =3D do_syscall(env,=20 env->regs[9],=20 @@ -57,10 +56,7 @@ void cpu_loop(CPUCRISState *env) } break; case EXCP_DEBUG: - info.si_signo =3D TARGET_SIGTRAP; - info.si_errno =3D 0; - info.si_code =3D TARGET_TRAP_BRKPT; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); + force_sig_fault(TARGET_SIGTRAP, TARGET_TRAP_BRKPT, env->pc); break; case EXCP_ATOMIC: cpu_exec_step_atomic(cs); --=20 2.33.1 From nobody Thu May 2 06:56:47 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 1641930850984605.268428610247; Tue, 11 Jan 2022 11:54:10 -0800 (PST) Received: from localhost ([::1]:50938 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NDd-00029g-SM for importer@patchew.org; Tue, 11 Jan 2022 14:54:09 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44418) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCR-0007jF-F9 for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:52:55 -0500 Received: from mout.kundenserver.de ([212.227.17.24]:48207) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCP-0008E3-Pt for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:52:55 -0500 Received: from quad ([82.142.23.158]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1N1xdf-1mMffv2noP-012L7k; Tue, 11 Jan 2022 20:52:50 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 05/30] linux-user/hppa: Use force_sig_fault Date: Tue, 11 Jan 2022 20:52:22 +0100 Message-Id: <20220111195247.1737641-6-laurent@vivier.eu> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220111195247.1737641-1-laurent@vivier.eu> References: <20220111195247.1737641-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:3kPrw6jGUBZX7Pqy65rpSbTfKHtuPre6FL1MwIL1X7i8llxXhJo tRQ6bnIJu53VCnOGMHxbshXm/u6ULR9S/n718tcPLiG46J8cQKJaHrLdhuYwgff9O6ykH0k UZjnezIvEh+QdRGoe0ZufCrRLt8soFB6vYyhRmgGBp9jqZlUVz/DjfLxH81ItkjBRiXMuut q/RPAftlLyY/VrrLYtd1w== X-UI-Out-Filterresults: notjunk:1;V03:K0:BJRSUo+Vq3Q=:768JbQJibgtHcq28R7Ukre bTW9aDNPf4dWXZhyGaehwK7uh6ZzUWXpvgLarJgSf3/5LAhBkvzWyHo1j0e+v28rsszQoZMwA 4UlI60oQqCisTFAo7YLk4tmonPm7d76vlbn4CUGe5GpgkkErGKmYGdh+7rZgQr/m4drixDIhA jiDkLRfNkVlrIdGj8yWnSWqJuiFT8fiJHGt7M8v7RrnNxi/ax0OmZtG9q/Cr4q6t/22Ar5KEv eg4l0VREry45V/OPzhqoN+2Ijt9FcTsxyHbRLNvGDV2fTTy4YB0ZupJPATJrooJxgV9CeqTfm eP/iNDm+lo2owEpnLdhlWGnu32HoZPMUK/FaOPsuG1D8ITihrRg2xLoCww2NMEadpjAqjYb2e ePzR0tKyOT1Mvlb+KkGnYfD/asVnzrtA1F890J4BXsJPS5XRbzxwfA4QzN7G1B7zN0WPgYtIV h5a9My5IEufeUS1raGFbGg0fFk9izCE3HrAXJ1XdzQhwr+SdYsm1ZFiqnaKPuaM+EQ/bzx31j dpw3UECIgKRJud3bufLKmGov5kbgVFLhlzy2oLDZc+9YGhZLoeUL/sdjOmdOgJCJ2aQKaT0T5 4Oa2POk3SSALJEQQf26cTP6L5VYvqua/GpJRFr/nnHUfYtiE23cpLfEjcrdPJM8KKYnK+2zkP fWaybhpclrs2yHW6cHwbwtySBQHW7+PpAcx0KxnKLbUBg4mWiAxHKdgZZ0SOcRdqwWno= 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 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: , Cc: Peter Maydell , Richard Henderson , Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1641930851918100005 Content-Type: text/plain; charset="utf-8" From: Richard Henderson Use the new function instead of setting up a target_siginfo_t and calling queue_signal. Fill in the missing PC for SIGTRAP and missing si_code for SIGBUS. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-Id: <20220107213243.212806-6-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/hppa/cpu_loop.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/linux-user/hppa/cpu_loop.c b/linux-user/hppa/cpu_loop.c index a47a63176b26..4740da1b7a30 100644 --- a/linux-user/hppa/cpu_loop.c +++ b/linux-user/hppa/cpu_loop.c @@ -110,7 +110,6 @@ static abi_ulong hppa_lws(CPUHPPAState *env) void cpu_loop(CPUHPPAState *env) { CPUState *cs =3D env_cpu(env); - target_siginfo_t info; abi_ulong ret; int trapnr; =20 @@ -147,26 +146,15 @@ void cpu_loop(CPUHPPAState *env) case EXCP_ILL: case EXCP_PRIV_OPR: case EXCP_PRIV_REG: - info.si_signo =3D TARGET_SIGILL; - info.si_errno =3D 0; - info.si_code =3D TARGET_ILL_ILLOPN; - info._sifields._sigfault._addr =3D env->iaoq_f; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); + force_sig_fault(TARGET_SIGILL, TARGET_ILL_ILLOPN, env->iaoq_f); break; case EXCP_OVERFLOW: case EXCP_COND: case EXCP_ASSIST: - info.si_signo =3D TARGET_SIGFPE; - info.si_errno =3D 0; - info.si_code =3D 0; - info._sifields._sigfault._addr =3D env->iaoq_f; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); + force_sig_fault(TARGET_SIGFPE, 0, env->iaoq_f); break; case EXCP_DEBUG: - info.si_signo =3D TARGET_SIGTRAP; - info.si_errno =3D 0; - info.si_code =3D TARGET_TRAP_BRKPT; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); + force_sig_fault(TARGET_SIGTRAP, TARGET_TRAP_BRKPT, env->iaoq_f= ); break; case EXCP_INTERRUPT: /* just indicate that signals should be handled asap */ --=20 2.33.1 From nobody Thu May 2 06:56:47 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 1641931102604224.5879761422117; Tue, 11 Jan 2022 11:58:22 -0800 (PST) Received: from localhost ([::1]:59494 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NHh-0000bz-Eg for importer@patchew.org; Tue, 11 Jan 2022 14:58:21 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44416) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCR-0007jD-FJ for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:52:55 -0500 Received: from mout.kundenserver.de ([212.227.17.24]:54271) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCP-0008E4-QJ for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:52:55 -0500 Received: from quad ([82.142.23.158]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MTRdK-1mvBTr0Zem-00Tpib; Tue, 11 Jan 2022 20:52:51 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 06/30] linux-user/hppa: Use the proper si_code for PRIV_OPR, PRIV_REG, OVERFLOW Date: Tue, 11 Jan 2022 20:52:23 +0100 Message-Id: <20220111195247.1737641-7-laurent@vivier.eu> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220111195247.1737641-1-laurent@vivier.eu> References: <20220111195247.1737641-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:u0WrcylP1/3whVatcKJAX2vATVMRXngcKPezLgaoa/TmWG1WMWe MjbNqA213OMublTus17b8qrScsfMJ6GoWZ4YwnJ7Bh3lrTiWph//uPvu43uawB/QeqlhqjM 7ZZ74B0kuJxv7j3qmuiDh9O0WeEwDBSF/EMqiVnQZa1ZEn0q0rO+gev1s4yehLxURdnYAjz FjCbyDefuC8eh7SERAEwQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:fh3/HSnzhQQ=:cUCEDfsW+Z8oLRl/E2TPkq sGqptmqLC54VO4wO0KieRqGKD1xeSuImJkSbQUbw6FpBwTeYz2jbtG2Ap1UzY67de7i6KoSba 1jz6aexZjzrCwHQtfXbPb89SlJtyh3JgNugrV6fS6S1S0onvMSsZwy46w+AIF8MxciHJWx57K /yU0CwNwMWqlUjCx/XWTCl0VPrKsIz/0mg9MOc+OQ7td/eGhPS15ZFnj4V++fPJL/7+aNfymB rNob2t9V8i7PS9xVpKKt/ab6HrURTNRX6/gieDPmatVPES8k49UfxKh6ECBOxRTkDI9klOBLJ qxPTC6m4gpsbr4nCy9CFAgyBIH1nnmlEqIU+tk+kGa8dcKTsZv0Nb/Fh7DnJZDcbVne4G4bE+ RbCb7OL2YL9qXSIfCr17TCiRXonIga/5Up5IrbSpdLMo0Drd1Tb13s5vyfz3+rtaQdZgt3emz QBYEZZ4jo5uV3EhPahL97cUqA0yzOCL8n/k7nSD6JphTsEQS+t9OGpX0WZJOuC8A73cJJ5c3c T6wej9r8AL3WwT4uy3oMa1ahZd2nU4o4h02ACQNn8os/oc0o5Wn6dYvOX7R8J6N15D56TTNbQ 1DeZfgUh2uQKYhyKUIboFK+XfnvuZrWfYmee65OLLBVHSTPuBqn9JEBStXwoSyrglQmygEjLH qlVmFsdnmnMomDoRUhE9T/RxjSyWZQkHs6bzFpiHtZBjkOlMhhlScJE0nxwJ80IX9XN4= 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 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: , Cc: Peter Maydell , Richard Henderson , Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1641931104351100003 Content-Type: text/plain; charset="utf-8" From: Richard Henderson These si_codes have been properly set by the kernel since the beginning. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-Id: <20220107213243.212806-7-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/hppa/cpu_loop.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/linux-user/hppa/cpu_loop.c b/linux-user/hppa/cpu_loop.c index 4740da1b7a30..a65e1571a0cf 100644 --- a/linux-user/hppa/cpu_loop.c +++ b/linux-user/hppa/cpu_loop.c @@ -144,11 +144,17 @@ void cpu_loop(CPUHPPAState *env) env->iaoq_b =3D env->gr[31] + 4; break; case EXCP_ILL: + force_sig_fault(TARGET_SIGILL, TARGET_ILL_ILLOPN, env->iaoq_f); + break; case EXCP_PRIV_OPR: + force_sig_fault(TARGET_SIGILL, TARGET_ILL_PRVOPC, env->iaoq_f); + break; case EXCP_PRIV_REG: - force_sig_fault(TARGET_SIGILL, TARGET_ILL_ILLOPN, env->iaoq_f); + force_sig_fault(TARGET_SIGILL, TARGET_ILL_PRVREG, env->iaoq_f); break; case EXCP_OVERFLOW: + force_sig_fault(TARGET_SIGFPE, TARGET_FPE_INTOVF, env->iaoq_f); + break; case EXCP_COND: case EXCP_ASSIST: force_sig_fault(TARGET_SIGFPE, 0, env->iaoq_f); --=20 2.33.1 From nobody Thu May 2 06:56:47 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 1641931091095561.8477875896015; Tue, 11 Jan 2022 11:58:11 -0800 (PST) Received: from localhost ([::1]:58844 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NHV-0008Pw-Uk for importer@patchew.org; Tue, 11 Jan 2022 14:58:09 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44520) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCW-0007sJ-3Q for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:53:00 -0500 Received: from mout.kundenserver.de ([212.227.17.13]:51489) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCT-0008Fc-I1 for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:52:59 -0500 Received: from quad ([82.142.23.158]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MHnZQ-1nBDDp2i6Y-00Et6B; Tue, 11 Jan 2022 20:52:51 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 07/30] linux-user: Remove TARGET_NSIGFPE Date: Tue, 11 Jan 2022 20:52:24 +0100 Message-Id: <20220111195247.1737641-8-laurent@vivier.eu> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220111195247.1737641-1-laurent@vivier.eu> References: <20220111195247.1737641-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:etkb4DmUL+F4OJ3jyECd2GyqKAl4kzEZ2qXXaOhqtJfSfuB/rli wM0K6myBGoFeJJsV5LuC5ZJEuxcT4iRy6CrFA2cylWfjduozbHYCuW9gK8ACi8L11v20O7m z/cbuVDqH81lSwL/x4IvOSJZBDYNsc7lwmf37OCTU3hnI5nHJb3auGuMSIcLJ96Ylq1wYRb hQgpOlmCh0TOhQEqr1FHQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:+UO47+EiPgI=:BLADFwf/Bj6G9DccNzg7Dj N/zxdfaEoE3FdpE3T0AtD/0xSJcavztdxlWRvQRFGlx4PlEflpXoexio5w25wC6wy1/Cy3mcF WFngqWzzW6lAl9er5ZX6FBqCSC3f2tLQiNov2IBs3YJ07zPiYYC5/YhFteWVdTaOixaquLNXH GzdRWawFjpNKhlb9XNFD0oafnL+/BzLyo9Liyqzo7P+By+4oYNyqOoVj8WBS95fyR4YZQqkKa WI/j5+ZvZsxDw/z+T0O/zt/iOrbV5rmxXcK9bGxfpNsc7B/Fr3+WLBrLUH0qAlGOUIcaIeVjZ 6UkYGFMwznfIVgoCeqbZr/+an1250eP5SA3vEZOFOng7rYjIZj2UPrIVx8Rt5r0S1OiP8jZ48 uOAhmU4TrybiQ5NPEZ/ccuR/twUQxssSlGaOuMUWZgZkzSHRDbK2/y13ai8FFI73W8dFCVokg q6rJRhqnfd2X0A1aNwL1QextGSyQ88dWeHuS+nT8K6B76Tf6LgiZ32sbX1wMgU58128fklYob UJfubfyeZp0habT41afbMGDivCfZB95H9Zqkcf1emPOBk5FF0T31BesT7TMbA8XqMLfHtLICE YsuUI1NrC7fbomTEx97FJ+PU7e1qxUdfwjnQlw4CmQl3vqostpZS4uo/ZFfGAvsc/aDC8cgyZ knSHuVLXLePDMCkhfSIu2pawdvZQbwU9WNioJx7LauHYvT0lu6lfz9FmFcPHXxSqBGz4= 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 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: , Cc: Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1641931092578100001 From: Richard Henderson This define is unused, and we have no similar define for the other signal sub-codes. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Richard Henderson Message-Id: <20220107213243.212806-8-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/syscall_defs.h | 1 - 1 file changed, 1 deletion(-) diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 18bed558fe6b..510a8c1ab585 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -688,7 +688,6 @@ typedef struct target_siginfo { #define TARGET_FPE_FLTINV (7) /* floating point invalid operation */ #define TARGET_FPE_FLTSUB (8) /* subscript out of range */ #define TARGET_FPE_FLTUNK (14) /* undiagnosed fp exception */ -#define TARGET_NSIGFPE 15 =20 /* * SIGSEGV si_codes --=20 2.33.1 From nobody Thu May 2 06:56:47 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 16419320258031017.4677888391901; Tue, 11 Jan 2022 12:13:45 -0800 (PST) Received: from localhost ([::1]:37068 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NWa-0007jo-Q8 for importer@patchew.org; Tue, 11 Jan 2022 15:13:44 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44656) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCb-000824-1U for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:53:05 -0500 Received: from mout.kundenserver.de ([212.227.17.24]:41653) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCZ-0008HG-5s for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:53:04 -0500 Received: from quad ([82.142.23.158]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MEFCF-1nEljF0TFF-00AEXI; Tue, 11 Jan 2022 20:52:52 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 08/30] linux-user/hppa: Set FPE_CONDTRAP for COND Date: Tue, 11 Jan 2022 20:52:25 +0100 Message-Id: <20220111195247.1737641-9-laurent@vivier.eu> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220111195247.1737641-1-laurent@vivier.eu> References: <20220111195247.1737641-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:BmZJDvAlMbr1PxeBCkXpjNQfj2+g4+YW7RS8fi1AdMRnvBIqDew NGXh9G2fZso1wocOz/tsWLQjrCX2hChENc6mzitj/qGXGtWQUKrBuVq8jNj4gHj8b/WFKLr JNr2jhZSlfjFkJHjBF5cWNZ84R9h2I4YOFrrjhEhpW7Csd9JPPmNINZOYZh6S9oaQy0U80Q /el2keqbnncc8AeYfRMzA== X-UI-Out-Filterresults: notjunk:1;V03:K0:HpgoP+USiGs=:fkePWf6KtaqvcFRrkotJNM g5cY1tm/sUPU1MHwIagtS4I6/+F92nT3oo4bHdlLc3eCVHuTXSWSSczq2FI+H1g+SDsnOkwbt EnGLPLJfy5YFp/DUImbC+t+oqJ1SNxQ4dNawyatCJTERaWy2xZneWOx8ERz89SDWOK/6ERKfG QyHZbKIFmM5Y541CJu9jZHNYBQFHsDaPr7kIAhMJiGRe+GGpnhke4yiQEMzqyrOyIbxOGPAJl VVbIM6YRFU2609w/naVnX5dP1kMuOjv736Kjl7GA4/utUQNPf6NkW/0naeDtgW5QwmcyMf93Q jlUPCgLOR7r+soCXVy2nU3P5RSu8w+iamD7sSukCuSkkHkOwJ6nklzF89rUIpPv62p6yBmxL+ WVMssS35Eq5vHbHfpU2unFn+qmp8McV1sPY2ZNg2XCa4CzTCiEhOF6J8hGksuchzLChh/eRsG EegYcmgVLe0co45dXtyVJbxVZhFFFCR9EzJLttRcMsKKG7BCxSoSyc3fuCjiZnEKY/QClt1Gv vzmLC25fZM/KqDB8dI5rrxV4UvSF2G3QL/XHsAmWfylmHEk1pTVmgiY3Vt8UyAkmdYojiWC2A DCFiCmSwU+v45yQ0uLbyJtRmDSOFIEj/ZzRYJDl/hGdTfuUSJXHxCPWwd4NA6eKhRoh9zmeSa jNNzU06dy5hh2djoWKsgFeNw4vlYkphsr44GnSYD0S8qJjxuR6CUJvPjj6YAUkNVV1HM= 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 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: , Cc: Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1641932027737100001 From: Richard Henderson This si_code was changed in 75abf64287cab, for linux 4.17. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Richard Henderson Message-Id: <20220107213243.212806-9-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/hppa/cpu_loop.c | 2 ++ linux-user/syscall_defs.h | 1 + 2 files changed, 3 insertions(+) diff --git a/linux-user/hppa/cpu_loop.c b/linux-user/hppa/cpu_loop.c index a65e1571a0cf..a576d1a249fd 100644 --- a/linux-user/hppa/cpu_loop.c +++ b/linux-user/hppa/cpu_loop.c @@ -156,6 +156,8 @@ void cpu_loop(CPUHPPAState *env) force_sig_fault(TARGET_SIGFPE, TARGET_FPE_INTOVF, env->iaoq_f); break; case EXCP_COND: + force_sig_fault(TARGET_SIGFPE, TARGET_FPE_CONDTRAP, env->iaoq_= f); + break; case EXCP_ASSIST: force_sig_fault(TARGET_SIGFPE, 0, env->iaoq_f); break; diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 510a8c1ab585..f23f0a2178f8 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -688,6 +688,7 @@ typedef struct target_siginfo { #define TARGET_FPE_FLTINV (7) /* floating point invalid operation */ #define TARGET_FPE_FLTSUB (8) /* subscript out of range */ #define TARGET_FPE_FLTUNK (14) /* undiagnosed fp exception */ +#define TARGET_FPE_CONDTRAP (15) /* trap on condition */ =20 /* * SIGSEGV si_codes --=20 2.33.1 From nobody Thu May 2 06:56:47 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 1641931547670490.64502820046096; Tue, 11 Jan 2022 12:05:47 -0800 (PST) Received: from localhost ([::1]:48890 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NOs-0004ql-Hg for importer@patchew.org; Tue, 11 Jan 2022 15:05:46 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44448) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCS-0007kI-Eo for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:52:56 -0500 Received: from mout.kundenserver.de ([217.72.192.73]:46551) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCQ-0008Ec-Pk for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:52:56 -0500 Received: from quad ([82.142.23.158]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MFL8J-1n9I572SBl-00Fii4; Tue, 11 Jan 2022 20:52:52 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 09/30] linux-user/i386: Split out maybe_handle_vm86_trap Date: Tue, 11 Jan 2022 20:52:26 +0100 Message-Id: <20220111195247.1737641-10-laurent@vivier.eu> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220111195247.1737641-1-laurent@vivier.eu> References: <20220111195247.1737641-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:R9iHoMnEGfQmuUnWl2KXPZh35KbD0kuSWfvYTHA7h3qakAa/Xt7 Hc11LFW87+OiLjqL5ymjxvhTA+YX9Ku/AAMWy5fQxJh3XF84zb54FGtiN1KYekadiYJUNrQ f34jMP9goIrf5cbx51HrVwHh+LgLM+2bX7SyuZjCCojPPES6tBzf5l9Y1vZK8xdt7zKi5oW P2pCwJfBLISENBQ51H1Rg== X-UI-Out-Filterresults: notjunk:1;V03:K0:OLryeiNVols=:aC5Gfh2Jq7AvcU2WWVRFv0 Yk+OTUDpGnbzj1aeu8coi7UD4oysA47nV5Uz47hCf6+3mGm3p7/cDCvrjAM0rJzwDnQk0HXwI KLCqDkF5ZTWvlDbtU8T7z2GLGz+bbEzN4Ze5ybDx34KeNr2mOuXrC+v3QAc3IZHnf2DWQyBEz C3EdBm9Ho59my3R3th1kLSvgo4XwfA8DW08CN3ah4QbjXYwi9KuttdwFxs3xhpDNAs2fWf+gU 0BLFlQX1lJ6+dg7UujVtg507nPHjYseSlzH54ywVXd8fBT2oudzZ8NRYpnL1U7x5F5dsRPi3B 2SmqD7rZmbXVwZdvBFBUaJlDUcUh5zKMM2r1MVWd6XMsbKakifrw3hMP16pwO95r9AJGIAjk3 OLzEEp7iD1gLXGlB6Aozn9tybIYNsKKToxJ9loNWwP9sZgKUu5kjZxuZ1yEj1XaJIgcWkYbOs cC1edysjLMEnnJ8fB3DCAwylmiKt9tB8a10U6hJxsybPgDBnG05Z/IjHLzckDKwcSzrcSu4Xf DEf4C/dMSbVGx7G82gaRk9HddK4HYPgXmqoh2qRZsyF+cs17Ozk4QyEAfuad9q8bKmUvFfU48 NnVlZm7XaSg1G1v+sTuYqylEuUaCwZD4TVbBOzt5Wj3BlfieLFI1N1h+yq5qkQ0bYrWTYOTb9 OnWj7pmWtcsQWAncheuB5YimIvg/4T83MZ7u4b3Z+IuS5FYeNSW/S8YBWeM4aSuQXuVc= 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 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: , Cc: Peter Maydell , Richard Henderson , Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1641931549199100001 Content-Type: text/plain; charset="utf-8" From: Richard Henderson Reduce the number of ifdefs within cpu_loop(). Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-Id: <20220107213243.212806-10-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/i386/cpu_loop.c | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/linux-user/i386/cpu_loop.c b/linux-user/i386/cpu_loop.c index 9aaae93e2f5c..ac0f4e321111 100644 --- a/linux-user/i386/cpu_loop.c +++ b/linux-user/i386/cpu_loop.c @@ -198,6 +198,17 @@ static void emulate_vsyscall(CPUX86State *env) } #endif =20 +static bool maybe_handle_vm86_trap(CPUX86State *env, int trapnr) +{ +#ifndef TARGET_X86_64 + if (env->eflags & VM_MASK) { + handle_vm86_trap(env, trapnr); + return true; + } +#endif + return false; +} + void cpu_loop(CPUX86State *env) { CPUState *cs =3D env_cpu(env); @@ -259,12 +270,9 @@ void cpu_loop(CPUX86State *env) break; case EXCP0D_GPF: /* XXX: potential problem if ABI32 */ -#ifndef TARGET_X86_64 - if (env->eflags & VM_MASK) { - handle_vm86_fault(env); + if (maybe_handle_vm86_trap(env, trapnr)) { break; } -#endif gen_signal(env, TARGET_SIGSEGV, TARGET_SI_KERNEL, 0); break; case EXCP0E_PAGE: @@ -274,22 +282,16 @@ void cpu_loop(CPUX86State *env) env->cr[2]); break; case EXCP00_DIVZ: -#ifndef TARGET_X86_64 - if (env->eflags & VM_MASK) { - handle_vm86_trap(env, trapnr); + if (maybe_handle_vm86_trap(env, trapnr)) { break; } -#endif gen_signal(env, TARGET_SIGFPE, TARGET_FPE_INTDIV, env->eip); break; case EXCP01_DB: case EXCP03_INT3: -#ifndef TARGET_X86_64 - if (env->eflags & VM_MASK) { - handle_vm86_trap(env, trapnr); + if (maybe_handle_vm86_trap(env, trapnr)) { break; } -#endif if (trapnr =3D=3D EXCP01_DB) { gen_signal(env, TARGET_SIGTRAP, TARGET_TRAP_BRKPT, env->ei= p); } else { @@ -298,12 +300,9 @@ void cpu_loop(CPUX86State *env) break; case EXCP04_INTO: case EXCP05_BOUND: -#ifndef TARGET_X86_64 - if (env->eflags & VM_MASK) { - handle_vm86_trap(env, trapnr); + if (maybe_handle_vm86_trap(env, trapnr)) { break; } -#endif gen_signal(env, TARGET_SIGSEGV, TARGET_SI_KERNEL, 0); break; case EXCP06_ILLOP: --=20 2.33.1 From nobody Thu May 2 06:56:47 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 1641931353445490.8844758323197; Tue, 11 Jan 2022 12:02:33 -0800 (PST) Received: from localhost ([::1]:40036 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NLk-00072Q-FJ for importer@patchew.org; Tue, 11 Jan 2022 15:02:32 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44460) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCS-0007ke-U2 for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:52:56 -0500 Received: from mout.kundenserver.de ([217.72.192.75]:59661) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCR-0008F2-3L for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:52:56 -0500 Received: from quad ([82.142.23.158]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1M1ZUb-1n5Sak0Aix-0033G2; Tue, 11 Jan 2022 20:52:53 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 10/30] linux-user/i386: Use force_sig, force_sig_fault Date: Tue, 11 Jan 2022 20:52:27 +0100 Message-Id: <20220111195247.1737641-11-laurent@vivier.eu> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220111195247.1737641-1-laurent@vivier.eu> References: <20220111195247.1737641-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:SGn145ZFC4PBL62+hbmIA2uCUNxQU1jlTrXkJV7UYRoNyq67L6y 5jyhby7zawW2DTow9CVdTyoB2BIRH4c2Z+Zud6qv8nGn+5qIINInPceqbFT4VPDmiWjk/qB pLormt3UwVwrh0q4lBLaSZLr4eUozUaUbyWj5KfhbLttzoueXdH4yrNaAgNyrsMva8yUiOu 8KtgU1Js50NgDxiWOAWxw== X-UI-Out-Filterresults: notjunk:1;V03:K0:/rO+vsvH5+4=:I3+nF2eR/EiLA/FmYON0GV AdrN1l2r6iD/GZsbvOR6kOW+Gf+LSURh6blqKmpJZuhgK+HmJfN4jyUXemX8gWrhkZDKRpeKD tq00/iQdeadCsy8BxBFR859eHJaOt7Om6HSQb6ZYjslLaHWaSd+WuT8xwP3iI67wzGwIBJMOG N2eEKDZUkNvyrJKb3bYXqXFIv2f8JI6s12HGQGiCvOVXR/WJqE/mYvvlkE73Y7Gly0DgqCG8G eMY/7AZLJLIUL0V7HZuOEwRz0JhpWwU9s89hBTBkO06t9DttvkCCXuZ7/9v9TnO5wKnAK/CZi Ju5HlLLKdRWO1cl0tTHgti2PAAOx8RfsrN24/E0zi06IMny6JRjLRq5KJrz1ytrltlml44g++ 9OtuZjJIW7xusHWqcNHqWersH9ST5sAF9GN/k7/clSMa9iMnn0Lss9OEKTlsh7OCNShrS2W31 noeYVeVm5ahpHZQvIzMmBtfhob0sQgYW+r7DBs/4ddK5UA3aTBbY0T92FBcRQpHksT3xGTXzS n6F11eVN4zzAhf7X9IivadOCZaSS1jZRMP1dI+lyXevZ9jzA65+yF1ijYLyJZda4d2ZA1tazy GVos0oZJ/yKg74O67QdA15X2LJQHKMy7RtcNiH0lNeuqOAQ4QlcoW/jJkvDbfrIDSlOltaZA0 uifS+MEs1ujLncsVuBdGYTXNOoDc/ywM9baGs3IVZj1uin82KuKQWGA4u126bHU/ZUuw= 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.75; 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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 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: , Cc: Peter Maydell , Richard Henderson , Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1641931355339100001 Content-Type: text/plain; charset="utf-8" From: Richard Henderson Replace the local gen_signal with the generic functions that match how the kernel raises signals. Fill in the missing PC for SIGTRAP. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-Id: <20220107213243.212806-11-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/i386/cpu_loop.c | 47 +++++++++++++++----------------------- 1 file changed, 18 insertions(+), 29 deletions(-) diff --git a/linux-user/i386/cpu_loop.c b/linux-user/i386/cpu_loop.c index ac0f4e321111..29dfd7cd0c54 100644 --- a/linux-user/i386/cpu_loop.c +++ b/linux-user/i386/cpu_loop.c @@ -84,17 +84,6 @@ static void set_idt(int n, unsigned int dpl) } #endif =20 -static void gen_signal(CPUX86State *env, int sig, int code, abi_ptr addr) -{ - target_siginfo_t info =3D { - .si_signo =3D sig, - .si_code =3D code, - ._sifields._sigfault._addr =3D addr - }; - - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); -} - #ifdef TARGET_X86_64 static bool write_ok_or_segv(CPUX86State *env, abi_ptr addr, size_t len) { @@ -107,7 +96,7 @@ static bool write_ok_or_segv(CPUX86State *env, abi_ptr a= ddr, size_t len) } =20 env->error_code =3D PG_ERROR_W_MASK | PG_ERROR_U_MASK; - gen_signal(env, TARGET_SIGSEGV, TARGET_SEGV_MAPERR, addr); + force_sig_fault(TARGET_SIGSEGV, TARGET_SEGV_MAPERR, addr); return false; } =20 @@ -193,8 +182,7 @@ static void emulate_vsyscall(CPUX86State *env) return; =20 sigsegv: - /* Like force_sig(SIGSEGV). */ - gen_signal(env, TARGET_SIGSEGV, TARGET_SI_KERNEL, 0); + force_sig(TARGET_SIGSEGV); } #endif =20 @@ -266,53 +254,54 @@ void cpu_loop(CPUX86State *env) #endif case EXCP0B_NOSEG: case EXCP0C_STACK: - gen_signal(env, TARGET_SIGBUS, TARGET_SI_KERNEL, 0); + force_sig(TARGET_SIGBUS); break; case EXCP0D_GPF: /* XXX: potential problem if ABI32 */ if (maybe_handle_vm86_trap(env, trapnr)) { break; } - gen_signal(env, TARGET_SIGSEGV, TARGET_SI_KERNEL, 0); + force_sig(TARGET_SIGSEGV); break; case EXCP0E_PAGE: - gen_signal(env, TARGET_SIGSEGV, - (env->error_code & 1 ? - TARGET_SEGV_ACCERR : TARGET_SEGV_MAPERR), - env->cr[2]); + force_sig_fault(TARGET_SIGSEGV, + (env->error_code & PG_ERROR_P_MASK ? + TARGET_SEGV_ACCERR : TARGET_SEGV_MAPERR), + env->cr[2]); break; case EXCP00_DIVZ: if (maybe_handle_vm86_trap(env, trapnr)) { break; } - gen_signal(env, TARGET_SIGFPE, TARGET_FPE_INTDIV, env->eip); + force_sig_fault(TARGET_SIGFPE, TARGET_FPE_INTDIV, env->eip); break; case EXCP01_DB: - case EXCP03_INT3: if (maybe_handle_vm86_trap(env, trapnr)) { break; } - if (trapnr =3D=3D EXCP01_DB) { - gen_signal(env, TARGET_SIGTRAP, TARGET_TRAP_BRKPT, env->ei= p); - } else { - gen_signal(env, TARGET_SIGTRAP, TARGET_SI_KERNEL, 0); + force_sig_fault(TARGET_SIGTRAP, TARGET_TRAP_BRKPT, env->eip); + break; + case EXCP03_INT3: + if (maybe_handle_vm86_trap(env, trapnr)) { + break; } + force_sig(TARGET_SIGTRAP); break; case EXCP04_INTO: case EXCP05_BOUND: if (maybe_handle_vm86_trap(env, trapnr)) { break; } - gen_signal(env, TARGET_SIGSEGV, TARGET_SI_KERNEL, 0); + force_sig(TARGET_SIGSEGV); break; case EXCP06_ILLOP: - gen_signal(env, TARGET_SIGILL, TARGET_ILL_ILLOPN, env->eip); + force_sig_fault(TARGET_SIGILL, TARGET_ILL_ILLOPN, env->eip); break; case EXCP_INTERRUPT: /* just indicate that signals should be handled asap */ break; case EXCP_DEBUG: - gen_signal(env, TARGET_SIGTRAP, TARGET_TRAP_BRKPT, 0); + force_sig_fault(TARGET_SIGTRAP, TARGET_TRAP_BRKPT, env->eip); break; case EXCP_ATOMIC: cpu_exec_step_atomic(cs); --=20 2.33.1 From nobody Thu May 2 06:56:47 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 1641931348669169.7311137349227; Tue, 11 Jan 2022 12:02:28 -0800 (PST) Received: from localhost ([::1]:39652 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NLf-0006k6-KE for importer@patchew.org; Tue, 11 Jan 2022 15:02:27 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44470) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCT-0007ll-7p for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:52:57 -0500 Received: from mout.kundenserver.de ([212.227.17.13]:39301) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCR-0008FG-Gd for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:52:56 -0500 Received: from quad ([82.142.23.158]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1N5n81-1mIqBa277z-017Gnm; Tue, 11 Jan 2022 20:52:53 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 11/30] linux-user/m68k: Use force_sig_fault Date: Tue, 11 Jan 2022 20:52:28 +0100 Message-Id: <20220111195247.1737641-12-laurent@vivier.eu> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220111195247.1737641-1-laurent@vivier.eu> References: <20220111195247.1737641-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:MdrzzfhVoq9tVMw62rjEUDbCgU0cliZHcxgswHoRy1p2SWHlzEI CpN6y6DLyWePM56HBnXSgly+TE3Wor+5ztGj37IvRwwRg38megI9ynKljZhQYfngyNSy2gN uq4moRT1yJfAamqmpKaYd1GvnXesUeW77ZrDM1UL2f8jRvU+XyYYRScc1++ymYgF7GojlKK wDPEGs8ANhPPrfRwC0L8w== X-UI-Out-Filterresults: notjunk:1;V03:K0:r51uxBuJoqs=:b2SdO0p2+McD+EDunsKqV5 Kid//WS2XpIOeygS2muqC6vmPaohRSO1+FAxLYMXfm3DwidYLDrv0vbKrnT8I3dEOogMx0kQE PCagD820ZXvAXIOPByqRTuBx+d+i3xElTQuQXp7eJHb1w79PrFIyMNrMl21W6XfAAkjzkr1Xx Xhhb2XNIAAwZWmvyti+i1JhDtvXXcvCGdfoPPg7iy4f+DqJ5qX49THCEY9yi+GszRBBHNflrk d8YYypESCxv8ZDEZAtxdatEsvji6baq9PAQnMVDwGDTuLhfiFH/JTl99YydKIO4uCYDeY95eI Ua4jsuFWjmbjWvpL9LMHF2pm9Vh601/F4WnE/PF8n2jSqwi8BfIohgvVGPkhD2TrDQHLVja+8 stlkvuBOLlOlhZbTxxZL4G5gehpHJ2lHtMKD3dP237lvT+esP4D4mfUi0TEoFhj0IJdQAtwEI N1aQi/9/LYb1wZ8oKEmtDmA9n9vptHSbey5BdN7PYzFDVv0adPO7fGJ7+QBG1/hyhCm/GDZMN A6N9ODLhYU2Xl3E8HiQ9h5T5kN8zjEeHjoZ8ZqYJ2QdzY1bQEEeVwHw/iSm6n/MovmwIiA4G7 QHcT9AuChIzteLetY9wDuXBhC02IUS/Kybx/3mMoxkNk8vuq3DInOLhakIb9T6ohXtAStzPiz p4opvJJkB2ocblBkJkuy9CRLP9zOX/feNc4gldiOMsSuvBqPQyaFgBS85QnNne0kx7ks= 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 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: , Cc: Peter Maydell , Richard Henderson , Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1641931350239100001 Content-Type: text/plain; charset="utf-8" From: Richard Henderson Use the new function instead of setting up a target_siginfo_t and calling queue_signal. Fill in the missing PC for SIGTRAP. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-Id: <20220107213243.212806-12-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/m68k/cpu_loop.c | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/linux-user/m68k/cpu_loop.c b/linux-user/m68k/cpu_loop.c index 318159441440..928a18e3cf05 100644 --- a/linux-user/m68k/cpu_loop.c +++ b/linux-user/m68k/cpu_loop.c @@ -29,7 +29,6 @@ void cpu_loop(CPUM68KState *env) CPUState *cs =3D env_cpu(env); int trapnr; unsigned int n; - target_siginfo_t info; =20 for(;;) { cpu_exec_start(cs); @@ -46,25 +45,13 @@ void cpu_loop(CPUM68KState *env) case EXCP_ILLEGAL: case EXCP_LINEA: case EXCP_LINEF: - info.si_signo =3D TARGET_SIGILL; - info.si_errno =3D 0; - info.si_code =3D TARGET_ILL_ILLOPN; - info._sifields._sigfault._addr =3D env->pc; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); + force_sig_fault(TARGET_SIGILL, TARGET_ILL_ILLOPN, env->pc); break; case EXCP_CHK: - info.si_signo =3D TARGET_SIGFPE; - info.si_errno =3D 0; - info.si_code =3D TARGET_FPE_INTOVF; - info._sifields._sigfault._addr =3D env->pc; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); + force_sig_fault(TARGET_SIGFPE, TARGET_FPE_INTOVF, env->pc); break; case EXCP_DIV0: - info.si_signo =3D TARGET_SIGFPE; - info.si_errno =3D 0; - info.si_code =3D TARGET_FPE_INTDIV; - info._sifields._sigfault._addr =3D env->pc; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); + force_sig_fault(TARGET_SIGFPE, TARGET_FPE_INTDIV, env->pc); break; case EXCP_TRAP0: { @@ -91,10 +78,7 @@ void cpu_loop(CPUM68KState *env) /* just indicate that signals should be handled asap */ break; case EXCP_DEBUG: - info.si_signo =3D TARGET_SIGTRAP; - info.si_errno =3D 0; - info.si_code =3D TARGET_TRAP_BRKPT; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); + force_sig_fault(TARGET_SIGTRAP, TARGET_TRAP_BRKPT, env->pc); break; case EXCP_ATOMIC: cpu_exec_step_atomic(cs); --=20 2.33.1 From nobody Thu May 2 06:56:47 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 1641931548845237.6418300666952; Tue, 11 Jan 2022 12:05:48 -0800 (PST) Received: from localhost ([::1]:48810 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NOt-0004nJ-Oo for importer@patchew.org; Tue, 11 Jan 2022 15:05:47 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44482) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCT-0007nh-Qw for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:52:57 -0500 Received: from mout.kundenserver.de ([217.72.192.73]:37823) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCR-0008FP-Uv for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:52:57 -0500 Received: from quad ([82.142.23.158]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MXpM2-1mqnl345ZE-00YDQn; Tue, 11 Jan 2022 20:52:54 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 12/30] linux-user/microblaze: Use force_sig_fault Date: Tue, 11 Jan 2022 20:52:29 +0100 Message-Id: <20220111195247.1737641-13-laurent@vivier.eu> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220111195247.1737641-1-laurent@vivier.eu> References: <20220111195247.1737641-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:Da3nXB/wYZTz+H3crD6MsB9vxY7bHZl9cWvtXR8sxI/nu1lloix 4NNwlPLdwWj0HEbEXdjcUR/NKQOzCsDuGMuPWUcDKI16CD20WRBmdidvV9zgUgA/Ydwvbrp cLFajwoqUQfPcSA56QkCH3x/h4AsenZ3g7bHDB7DqThJKMzlyDbvHmjGBKkpNj1ZXEWlecy TmLYB5rTVZDeR7vwxw1hA== X-UI-Out-Filterresults: notjunk:1;V03:K0:hOJpoaK4thw=:B8LPQ3k+iVU8KOJXgTczma kUS6kbi1rcoaZWfuKWV/VedrrrP9zsXh0TPXZ0gyXrXCjRUFk9qx4y4KGALHMBuajgEVAJO11 oNReWkXJHrXE23qyu2Wh6CybmdYkiTa4yoRz4GyEiXPL9Z8lEocSsLqORpPlCzw4Jj38JMyKv uAfyGduSkSXArWk+r0Xfg2KfeAdsnzzz7B9N17xEUeTovmyjU5QaslU3SM/4W4DZBWynyAb18 qxLbk1Yo0btC0zBfr7qOWJ0d8rcGNUePQ7bH5W1Gm+yDlw+rEGPbNEes7lmP4gPNVR8r3/1ET zh2z0wbfm8vfhz3UA9IiWlq/IYzTGraCgTl/xwkBfOYaemBw85NgP/hiBLo9fuiqZWsItjfT+ mvu8xhj2bYX/uKNHsnuR/N0TeA7x9W1kssPaK2BUIuy6dfxt5cxobeb1IxGXOBs5TV3MlXKYU J0Jzz9UZDUUuecE/DhXIqYiQtdcQkuAdU2AqXgBlOjpRmk+sZAOQbVWEyceOUoBoMsD8JILW3 tAUB3UeRO3U+xgJVShj7wl2xac2QinTq3bj4UPgVMWjNC7Kp7nUIGTuFrZD5d2knl1No3VLAW XLPOZn3jPX4/iQR8hpTc0mqKiE5sMLoa2XBPAY5rC0Yrc4kjQ/d3DJEXu5oJuPG+i7QhBPjF7 OD8Z9IQoEMXalfgaARORSwY5oSoTqXv1dCKosuzD5nFaX3f4PFm4jUERmcndAVtRK8iE= 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 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: , Cc: Peter Maydell , Richard Henderson , Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1641931549414100003 Content-Type: text/plain; charset="utf-8" From: Richard Henderson Use the new function instead of setting up a target_siginfo_t and calling queue_signal. Fill in the missing PC for SIGTRAP. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-Id: <20220107213243.212806-13-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/microblaze/cpu_loop.c | 61 +++++++++++++------------------- 1 file changed, 25 insertions(+), 36 deletions(-) diff --git a/linux-user/microblaze/cpu_loop.c b/linux-user/microblaze/cpu_l= oop.c index ff1fb26c8baf..08620d4e6899 100644 --- a/linux-user/microblaze/cpu_loop.c +++ b/linux-user/microblaze/cpu_loop.c @@ -27,9 +27,8 @@ void cpu_loop(CPUMBState *env) { CPUState *cs =3D env_cpu(env); - int trapnr, ret; - target_siginfo_t info; - =20 + int trapnr, ret, si_code; + while (1) { cpu_exec_start(cs); trapnr =3D cpu_exec(cs); @@ -38,8 +37,8 @@ void cpu_loop(CPUMBState *env) =20 switch (trapnr) { case EXCP_INTERRUPT: - /* just indicate that signals should be handled asap */ - break; + /* just indicate that signals should be handled asap */ + break; case EXCP_SYSCALL: /* Return address is 4 bytes after the call. */ env->regs[14] +=3D 4; @@ -67,6 +66,7 @@ void cpu_loop(CPUMBState *env) */ env->regs[14] =3D env->pc; break; + case EXCP_HW_EXCP: env->regs[17] =3D env->pc + 4; if (env->iflags & D_FLAG) { @@ -74,42 +74,31 @@ void cpu_loop(CPUMBState *env) env->pc -=3D 4; /* FIXME: if branch was immed, replay the imm as well. */ } - env->iflags &=3D ~(IMM_FLAG | D_FLAG); - switch (env->esr & 31) { - case ESR_EC_DIVZERO: - info.si_signo =3D TARGET_SIGFPE; - info.si_errno =3D 0; - info.si_code =3D TARGET_FPE_FLTDIV; - info._sifields._sigfault._addr =3D 0; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); - break; - case ESR_EC_FPU: - info.si_signo =3D TARGET_SIGFPE; - info.si_errno =3D 0; - if (env->fsr & FSR_IO) { - info.si_code =3D TARGET_FPE_FLTINV; - } - if (env->fsr & FSR_DZ) { - info.si_code =3D TARGET_FPE_FLTDIV; - } - info._sifields._sigfault._addr =3D 0; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); - break; - default: - fprintf(stderr, "Unhandled hw-exception: 0x%x\n", - env->esr & ESR_EC_MASK); - cpu_dump_state(cs, stderr, 0); - exit(EXIT_FAILURE); - break; + case ESR_EC_DIVZERO: + si_code =3D TARGET_FPE_FLTDIV; + break; + case ESR_EC_FPU: + si_code =3D 0; + if (env->fsr & FSR_IO) { + si_code =3D TARGET_FPE_FLTINV; + } + if (env->fsr & FSR_DZ) { + si_code =3D TARGET_FPE_FLTDIV; + } + break; + default: + fprintf(stderr, "Unhandled hw-exception: 0x%x\n", + env->esr & ESR_EC_MASK); + cpu_dump_state(cs, stderr, 0); + exit(EXIT_FAILURE); } + force_sig_fault(TARGET_SIGFPE, si_code, env->pc); break; + case EXCP_DEBUG: - info.si_signo =3D TARGET_SIGTRAP; - info.si_errno =3D 0; - info.si_code =3D TARGET_TRAP_BRKPT; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); + force_sig_fault(TARGET_SIGTRAP, TARGET_TRAP_BRKPT, env->pc); break; case EXCP_ATOMIC: cpu_exec_step_atomic(cs); --=20 2.33.1 From nobody Thu May 2 06:56:47 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 1641931507449320.3424298378675; Tue, 11 Jan 2022 12:05:07 -0800 (PST) Received: from localhost ([::1]:48250 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NOA-0004QO-3Q for importer@patchew.org; Tue, 11 Jan 2022 15:05:04 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44494) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCU-0007pD-AP for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:52:59 -0500 Received: from mout.kundenserver.de ([212.227.17.24]:51337) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCS-0008Fd-JE for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:52:58 -0500 Received: from quad ([82.142.23.158]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MtOX2-1mDdW41yes-00usjL; Tue, 11 Jan 2022 20:52:54 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 13/30] linux-user/microblaze: Fix SIGFPE si_codes Date: Tue, 11 Jan 2022 20:52:30 +0100 Message-Id: <20220111195247.1737641-14-laurent@vivier.eu> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220111195247.1737641-1-laurent@vivier.eu> References: <20220111195247.1737641-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:aGpXwnUqRvLP5gupcRgBj1eE94Ekx9mEuy9zl3e9R+2JYTcxSDp BWsdezaV0+HZPy0ON6h5ZEB0/5HLqUAiiELg3FR4zK2RXCGFi5P65BhiNo2w4UhglGLHZCx 5WoPPW089yPj502KnpdkTTDSY6C4zttSiYXCjyHMoghGW51/uqKhPFhOQ6HuaFS6g0svGVf mTZ7MEg8FBnCfHcFD9HAw== X-UI-Out-Filterresults: notjunk:1;V03:K0:EdHWT6PYSCo=:Bsnr/ZRmVDDwfTSGQ04otB n52hEhvGfi2cicQY3lMJr1+CygPSRRQ2fEQfdrkMfAKv/wVXSBRECCkTgBUg/D/4iBb9t3cK8 mfgtD3GC7oyXJynKKB34EA8rZ2/tn2D1r19xF6k41MWZWZl4nrv04N4TMSgxxdINYjIpRL/2R Y+iXyz9DUVSyqm3vGuTxbcSn3X7eMMxd2rtxB4E9jQ7n8S3a0SzhmnyUMJ5D1RYrddaHDHOI4 zajUDbNodzRIbMQiec/uz9hv68gTviogb4O/TzYEz5LKfTTlAXqqi6R0yB5fQlEyQaSzraCUz prAmHiysL9+j3vJW8pXThhd/i1PFrBatmj5coXYhJ/mpOtAc1Cdbg1rUnxqmpKjp+V0QFOOig GkbZynzUyhK5x3VoQmqUlaA9mKnETKXiSx0NN+IJ1REhMBt1m2txpvaJYeNz47SFVXXvNAiA+ Glb8tZRhJWSmFMAa2Fm+EwbFznsr3MIkQyX3b07LPmbA0nPrSFTbjzXZzVHhdxmgmo1kXTEYu JcVHqhX/MODvRApHvnK/wjcuHH/DwKfF+1g53f5llUN7beBRZRj3xWOKrtwfK0xg63jDOyVKs Nhy6gcpSiStFi91SwsDvEu9U47F/PYEhb9FExnbQApl/MoVh6yef1jzjkeDn7+Q7O2pL8aFZP XBgUyC+XeFpFuAT56H0TGPs8TZJ/nJXYWYoI+jN/qk9kGOYfqPJUK6HSprhqNhnkmVFI= 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 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: , Cc: Peter Maydell , Richard Henderson , Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1641931509187100001 Content-Type: text/plain; charset="utf-8" From: Richard Henderson Fix a typo for ESR_EC_DIVZERO, which is integral not floating-point. Fix the if ladder for decoding floating-point exceptions. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-Id: <20220107213243.212806-14-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/microblaze/cpu_loop.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/linux-user/microblaze/cpu_loop.c b/linux-user/microblaze/cpu_l= oop.c index 08620d4e6899..1a2556be2c5f 100644 --- a/linux-user/microblaze/cpu_loop.c +++ b/linux-user/microblaze/cpu_loop.c @@ -77,15 +77,25 @@ void cpu_loop(CPUMBState *env) env->iflags &=3D ~(IMM_FLAG | D_FLAG); switch (env->esr & 31) { case ESR_EC_DIVZERO: - si_code =3D TARGET_FPE_FLTDIV; + si_code =3D TARGET_FPE_INTDIV; break; case ESR_EC_FPU: - si_code =3D 0; - if (env->fsr & FSR_IO) { + /* + * Note that the kernel passes along fsr as si_code + * if there's no recognized bit set. Possibly this + * implies that si_code is 0, but follow the structure. + */ + si_code =3D env->fsr; + if (si_code & FSR_IO) { si_code =3D TARGET_FPE_FLTINV; - } - if (env->fsr & FSR_DZ) { + } else if (si_code & FSR_OF) { + si_code =3D TARGET_FPE_FLTOVF; + } else if (si_code & FSR_UF) { + si_code =3D TARGET_FPE_FLTUND; + } else if (si_code & FSR_DZ) { si_code =3D TARGET_FPE_FLTDIV; + } else if (si_code & FSR_DO) { + si_code =3D TARGET_FPE_FLTRES; } break; default: --=20 2.33.1 From nobody Thu May 2 06:56:47 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 1641932235422846.075717607025; Tue, 11 Jan 2022 12:17:15 -0800 (PST) Received: from localhost ([::1]:46584 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NZy-0005ti-ER for importer@patchew.org; Tue, 11 Jan 2022 15:17:14 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44686) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCd-000841-5m for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:53:07 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:60865) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCa-0008Hl-9X for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:53:05 -0500 Received: from quad ([82.142.23.158]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MsIbU-1mEjRk3yOY-00tmGl; Tue, 11 Jan 2022 20:52:55 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 14/30] linux-user/mips: Improve do_break Date: Tue, 11 Jan 2022 20:52:31 +0100 Message-Id: <20220111195247.1737641-15-laurent@vivier.eu> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220111195247.1737641-1-laurent@vivier.eu> References: <20220111195247.1737641-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:6FVp8rF6uC1I7u7c6uWHPNox3Ug+JF04THgAaKDcq/7c21W7PpM gQxn9q1fTNIOsDPh5pl8c/c1EgLe6vPapAz7ktk565yQsOlsreYA/NKsIoAB12zBOmU9+Yq VCHFsqlo0vgSLmMH1ebCfJqqHafmc1Yl3xwuZgPJGdiTyK70/pSjUVN6VvNr8vfWZMxVuRV VStzPsR/mq68E3LnTasbg== X-UI-Out-Filterresults: notjunk:1;V03:K0:zI5vTTebP7s=:cw6cbn4F6pMcCx7UfNdk7J 7bOdHkol2suDxPUMX2LxjoO+3oBSg/Fgj4XyFxlX5epFKbHTvMko0PV/rb57qqtKLd1+EAUiZ PqaLVVBNGA9sfbTcyOpY/LM0FargOsc5ak3FGNzGSPq1dtyNhfhFZaBoxZs6Tj6mMidR9nJky 17i9Qlw93Xn/my5IeSnToFQ9qreOMKf8FSIVKx+vpW4zsqVINDco2yV5970yvd+8NBtgWCvES /+Z7kaVJBzr/bFfX+cRdljYawnTZ7vmBPEPNRVzZAxkjj9kBtI9ggT2fbx6fU1Q7HDRTgv/zv I2pUy+CRyCuqAJfTffaiiREwXd/hu2cvrge0gk8N8ue8l1MzpvZxpasZSLBnPM3mOyaniEBnQ 1L6l9a5p0/3HzQFEj/BFAujrri/7IHER56uVP2I5RvuhYsC7POkgacqselXtLu2VLQKhLAK6T rbUrMgLelWwKUhAVZ6lfmHKUGgmjguWyzatpOYWcQrxtcNfqKQ1+sA6WOar2tXuAfgc5zfl5Z n0+O3NP5B0kd3585oiKYxE8PWD+kXfNsjgNn1aarj0FGYt1XC6erK3s3L3uPsAAWnQWjcY788 FsfO0uQ3/3lO4PEG+2pEjvOuQH3CoXCX9XJYZNZKC3vtPyXIIYa2/9VdWewyoDrbLte3tBla+ QYDEthPFCwlL5A88UDDNr3SKmadEI2kYsxEHkkcZq+ypu82uBVTvY1QD9SgWhSejrzDc= 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.10; 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 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: , Cc: Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1641932236345100003 From: Richard Henderson Rename to do_tr_or_bp, as per the kernel function. Add a 'trap' argument, akin to the kernel's si_code, but clearer. The return value is always 0, so change the return value to void. Use force_sig and force_sig_fault. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Richard Henderson Message-Id: <20220107213243.212806-15-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/mips/cpu_loop.c | 46 +++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/linux-user/mips/cpu_loop.c b/linux-user/mips/cpu_loop.c index 32f9fc1c1c7c..4fa24cc07452 100644 --- a/linux-user/mips/cpu_loop.c +++ b/linux-user/mips/cpu_loop.c @@ -40,29 +40,25 @@ enum { BRK_DIVZERO =3D 7 }; =20 -static int do_break(CPUMIPSState *env, target_siginfo_t *info, - unsigned int code) +static void do_tr_or_bp(CPUMIPSState *env, unsigned int code, bool trap) { - int ret =3D -1; + target_ulong pc =3D env->active_tc.PC; =20 switch (code) { case BRK_OVERFLOW: + force_sig_fault(TARGET_SIGFPE, TARGET_FPE_INTOVF, pc); + break; case BRK_DIVZERO: - info->si_signo =3D TARGET_SIGFPE; - info->si_errno =3D 0; - info->si_code =3D (code =3D=3D BRK_OVERFLOW) ? FPE_INTOVF : FPE_IN= TDIV; - queue_signal(env, info->si_signo, QEMU_SI_FAULT, &*info); - ret =3D 0; + force_sig_fault(TARGET_SIGFPE, TARGET_FPE_INTDIV, pc); break; default: - info->si_signo =3D TARGET_SIGTRAP; - info->si_errno =3D 0; - queue_signal(env, info->si_signo, QEMU_SI_FAULT, &*info); - ret =3D 0; + if (trap) { + force_sig(TARGET_SIGTRAP); + } else { + force_sig_fault(TARGET_SIGTRAP, TARGET_TRAP_BRKPT, pc); + } break; } - - return ret; } =20 void cpu_loop(CPUMIPSState *env) @@ -205,6 +201,13 @@ done_syscall: abi_ulong trap_instr; unsigned int code; =20 + /* + * FIXME: It would be better to decode the trap number + * during translate, and store it in error_code while + * raising the exception. We should not be re-reading + * the opcode here. + */ + if (env->hflags & MIPS_HFLAG_M16) { if (env->insn_flags & ASE_MICROMIPS) { /* microMIPS mode */ @@ -257,9 +260,7 @@ done_syscall: } } =20 - if (do_break(env, &info, code) !=3D 0) { - goto error; - } + do_tr_or_bp(env, code, false); } break; case EXCP_TRAP: @@ -267,6 +268,13 @@ done_syscall: abi_ulong trap_instr; unsigned int code =3D 0; =20 + /* + * FIXME: It would be better to decode the trap number + * during translate, and store it in error_code while + * raising the exception. We should not be re-reading + * the opcode here. + */ + if (env->hflags & MIPS_HFLAG_M16) { /* microMIPS mode */ abi_ulong instr[2]; @@ -293,9 +301,7 @@ done_syscall: } } =20 - if (do_break(env, &info, code) !=3D 0) { - goto error; - } + do_tr_or_bp(env, code, true); } break; case EXCP_ATOMIC: --=20 2.33.1 From nobody Thu May 2 06:56:47 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 1641931784953225.95680218867278; Tue, 11 Jan 2022 12:09:44 -0800 (PST) Received: from localhost ([::1]:57334 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NSh-0002CP-U5 for importer@patchew.org; Tue, 11 Jan 2022 15:09:43 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44508) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCV-0007qC-8o for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:52:59 -0500 Received: from mout.kundenserver.de ([212.227.17.13]:37521) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCT-0008Fu-EZ for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:52:58 -0500 Received: from quad ([82.142.23.158]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MjSsm-1mfAGT1gXC-00kwb9; Tue, 11 Jan 2022 20:52:55 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 15/30] linux-user/mips: Use force_sig_fault Date: Tue, 11 Jan 2022 20:52:32 +0100 Message-Id: <20220111195247.1737641-16-laurent@vivier.eu> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220111195247.1737641-1-laurent@vivier.eu> References: <20220111195247.1737641-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:aASmtJmOOqOnnulFlK7ktVjscrOUC0SNYVY5wcfT2BShQqi6i3d Zz0JChYByvBUjft9csC3OUbW2tOQeP8JfY1dkz1FkgCDNr94WnDc2vetIRBBnz98KUMybiG alxde7YQfAjCsdvxIbkfKJPBrgr+GIhKygh8+QljnXRFwyEsz+rUSkwKbvQZsyz+r0bTDO7 NR2JpXFLUYALu6uocJFhw== X-UI-Out-Filterresults: notjunk:1;V03:K0:mPpgFwZxTaQ=:LHo13RTzNiWCABnEQptoz+ UHPbs9IEvWf9eYozHZ+34GiwuMBriMwwzpuk3jxp3PJggiI5j4wrCcpyAzotiF5z3mykFdQMC YZj+auH+pRR2qp2j+aGrfhfAyBzYgWPaEJ3Zb1N2HOPKdq5HyP/nz7Y9EPZzy5DIE5Sj8jLC3 uWoDH8So5PXuASbTAlnon1/wOfKFd7r8yYU7fQbgBucUDihHRMzBsqISGrSOk4XvVkCmcdX7J GYaPT10IENLdzwFUzzAP1AYrGiF0JNAoFnC+6kR0SPYThAYzXSjAkyIzxu4IXP6g9ly43elcH gpzE5qznQS+gWtZjpBTkq8jFilPcH+Mcn7FDfYI9AnSmrg9pb8r1nn32PyAcLEWDOMoy6/dN0 d9t+pVVXceW/yEPNEoHfFTrBuz3E1f+xtf5tzjwDduwCoHCZEG6KiICiLWRasU83xRwTPrr1J cK9GnlwXKJirAeljAELQnNK1F4kJKLV8ikRPECKI4ijMRWNen4orG20J9mzmGDKiFIhbI1mC6 DPMy6h6uXXPY680OFvNTqa5E93xj4/O6840pMHacVVoi+rF4nNGs1jcgxPXEeyB+Ug69mHa42 wRehPJ+2N2apSW7v1nVcBRe0U4xqAT48EwYFqC0DIq+EtV5tm4e0xqgJOJOxhUcl2SDb1hfSb Fxo5pNXkOYwG9iJrFxAIQJq83MzBU1wug9f2nIf14pHhxBS/vLStbyWlntf9hAG3ai48= 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 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: , Cc: Peter Maydell , Richard Henderson , Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1641931785974100001 Content-Type: text/plain; charset="utf-8" From: Richard Henderson Use the new function instead of setting up a target_siginfo_t and calling queue_signal. Fill in the missing PC for SIGTRAP and SIGFPE; use force_sig (SI_KERNEL) for EXCP_DSPDIS. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-Id: <20220107213243.212806-16-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/mips/cpu_loop.c | 38 +++++++++++++------------------------- 1 file changed, 13 insertions(+), 25 deletions(-) diff --git a/linux-user/mips/cpu_loop.c b/linux-user/mips/cpu_loop.c index 4fa24cc07452..1286fbc2e0d3 100644 --- a/linux-user/mips/cpu_loop.c +++ b/linux-user/mips/cpu_loop.c @@ -64,8 +64,7 @@ static void do_tr_or_bp(CPUMIPSState *env, unsigned int c= ode, bool trap) void cpu_loop(CPUMIPSState *env) { CPUState *cs =3D env_cpu(env); - target_siginfo_t info; - int trapnr; + int trapnr, si_code; abi_long ret; # ifdef TARGET_ABI_MIPSO32 unsigned int syscall_num; @@ -156,43 +155,32 @@ done_syscall: break; case EXCP_CpU: case EXCP_RI: - info.si_signo =3D TARGET_SIGILL; - info.si_errno =3D 0; - info.si_code =3D 0; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); + case EXCP_DSPDIS: + force_sig(TARGET_SIGILL); break; case EXCP_INTERRUPT: /* just indicate that signals should be handled asap */ break; case EXCP_DEBUG: - info.si_signo =3D TARGET_SIGTRAP; - info.si_errno =3D 0; - info.si_code =3D TARGET_TRAP_BRKPT; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); - break; - case EXCP_DSPDIS: - info.si_signo =3D TARGET_SIGILL; - info.si_errno =3D 0; - info.si_code =3D TARGET_ILL_ILLOPC; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); + force_sig_fault(TARGET_SIGTRAP, TARGET_TRAP_BRKPT, + env->active_tc.PC); break; case EXCP_FPE: - info.si_signo =3D TARGET_SIGFPE; - info.si_errno =3D 0; - info.si_code =3D TARGET_FPE_FLTUNK; + si_code =3D TARGET_FPE_FLTUNK; if (GET_FP_CAUSE(env->active_fpu.fcr31) & FP_INVALID) { - info.si_code =3D TARGET_FPE_FLTINV; + si_code =3D TARGET_FPE_FLTINV; } else if (GET_FP_CAUSE(env->active_fpu.fcr31) & FP_DIV0) { - info.si_code =3D TARGET_FPE_FLTDIV; + si_code =3D TARGET_FPE_FLTDIV; } else if (GET_FP_CAUSE(env->active_fpu.fcr31) & FP_OVERFLOW) { - info.si_code =3D TARGET_FPE_FLTOVF; + si_code =3D TARGET_FPE_FLTOVF; } else if (GET_FP_CAUSE(env->active_fpu.fcr31) & FP_UNDERFLOW)= { - info.si_code =3D TARGET_FPE_FLTUND; + si_code =3D TARGET_FPE_FLTUND; } else if (GET_FP_CAUSE(env->active_fpu.fcr31) & FP_INEXACT) { - info.si_code =3D TARGET_FPE_FLTRES; + si_code =3D TARGET_FPE_FLTRES; } - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); + force_sig_fault(TARGET_SIGFPE, si_code, env->active_tc.PC); break; + /* The code below was inspired by the MIPS Linux kernel trap * handling code in arch/mips/kernel/traps.c. */ --=20 2.33.1 From nobody Thu May 2 06:56:47 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 1641932458991903.0293508161752; Tue, 11 Jan 2022 12:20:58 -0800 (PST) Received: from localhost ([::1]:54458 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NdZ-0002nc-ML for importer@patchew.org; Tue, 11 Jan 2022 15:20:57 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44834) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCr-0000OP-F5 for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:53:21 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:49867) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCb-0008IN-R6 for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:53:21 -0500 Received: from quad ([82.142.23.158]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MeC5x-1mXDlY3a8V-00bHY2; Tue, 11 Jan 2022 20:52:56 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 16/30] target/mips: Extract break code into env->error_code Date: Tue, 11 Jan 2022 20:52:33 +0100 Message-Id: <20220111195247.1737641-17-laurent@vivier.eu> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220111195247.1737641-1-laurent@vivier.eu> References: <20220111195247.1737641-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:iefuREYRQN058epDP68h+H3T3Mu6+2a07KVYMIampndCmORcTM3 CmpAC0rD193YSod830ipVU7yXwqSCFaL5Jedx/AkHMwU+SMLBeS24vxaNtaL0/jKLmfAK9F 5XMPILg8BfCNRjFq2X9dS2WIPBetw8SvNl0f+2mldKKMTsz/+KP8tJmUAE1KoIDqOdVH9BD B8TidPv3MxpqYItdPZskQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:vF4osvwsrx8=:4PuHKM14Ye0XWMJ2ZzLTZe TOerhcD8aYXUxy2bcLsZCkxb5OFoFMFQ9FglVmqazQwUw5926KjZ5W89/LtnoeA+L+Wco6C10 W5Cq2wzn6XXEs6hM0KFZTwXzCii25eO2Cn3zL9jNi+Lw38oSYZL6IveDDGKkXSPO3Rdd8TIIA wDwMxTaGSykGZhbf+Zt42NDwEa/0np29enFBqihltkoYwg9qnIrUSoiompxf5b8V7VMKpqoQ6 5aQ5w7p2wp231vM6DsjhhKtaxa4WSagw1VuIRN2VzkwxfFH/L90b7il0lRcGQKDDfl15NqiK2 MvDRTagwxs0xfORscykhhYFOnLpTJGGt1apfPu+ivZ3ypEjkG+ixRQbWVR+wLnIJ9p88ToCBt DXfQKED1twocUgjJ69oDhR0FPzYpt+EhkbxSyzFfxKLxsfd/D8devBmlIG8m0hvNbxFSHEMSw H59R8VuWuXOVTC57vNU1n8MihryEwHxPUPtBz2W7jO1YVqZXMS90vmGRmpsrFKAz7O2VeUmH+ BYkvRStEGm+HCUYdWrPi+lcUH8WdoEdBY/ycV2Lu+s7Mq+FUAIvOV6rjyZLPzjWs/KJeQtBtA BVSmfhOS/uUWvSoKM/QZ18YkmUmOzV3FDPhRFLMcJLJrKquo79qrnEVsJ5U+g5oVQErNm+ATu OuCpKA3no+aSck8RDlFoYa5vAU+dv3XSOiSB0I0WgQdPqQy/T8yXBp6omNtz+Alsu0xk= 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.10; 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 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: , Cc: Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1641932460697100001 From: Richard Henderson Simplify cpu_loop by doing all of the decode in translate. This fixes a bug in that cpu_loop was not handling the different layout of the R6 version of break16. This fixes a bug in that cpu_loop extracted the wrong bits for the mips16e break16 instruction. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Richard Henderson Message-Id: <20220107213243.212806-17-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/mips/cpu_loop.c | 73 +++-------------------- target/mips/tcg/micromips_translate.c.inc | 6 +- target/mips/tcg/mips16e_translate.c.inc | 2 +- target/mips/tcg/translate.c | 12 +++- target/mips/tcg/translate.h | 1 + 5 files changed, 25 insertions(+), 69 deletions(-) diff --git a/linux-user/mips/cpu_loop.c b/linux-user/mips/cpu_loop.c index 1286fbc2e0d3..9a6ab2dd986a 100644 --- a/linux-user/mips/cpu_loop.c +++ b/linux-user/mips/cpu_loop.c @@ -65,6 +65,7 @@ void cpu_loop(CPUMIPSState *env) { CPUState *cs =3D env_cpu(env); int trapnr, si_code; + unsigned int code; abi_long ret; # ifdef TARGET_ABI_MIPSO32 unsigned int syscall_num; @@ -185,71 +186,15 @@ done_syscall: * handling code in arch/mips/kernel/traps.c. */ case EXCP_BREAK: - { - abi_ulong trap_instr; - unsigned int code; - - /* - * FIXME: It would be better to decode the trap number - * during translate, and store it in error_code while - * raising the exception. We should not be re-reading - * the opcode here. - */ - - if (env->hflags & MIPS_HFLAG_M16) { - if (env->insn_flags & ASE_MICROMIPS) { - /* microMIPS mode */ - ret =3D get_user_u16(trap_instr, env->active_tc.PC= ); - if (ret !=3D 0) { - goto error; - } - - if ((trap_instr >> 10) =3D=3D 0x11) { - /* 16-bit instruction */ - code =3D trap_instr & 0xf; - } else { - /* 32-bit instruction */ - abi_ulong instr_lo; - - ret =3D get_user_u16(instr_lo, - env->active_tc.PC + 2); - if (ret !=3D 0) { - goto error; - } - trap_instr =3D (trap_instr << 16) | instr_lo; - code =3D ((trap_instr >> 6) & ((1 << 20) - 1)); - /* Unfortunately, microMIPS also suffers from - the old assembler bug... */ - if (code >=3D (1 << 10)) { - code >>=3D 10; - } - } - } else { - /* MIPS16e mode */ - ret =3D get_user_u16(trap_instr, env->active_tc.PC= ); - if (ret !=3D 0) { - goto error; - } - code =3D (trap_instr >> 6) & 0x3f; - } - } else { - ret =3D get_user_u32(trap_instr, env->active_tc.PC); - if (ret !=3D 0) { - goto error; - } - - /* As described in the original Linux kernel code, the - * below checks on 'code' are to work around an old - * assembly bug. - */ - code =3D ((trap_instr >> 6) & ((1 << 20) - 1)); - if (code >=3D (1 << 10)) { - code >>=3D 10; - } - } - - do_tr_or_bp(env, code, false); + /* + * As described in the original Linux kernel code, the below + * checks on 'code' are to work around an old assembly bug. + */ + code =3D env->error_code; + if (code >=3D (1 << 10)) { + code >>=3D 10; } + do_tr_or_bp(env, code, false); break; case EXCP_TRAP: { diff --git a/target/mips/tcg/micromips_translate.c.inc b/target/mips/tcg/mi= cromips_translate.c.inc index 0760941431e1..9013f8403739 100644 --- a/target/mips/tcg/micromips_translate.c.inc +++ b/target/mips/tcg/micromips_translate.c.inc @@ -822,7 +822,7 @@ static void gen_pool16c_insn(DisasContext *ctx) gen_HILO(ctx, OPC_MFLO, 0, uMIPS_RS5(ctx->opcode)); break; case BREAK16: - generate_exception_end(ctx, EXCP_BREAK); + generate_exception_break(ctx, extract32(ctx->opcode, 0, 4)); break; case SDBBP16: if (is_uhi(extract32(ctx->opcode, 0, 4))) { @@ -937,7 +937,7 @@ static void gen_pool16c_r6_insn(DisasContext *ctx) break; case R6_BREAK16: /* BREAK16 */ - generate_exception(ctx, EXCP_BREAK); + generate_exception_break(ctx, extract32(ctx->opcode, 6, 4)); break; case R6_SDBBP16: /* SDBBP16 */ @@ -1812,7 +1812,7 @@ static void decode_micromips32_opc(CPUMIPSState *env,= DisasContext *ctx) gen_pool32axf(env, ctx, rt, rs); break; case BREAK32: - generate_exception_end(ctx, EXCP_BREAK); + generate_exception_break(ctx, extract32(ctx->opcode, 6, 20)); break; case SIGRIE: check_insn(ctx, ISA_MIPS_R6); diff --git a/target/mips/tcg/mips16e_translate.c.inc b/target/mips/tcg/mips= 16e_translate.c.inc index 84d816603aa5..f57e0a5f2a95 100644 --- a/target/mips/tcg/mips16e_translate.c.inc +++ b/target/mips/tcg/mips16e_translate.c.inc @@ -969,7 +969,7 @@ static int decode_ase_mips16e(CPUMIPSState *env, DisasC= ontext *ctx) gen_slt(ctx, OPC_SLTU, 24, rx, ry); break; case RR_BREAK: - generate_exception_end(ctx, EXCP_BREAK); + generate_exception_break(ctx, extract32(ctx->opcode, 5, 6)); break; case RR_SLLV: gen_shift(ctx, OPC_SLLV, ry, rx, ry); diff --git a/target/mips/tcg/translate.c b/target/mips/tcg/translate.c index 1c2264417cfd..7f0cc81a9056 100644 --- a/target/mips/tcg/translate.c +++ b/target/mips/tcg/translate.c @@ -1367,6 +1367,16 @@ void generate_exception_end(DisasContext *ctx, int e= xcp) generate_exception_err(ctx, excp, 0); } =20 +void generate_exception_break(DisasContext *ctx, int code) +{ +#ifdef CONFIG_USER_ONLY + /* Pass the break code along to cpu_loop. */ + tcg_gen_st_i32(tcg_constant_i32(code), cpu_env, + offsetof(CPUMIPSState, error_code)); +#endif + generate_exception_end(ctx, EXCP_BREAK); +} + void gen_reserved_instruction(DisasContext *ctx) { generate_exception_end(ctx, EXCP_RI); @@ -14160,7 +14170,7 @@ static void decode_opc_special(CPUMIPSState *env, D= isasContext *ctx) generate_exception_end(ctx, EXCP_SYSCALL); break; case OPC_BREAK: - generate_exception_end(ctx, EXCP_BREAK); + generate_exception_break(ctx, extract32(ctx->opcode, 6, 20)); break; case OPC_SYNC: check_insn(ctx, ISA_MIPS2); diff --git a/target/mips/tcg/translate.h b/target/mips/tcg/translate.h index 6111493651f6..ae01515efe11 100644 --- a/target/mips/tcg/translate.h +++ b/target/mips/tcg/translate.h @@ -129,6 +129,7 @@ enum { void generate_exception(DisasContext *ctx, int excp); void generate_exception_err(DisasContext *ctx, int excp, int err); void generate_exception_end(DisasContext *ctx, int excp); +void generate_exception_break(DisasContext *ctx, int code); void gen_reserved_instruction(DisasContext *ctx); =20 void check_insn(DisasContext *ctx, uint64_t flags); --=20 2.33.1 From nobody Thu May 2 06:56:47 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 1641931343283254.9198588152724; Tue, 11 Jan 2022 12:02:23 -0800 (PST) Received: from localhost ([::1]:39180 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NLZ-0006QG-Aj for importer@patchew.org; Tue, 11 Jan 2022 15:02:21 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44580) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCY-0007vx-8m for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:53:02 -0500 Received: from mout.kundenserver.de ([212.227.17.13]:56411) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCW-0008Ge-9a for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:53:01 -0500 Received: from quad ([82.142.23.158]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MCs9W-1nG8ds1WRU-008qxZ; Tue, 11 Jan 2022 20:52:56 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 17/30] target/mips: Extract trap code into env->error_code Date: Tue, 11 Jan 2022 20:52:34 +0100 Message-Id: <20220111195247.1737641-18-laurent@vivier.eu> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220111195247.1737641-1-laurent@vivier.eu> References: <20220111195247.1737641-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:QYcqv4F/TPusorgg7BEIt288HOODmoPU+0QzU0NLJk1d1POXmSt FVZ3zr1NHM/YY55Feqy0eWzdd5D9wucM8NC5c5zDUOe0XsYvPFpd0CXKzweMQ7novdLi3HF Q9YYOWJ4FTwqfTyAawTaKoESUI7zdR6moIvKhLsPz5JBfTB7XpMLwe5iBM41OEW/9XIrf/t YYZdtU8I/SMAdsnhL05Aw== X-UI-Out-Filterresults: notjunk:1;V03:K0:6TMvSs48rEk=:9GQFxFZ3e2hFR03KOfsSHV zh4PhmUjMZpSP+7oeqJBrXNXv/u/eIuSGTnORtzzGtxV/M4mq4g2Q6FTv0U5JHnl/+Rft3Sl6 pXSmmjwOqxu0v/cKu6XrInX1BX7u0JW9cNucNqpJQABU7qMJZbo57RpAKPSss3eBQFp//VnKm 3asF5Zbisjw2mxu1fJsiUECuNdwR1TORe0xKlxOw7KquCxeGyPyCZ1osPbbPwvJ3ljIH1cgwW 7x79nmq8Ktp85+3RPuKBaASXnPsbNerLJG/vYYiQEEiAUpuWoQK4swsxEiPTeQvxZBGD1PoBm cmUaEGTU+NG2t1SSXw7FsuuRrrOGVYipL/2gQocAdFg8FOkJz0m1fRNqYq2EkRUGP2dt2iZrc i52i32wEsibI/MVRpHMLmopMgEfxYAB5mUxwfevEzWU2v3OodBd2sLiJ71x5X6uyWgsGnlqs2 Xpe4RcYdqx6TVUe93fs8qOtBSDNfRuZ7QWzQn78FRhyc079RuLggNL8RLdDw53W/trvpXAK+4 AtgMoGdxnHl1e1VIcMdl9wnHgU57t8PJypLTvDib69utuTNWfrBvgRwCepCpvA6mfgwreCI8P jpxDSTJEHe+U0Ei1jyqh3WNGnnjy96mthHpa0qdZWBVLTixheLPSJX2LqEB4kMaIX4Kxud4YG yeNAN3WGoqz8kMmny2JDYrXzSfnPWcgyicFqwy+oG2YQpzuuInTlwoFbI3txjMyu1OUg= 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 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: , Cc: Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1641931344797100001 From: Richard Henderson Simplify cpu_loop by doing all of the decode in translate. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Richard Henderson Message-Id: <20220107213243.212806-18-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/mips/cpu_loop.c | 41 +---------------------- target/mips/tcg/micromips_translate.c.inc | 4 +-- target/mips/tcg/nanomips_translate.c.inc | 4 +-- target/mips/tcg/translate.c | 24 ++++++++++--- 4 files changed, 25 insertions(+), 48 deletions(-) diff --git a/linux-user/mips/cpu_loop.c b/linux-user/mips/cpu_loop.c index 9a6ab2dd986a..9bb12a07ba08 100644 --- a/linux-user/mips/cpu_loop.c +++ b/linux-user/mips/cpu_loop.c @@ -197,51 +197,12 @@ done_syscall: do_tr_or_bp(env, code, false); break; case EXCP_TRAP: - { - abi_ulong trap_instr; - unsigned int code =3D 0; - - /* - * FIXME: It would be better to decode the trap number - * during translate, and store it in error_code while - * raising the exception. We should not be re-reading - * the opcode here. - */ - - if (env->hflags & MIPS_HFLAG_M16) { - /* microMIPS mode */ - abi_ulong instr[2]; - - ret =3D get_user_u16(instr[0], env->active_tc.PC) || - get_user_u16(instr[1], env->active_tc.PC + 2); - - trap_instr =3D (instr[0] << 16) | instr[1]; - } else { - ret =3D get_user_u32(trap_instr, env->active_tc.PC); - } - - if (ret !=3D 0) { - goto error; - } - - /* The immediate versions don't provide a code. */ - if (!(trap_instr & 0xFC000000)) { - if (env->hflags & MIPS_HFLAG_M16) { - /* microMIPS mode */ - code =3D ((trap_instr >> 12) & ((1 << 4) - 1)); - } else { - code =3D ((trap_instr >> 6) & ((1 << 10) - 1)); - } - } - - do_tr_or_bp(env, code, true); - } + do_tr_or_bp(env, env->error_code, true); break; case EXCP_ATOMIC: cpu_exec_step_atomic(cs); break; default: -error: EXCP_DUMP(env, "qemu: unhandled CPU exception 0x%x - aborting\= n", trapnr); abort(); } diff --git a/target/mips/tcg/micromips_translate.c.inc b/target/mips/tcg/mi= cromips_translate.c.inc index 9013f8403739..fc6ede75b804 100644 --- a/target/mips/tcg/micromips_translate.c.inc +++ b/target/mips/tcg/micromips_translate.c.inc @@ -1047,7 +1047,7 @@ static void gen_pool32axf(CPUMIPSState *env, DisasCon= text *ctx, int rt, int rs) case TNE: mips32_op =3D OPC_TNE; do_trap: - gen_trap(ctx, mips32_op, rs, rt, -1); + gen_trap(ctx, mips32_op, rs, rt, -1, extract32(ctx->opcode, 12, 4)= ); break; #ifndef CONFIG_USER_ONLY case MFC0: @@ -2439,7 +2439,7 @@ static void decode_micromips32_opc(CPUMIPSState *env,= DisasContext *ctx) check_insn_opc_removed(ctx, ISA_MIPS_R6); mips32_op =3D OPC_TEQI; do_trapi: - gen_trap(ctx, mips32_op, rs, -1, imm); + gen_trap(ctx, mips32_op, rs, -1, imm, 0); break; =20 case BNEZC: diff --git a/target/mips/tcg/nanomips_translate.c.inc b/target/mips/tcg/nan= omips_translate.c.inc index 2c022a49f244..916cece4d27e 100644 --- a/target/mips/tcg/nanomips_translate.c.inc +++ b/target/mips/tcg/nanomips_translate.c.inc @@ -1268,11 +1268,11 @@ static void gen_pool32a0_nanomips_insn(CPUMIPSState= *env, DisasContext *ctx) switch (extract32(ctx->opcode, 10, 1)) { case NM_TEQ: check_nms(ctx); - gen_trap(ctx, OPC_TEQ, rs, rt, -1); + gen_trap(ctx, OPC_TEQ, rs, rt, -1, rd); break; case NM_TNE: check_nms(ctx); - gen_trap(ctx, OPC_TNE, rs, rt, -1); + gen_trap(ctx, OPC_TNE, rs, rt, -1, rd); break; } break; diff --git a/target/mips/tcg/translate.c b/target/mips/tcg/translate.c index 7f0cc81a9056..b82a7ec6ad50 100644 --- a/target/mips/tcg/translate.c +++ b/target/mips/tcg/translate.c @@ -4733,7 +4733,7 @@ static void gen_loongson_lsdc2(DisasContext *ctx, int= rt, =20 /* Traps */ static void gen_trap(DisasContext *ctx, uint32_t opc, - int rs, int rt, int16_t imm) + int rs, int rt, int16_t imm, int code) { int cond; TCGv t0 =3D tcg_temp_new(); @@ -4778,6 +4778,11 @@ static void gen_trap(DisasContext *ctx, uint32_t opc, case OPC_TGEU: /* rs >=3D rs unsigned */ case OPC_TGEIU: /* r0 >=3D 0 unsigned */ /* Always trap */ +#ifdef CONFIG_USER_ONLY + /* Pass the break code along to cpu_loop. */ + tcg_gen_st_i32(tcg_constant_i32(code), cpu_env, + offsetof(CPUMIPSState, error_code)); +#endif generate_exception_end(ctx, EXCP_TRAP); break; case OPC_TLT: /* rs < rs */ @@ -4818,6 +4823,18 @@ static void gen_trap(DisasContext *ctx, uint32_t opc, tcg_gen_brcond_tl(TCG_COND_EQ, t0, t1, l1); break; } +#ifdef CONFIG_USER_ONLY + /* Pass the break code along to cpu_loop. */ + tcg_gen_st_i32(tcg_constant_i32(code), cpu_env, + offsetof(CPUMIPSState, error_code)); +#endif + /* Like save_cpu_state, only don't update saved values. */ + if (ctx->base.pc_next !=3D ctx->saved_pc) { + gen_save_pc(ctx->base.pc_next); + } + if (ctx->hflags !=3D ctx->saved_hflags) { + tcg_gen_movi_i32(hflags, ctx->hflags); + } generate_exception(ctx, EXCP_TRAP); gen_set_label(l1); } @@ -14155,7 +14172,7 @@ static void decode_opc_special(CPUMIPSState *env, D= isasContext *ctx) case OPC_TEQ: case OPC_TNE: check_insn(ctx, ISA_MIPS2); - gen_trap(ctx, op1, rs, rt, -1); + gen_trap(ctx, op1, rs, rt, -1, extract32(ctx->opcode, 6, 10)); break; case OPC_PMON: /* Pmon entry point, also R4010 selsl */ @@ -15289,11 +15306,10 @@ static bool decode_opc_legacy(CPUMIPSState *env, = DisasContext *ctx) case OPC_TLTI: case OPC_TLTIU: case OPC_TEQI: - case OPC_TNEI: check_insn(ctx, ISA_MIPS2); check_insn_opc_removed(ctx, ISA_MIPS_R6); - gen_trap(ctx, op1, rs, -1, imm); + gen_trap(ctx, op1, rs, -1, imm, 0); break; case OPC_SIGRIE: check_insn(ctx, ISA_MIPS_R6); --=20 2.33.1 From nobody Thu May 2 06:56:47 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 1641931791303538.523214589444; Tue, 11 Jan 2022 12:09:51 -0800 (PST) Received: from localhost ([::1]:57616 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NSo-0002Qe-5Z for importer@patchew.org; Tue, 11 Jan 2022 15:09:50 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44546) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCX-0007tu-5d for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:53:01 -0500 Received: from mout.kundenserver.de ([217.72.192.73]:57511) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCV-0008GU-Cy for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:53:00 -0500 Received: from quad ([82.142.23.158]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1M6m1g-1n0FvC3iEY-008GJf; Tue, 11 Jan 2022 20:52:57 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 18/30] linux-user/openrisc: Use force_sig_fault Date: Tue, 11 Jan 2022 20:52:35 +0100 Message-Id: <20220111195247.1737641-19-laurent@vivier.eu> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220111195247.1737641-1-laurent@vivier.eu> References: <20220111195247.1737641-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:cdvF8q/Jys4QuCzSI6kxTZvivKO55tbItbk0cs+UTZUxUrCYBMY gPIp/QWd2Ia4MSKeKEbHDtpLAF3tI66Jk0P/Ystp3n7GxURfxZNup/psLzzB3GR9pwDHbPU z0tLg8gyRzN0oj3zFpciOZ015/7xYTRj1ynP39+xZ9q+mFiTnm0njPgRLQkZ5Fp2QHWXwqt eh6U+WDO/gB4WPWCn9j6g== X-UI-Out-Filterresults: notjunk:1;V03:K0:bQrn4owSXOQ=:+3gU/wK5GkGlYyMUkgQbg7 3mPAe1kBmKWYo55VVezMEPDVgr7PkyroZHFTNjG5DwzfWz4j7MzfPRxfXh6cLOYFXn603tRMS P6rOmxQ3LfzhVdTh3Z+QKIqVWKg+LhUusgBNo9vVkU+Ypm8tW7uqm3kQlYqMDA6DueoUYfgij lSc1t7ugGu6/+o3+X5HT6FO6kKD8V9e5dVPcFDViWAjqyaHihwi5UGgeMDDRDr8hs3YezmVzZ iig8Yn2Wxmf3IYC/ynj3Za8xboz44Ru5l79/vDu8NlezxvdmHFdKo5R57uLqgafi2Aa5hMUqA j+BchySYOkLJ+oXkS3WSYTx03GNFY1J6dvn6FnH/l41Whtct0TpRpOYtrj9NSnroQWVZjyTBD 07tfumD8K+cHfw1nGCOAInXi90XSLLFVbZdTdMOOlziQvpOVlKKkpT8kekGzgI6jdlkjSK7vo 3fbIoKmeTuCIz+2gDovxjDDoprIbWwTOkHA51eRpePrvCREQZaYm5uC+eB8jMVSsPla0RPMsc cOh8IS3jCYIcytHSPHBuS9hlAxEUSbaaHrh1yC9W+1mcdWg3nZC2hAE0KbydYRaosvykB7e+7 Sf3H/WcGCCrA0IBavuUUhPAw0qdhxOh+576OZqqvC9NhRWJbjJWOqT/c4EboKUAyxu4t8y0+E dM7NCHham5Wv+NWg3O2fX/fIccUcVXtkz/Lxtybyi548phfjqipnzxSaWAoYZOQFi5Kk= 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 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: , Cc: Stafford Horne , Richard Henderson , Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1641931793672100003 Content-Type: text/plain; charset="utf-8" From: Richard Henderson Use the new function instead of setting up a target_siginfo_t and calling queue_signal. Fill in the missing PC for SIGTRAP. Reviewed-by: Stafford Horne Signed-off-by: Richard Henderson Message-Id: <20220107213243.212806-19-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/openrisc/cpu_loop.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/linux-user/openrisc/cpu_loop.c b/linux-user/openrisc/cpu_loop.c index 592901a68b73..7683bea0649e 100644 --- a/linux-user/openrisc/cpu_loop.c +++ b/linux-user/openrisc/cpu_loop.c @@ -29,7 +29,6 @@ void cpu_loop(CPUOpenRISCState *env) CPUState *cs =3D env_cpu(env); int trapnr; abi_long ret; - target_siginfo_t info; =20 for (;;) { cpu_exec_start(cs); @@ -55,27 +54,16 @@ void cpu_loop(CPUOpenRISCState *env) } break; case EXCP_ALIGN: - info.si_signo =3D TARGET_SIGBUS; - info.si_errno =3D 0; - info.si_code =3D TARGET_BUS_ADRALN; - info._sifields._sigfault._addr =3D env->pc; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); + force_sig_fault(TARGET_SIGBUS, TARGET_BUS_ADRALN, env->eear); break; case EXCP_ILLEGAL: - info.si_signo =3D TARGET_SIGILL; - info.si_errno =3D 0; - info.si_code =3D TARGET_ILL_ILLOPC; - info._sifields._sigfault._addr =3D env->pc; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); + force_sig_fault(TARGET_SIGILL, TARGET_ILL_ILLOPC, env->pc); break; case EXCP_INTERRUPT: /* We processed the pending cpu work above. */ break; case EXCP_DEBUG: - info.si_signo =3D TARGET_SIGTRAP; - info.si_errno =3D 0; - info.si_code =3D TARGET_TRAP_BRKPT; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); + force_sig_fault(TARGET_SIGTRAP, TARGET_TRAP_BRKPT, env->pc); break; case EXCP_ATOMIC: cpu_exec_step_atomic(cs); --=20 2.33.1 From nobody Thu May 2 06:56:47 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 1641932029250728.055536764622; Tue, 11 Jan 2022 12:13:49 -0800 (PST) Received: from localhost ([::1]:37334 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NWe-0007uv-5j for importer@patchew.org; Tue, 11 Jan 2022 15:13:48 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44612) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCZ-0007yZ-Q2 for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:53:03 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:36205) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCW-0008Gi-I8 for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:53:03 -0500 Received: from quad ([82.142.23.158]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MC2sF-1nCZs71Zm9-00CNc3; Tue, 11 Jan 2022 20:52:58 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 19/30] linux-user/ppc: Use force_sig_fault Date: Tue, 11 Jan 2022 20:52:36 +0100 Message-Id: <20220111195247.1737641-20-laurent@vivier.eu> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220111195247.1737641-1-laurent@vivier.eu> References: <20220111195247.1737641-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:mMC3Rm7cC5yvtCN7sJzI3HiZrEs8fbKR5lAYgBNDRMtQz7Dsaux Oc/KEza3lE4NVvrRmNEMV0sKmY7RmkdXvdpyGRpNK8WYn7wj060K2sHH7kF+aqTDGL6bu/Y LMdKyDm/rOlXMELlqCDw6S9BGyOSrILqCa6Qaj+JIDQqd+XTCYozyKO2r72GwtljP9v0rio BJqQxcbWVGijs1SKXg3rg== X-UI-Out-Filterresults: notjunk:1;V03:K0:baXzJXeE9Xw=:bznoprZpSslhH7wxEo1Xqx EffFqKQy0CsswAQjCpXlBQlfA+iEn9qWSI1xqtOKeY8sQ0OyiayAiEJTDT11EPjSiy+tV7MQg SBLKWMdW3FmKRzaz/ETlbQWiZO0wFa7hOEF4RHL5dkMUxagA2wNcJ2HqH3Tuoag8PFTOQAKP4 GnBZBf0LPv2I0wTkjgiIkSL5UE56m63I3QMPqAkVR1fgqJmAguaWpaZP7aN9B8FNOXusNDZ8J ywZK5CFFhzpFSsW91jZDmUdGtxVjEtHChQJP2PSX6kzWogdXCFwwD4XTatXPZNwHBYpGALsRG ZZsLWEepnnMhXSfgu5cjxmjL4qht3MO5pgGmuDRrbPdKM0iMJDR+LnHEsb6jnfMZ280C87tp9 yvMDNxbaeQ4Eira8cz19pq/wIpNhSkiJA9QaGgbX27OxdAZlmB9Nj4UuOUM2ALWraxV2qMdxk QrpAW2b2rXWkExAcdQ+0oImL2LTPcRg/JsXgEwHfH9y5RaAvS/1YAqnEouvxH6RkJcU9gFMKA Jn4xFLwwU9ZmFs7YxHRP+dMA4eNVDRikPyJr8RnewA1Ld699n0JlezFus0v4roYa4VtsxiWfE RyUc+8hx4t8lLMBQDEOW8II6TAXCY60pgXACRYBPHwjZeNz7zw25Ym0Ja9rMSANPMpHeSIj0/ WJYhEhju8DgFZbMpKlw0jf7C70vlnS+TnQkRTxcncnfBX28mul360DnQ0z1L0Q4t3gSo= 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.10; 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 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: , Cc: Peter Maydell , Richard Henderson , Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1641932030400100001 Content-Type: text/plain; charset="utf-8" From: Richard Henderson Use the new function instead of setting up a target_siginfo_t and calling queue_signal. Fill in the missing PC for SIGTRAP. The fault address for POWERPC_EXCP_ISI is nip exactly, not nip - 4. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-Id: <20220107213243.212806-20-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/ppc/cpu_loop.c | 136 ++++++++------------------------------ 1 file changed, 28 insertions(+), 108 deletions(-) diff --git a/linux-user/ppc/cpu_loop.c b/linux-user/ppc/cpu_loop.c index 30c82f23540a..46e6ffd6d300 100644 --- a/linux-user/ppc/cpu_loop.c +++ b/linux-user/ppc/cpu_loop.c @@ -76,8 +76,7 @@ int ppc_dcr_write (ppc_dcr_t *dcr_env, int dcrn, uint32_t= val) void cpu_loop(CPUPPCState *env) { CPUState *cs =3D env_cpu(env); - target_siginfo_t info; - int trapnr; + int trapnr, si_signo, si_code; target_ulong ret; =20 for(;;) { @@ -102,61 +101,10 @@ void cpu_loop(CPUPPCState *env) "Aborting\n"); break; case POWERPC_EXCP_DSI: /* Data storage exception = */ - /* XXX: check this. Seems bugged */ - switch (env->error_code & 0xFF000000) { - case 0x40000000: - case 0x42000000: - info.si_signo =3D TARGET_SIGSEGV; - info.si_errno =3D 0; - info.si_code =3D TARGET_SEGV_MAPERR; - break; - case 0x04000000: - info.si_signo =3D TARGET_SIGILL; - info.si_errno =3D 0; - info.si_code =3D TARGET_ILL_ILLADR; - break; - case 0x08000000: - info.si_signo =3D TARGET_SIGSEGV; - info.si_errno =3D 0; - info.si_code =3D TARGET_SEGV_ACCERR; - break; - default: - /* Let's send a regular segfault... */ - EXCP_DUMP(env, "Invalid segfault errno (%02x)\n", - env->error_code); - info.si_signo =3D TARGET_SIGSEGV; - info.si_errno =3D 0; - info.si_code =3D TARGET_SEGV_MAPERR; - break; - } - info._sifields._sigfault._addr =3D env->spr[SPR_DAR]; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); - break; case POWERPC_EXCP_ISI: /* Instruction storage exception = */ - /* XXX: check this */ - switch (env->error_code & 0xFF000000) { - case 0x40000000: - info.si_signo =3D TARGET_SIGSEGV; - info.si_errno =3D 0; - info.si_code =3D TARGET_SEGV_MAPERR; - break; - case 0x10000000: - case 0x08000000: - info.si_signo =3D TARGET_SIGSEGV; - info.si_errno =3D 0; - info.si_code =3D TARGET_SEGV_ACCERR; - break; - default: - /* Let's send a regular segfault... */ - EXCP_DUMP(env, "Invalid segfault errno (%02x)\n", - env->error_code); - info.si_signo =3D TARGET_SIGSEGV; - info.si_errno =3D 0; - info.si_code =3D TARGET_SEGV_MAPERR; - break; - } - info._sifields._sigfault._addr =3D env->nip - 4; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); + /* FIXME: handle maperr in ppc_cpu_record_sigsegv. */ + force_sig_fault(TARGET_SIGSEGV, TARGET_SEGV_MAPERR, + env->spr[SPR_DAR]); break; case POWERPC_EXCP_EXTERNAL: /* External input = */ cpu_abort(cs, "External interrupt while in user mode. " @@ -167,24 +115,23 @@ void cpu_loop(CPUPPCState *env) /* XXX: check this */ switch (env->error_code & ~0xF) { case POWERPC_EXCP_FP: - info.si_signo =3D TARGET_SIGFPE; - info.si_errno =3D 0; + si_signo =3D TARGET_SIGFPE; switch (env->error_code & 0xF) { case POWERPC_EXCP_FP_OX: - info.si_code =3D TARGET_FPE_FLTOVF; + si_code =3D TARGET_FPE_FLTOVF; break; case POWERPC_EXCP_FP_UX: - info.si_code =3D TARGET_FPE_FLTUND; + si_code =3D TARGET_FPE_FLTUND; break; case POWERPC_EXCP_FP_ZX: case POWERPC_EXCP_FP_VXZDZ: - info.si_code =3D TARGET_FPE_FLTDIV; + si_code =3D TARGET_FPE_FLTDIV; break; case POWERPC_EXCP_FP_XX: - info.si_code =3D TARGET_FPE_FLTRES; + si_code =3D TARGET_FPE_FLTRES; break; case POWERPC_EXCP_FP_VXSOFT: - info.si_code =3D TARGET_FPE_FLTINV; + si_code =3D TARGET_FPE_FLTINV; break; case POWERPC_EXCP_FP_VXSNAN: case POWERPC_EXCP_FP_VXISI: @@ -193,51 +140,50 @@ void cpu_loop(CPUPPCState *env) case POWERPC_EXCP_FP_VXVC: case POWERPC_EXCP_FP_VXSQRT: case POWERPC_EXCP_FP_VXCVI: - info.si_code =3D TARGET_FPE_FLTSUB; + si_code =3D TARGET_FPE_FLTSUB; break; default: EXCP_DUMP(env, "Unknown floating point exception (%02x= )\n", env->error_code); + si_code =3D 0; break; } break; case POWERPC_EXCP_INVAL: - info.si_signo =3D TARGET_SIGILL; - info.si_errno =3D 0; + si_signo =3D TARGET_SIGILL; switch (env->error_code & 0xF) { case POWERPC_EXCP_INVAL_INVAL: - info.si_code =3D TARGET_ILL_ILLOPC; + si_code =3D TARGET_ILL_ILLOPC; break; case POWERPC_EXCP_INVAL_LSWX: - info.si_code =3D TARGET_ILL_ILLOPN; + si_code =3D TARGET_ILL_ILLOPN; break; case POWERPC_EXCP_INVAL_SPR: - info.si_code =3D TARGET_ILL_PRVREG; + si_code =3D TARGET_ILL_PRVREG; break; case POWERPC_EXCP_INVAL_FP: - info.si_code =3D TARGET_ILL_COPROC; + si_code =3D TARGET_ILL_COPROC; break; default: EXCP_DUMP(env, "Unknown invalid operation (%02x)\n", env->error_code & 0xF); - info.si_code =3D TARGET_ILL_ILLADR; + si_code =3D TARGET_ILL_ILLADR; break; } break; case POWERPC_EXCP_PRIV: - info.si_signo =3D TARGET_SIGILL; - info.si_errno =3D 0; + si_signo =3D TARGET_SIGILL; switch (env->error_code & 0xF) { case POWERPC_EXCP_PRIV_OPC: - info.si_code =3D TARGET_ILL_PRVOPC; + si_code =3D TARGET_ILL_PRVOPC; break; case POWERPC_EXCP_PRIV_REG: - info.si_code =3D TARGET_ILL_PRVREG; + si_code =3D TARGET_ILL_PRVREG; break; default: EXCP_DUMP(env, "Unknown privilege violation (%02x)\n", env->error_code & 0xF); - info.si_code =3D TARGET_ILL_PRVOPC; + si_code =3D TARGET_ILL_PRVOPC; break; } break; @@ -250,28 +196,19 @@ void cpu_loop(CPUPPCState *env) env->error_code); break; } - info._sifields._sigfault._addr =3D env->nip; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); + force_sig_fault(si_signo, si_code, env->nip); break; case POWERPC_EXCP_FPU: /* Floating-point unavailable exceptio= n */ - info.si_signo =3D TARGET_SIGILL; - info.si_errno =3D 0; - info.si_code =3D TARGET_ILL_COPROC; - info._sifields._sigfault._addr =3D env->nip; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); + case POWERPC_EXCP_APU: /* Auxiliary processor unavailable = */ + case POWERPC_EXCP_SPEU: /* SPE/embedded floating-point unavail= . */ + case POWERPC_EXCP_VPU: /* Vector unavailable exception = */ + force_sig_fault(TARGET_SIGILL, TARGET_ILL_COPROC, env->nip); break; case POWERPC_EXCP_SYSCALL: /* System call exception = */ case POWERPC_EXCP_SYSCALL_VECTORED: cpu_abort(cs, "Syscall exception while in user mode. " "Aborting\n"); break; - case POWERPC_EXCP_APU: /* Auxiliary processor unavailable = */ - info.si_signo =3D TARGET_SIGILL; - info.si_errno =3D 0; - info.si_code =3D TARGET_ILL_COPROC; - info._sifields._sigfault._addr =3D env->nip; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); - break; case POWERPC_EXCP_DECR: /* Decrementer exception = */ cpu_abort(cs, "Decrementer interrupt while in user mode. " "Aborting\n"); @@ -292,13 +229,6 @@ void cpu_loop(CPUPPCState *env) cpu_abort(cs, "Instruction TLB exception while in user mode. " "Aborting\n"); break; - case POWERPC_EXCP_SPEU: /* SPE/embedded floating-point unavail= . */ - info.si_signo =3D TARGET_SIGILL; - info.si_errno =3D 0; - info.si_code =3D TARGET_ILL_COPROC; - info._sifields._sigfault._addr =3D env->nip; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); - break; case POWERPC_EXCP_EFPDI: /* Embedded floating-point data IRQ = */ cpu_abort(cs, "Embedded floating-point data IRQ not handled\n"= ); break; @@ -355,13 +285,6 @@ void cpu_loop(CPUPPCState *env) cpu_abort(cs, "Hypervisor instruction segment exception " "while in user mode. Aborting\n"); break; - case POWERPC_EXCP_VPU: /* Vector unavailable exception = */ - info.si_signo =3D TARGET_SIGILL; - info.si_errno =3D 0; - info.si_code =3D TARGET_ILL_COPROC; - info._sifields._sigfault._addr =3D env->nip; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); - break; case POWERPC_EXCP_PIT: /* Programmable interval timer IRQ = */ cpu_abort(cs, "Programmable interval timer interrupt " "while in user mode. Aborting\n"); @@ -444,10 +367,7 @@ void cpu_loop(CPUPPCState *env) env->gpr[3] =3D ret; break; case EXCP_DEBUG: - info.si_signo =3D TARGET_SIGTRAP; - info.si_errno =3D 0; - info.si_code =3D TARGET_TRAP_BRKPT; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); + force_sig_fault(TARGET_SIGTRAP, TARGET_TRAP_BRKPT, env->nip); break; case EXCP_INTERRUPT: /* just indicate that signals should be handled asap */ --=20 2.33.1 From nobody Thu May 2 06:56:47 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 164193177980126.614271679102103; Tue, 11 Jan 2022 12:09:39 -0800 (PST) Received: from localhost ([::1]:56916 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NSc-0001vP-L6 for importer@patchew.org; Tue, 11 Jan 2022 15:09:38 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44596) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCZ-0007x1-EY for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:53:03 -0500 Received: from mout.kundenserver.de ([217.72.192.74]:35023) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCX-0008Gp-4K for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:53:02 -0500 Received: from quad ([82.142.23.158]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id 1Macay-1mWOoq44de-00c7Vc; Tue, 11 Jan 2022 20:52:59 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 20/30] linux-user/riscv: Use force_sig_fault Date: Tue, 11 Jan 2022 20:52:37 +0100 Message-Id: <20220111195247.1737641-21-laurent@vivier.eu> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220111195247.1737641-1-laurent@vivier.eu> References: <20220111195247.1737641-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:fGQXr8FBrgCLpPRXMphAnIPCZ9lNj3vti3e14NtiMnVE1qgUlxn zN4I9q9iKllEvyMKrEdZcPaAkbjX1cklenHzZwhUpEGf5K0dX1hoz80QDW0KBw9H/Vi8CmR wfqVokIj1PTdn5/ji1G/DNiLCil5B7tsZM0MQlRWQ7UfHI2s0PBYgYq7a55bZeujdn5gsbj /vjE/hrpFLRJgiHDAweQA== X-UI-Out-Filterresults: notjunk:1;V03:K0:TTtKnOJ0hSY=:/CBAdi/54DYDMjwU6eRMl6 xQG/iKL9RSKOVcQW4Vo51NglaaSaiOafz+F6FcGUiLDX1dS6YsSoPHTVYkKG0IA8cs23SgWKA hu7OjXKSElDEBKZ4WfZBHRqwRjNLg221jmW26IKvNAm/I7RKOKmiRcvb1CXfo/3OKBE6qeGJj Xf4DU75wHl/JzOEMqW+VNwBOsXEH4aGDk8aInW+bIJtkA9UPPxPGPXyUsPral+XdG0vfWNQoV JV1etuoUQixW4zJGN+mfiSudCeDkCGA4QHPSevDH//OVBzxKakkYlSM9Rfm95xl7AsKdis/WN P86yUbolNemXP1WlzmvRxDdgP9uqoIrlLOAlWxg2JI33HUhhGrNO7WGS53wslBOuoeNDuBA9A iWvoTJbw3AaYh8EZ/xr/x1pCG8JouEB30fg/s4CQSfjZQ+mGWZc/dagCPIIGFvW5dYoL85tOO End9A5MGY6gPNndbEWLn4pP6v4ZVoCH40xbvPJPn1MZucHLxPd0wYp6jqKW7s9TX/gtt+8TyG IOeqbSseqWXHQ2ttO9X+xJRnqjKUQ071ijdoUkmVf/Tw5vQdNWKktBplgGLhtvKSQM7M9mj8s ISIotWuttYn/owtufstl6lKbgUNMIAstTPBwFuoNjIPqMKwB2yJmuekrPVqv5DkhBUyZy18x3 aoDU7FyZzRy+KIMUheObeI9SySoymMeJ/pRLBH/IYKnJg7pUWTUDNBanXyj1xAT1YC9E= 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, SPF_HELO_NONE=0.001, SPF_NONE=0.001 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: , Cc: Peter Maydell , Richard Henderson , Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1641931781356100001 Content-Type: text/plain; charset="utf-8" From: Richard Henderson Use the new function instead of setting up a target_siginfo_t and calling queue_signal. Fix missing PC from EXCP_DEBUG by merging the case with EXCP_BREAKPOINT. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-Id: <20220107213243.212806-21-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/riscv/cpu_loop.c | 31 +++++-------------------------- 1 file changed, 5 insertions(+), 26 deletions(-) diff --git a/linux-user/riscv/cpu_loop.c b/linux-user/riscv/cpu_loop.c index 0cd8985cb854..26d446f32379 100644 --- a/linux-user/riscv/cpu_loop.c +++ b/linux-user/riscv/cpu_loop.c @@ -30,8 +30,7 @@ void cpu_loop(CPURISCVState *env) { CPUState *cs =3D env_cpu(env); - int trapnr, signum, sigcode; - target_ulong sigaddr; + int trapnr; target_ulong ret; =20 for (;;) { @@ -40,10 +39,6 @@ void cpu_loop(CPURISCVState *env) cpu_exec_end(cs); process_queued_cpu_work(cs); =20 - signum =3D 0; - sigcode =3D 0; - sigaddr =3D 0; - switch (trapnr) { case EXCP_INTERRUPT: /* just indicate that signals should be handled asap */ @@ -79,39 +74,23 @@ void cpu_loop(CPURISCVState *env) } break; case RISCV_EXCP_ILLEGAL_INST: - signum =3D TARGET_SIGILL; - sigcode =3D TARGET_ILL_ILLOPC; + force_sig_fault(TARGET_SIGILL, TARGET_ILL_ILLOPC, env->pc); break; case RISCV_EXCP_BREAKPOINT: - signum =3D TARGET_SIGTRAP; - sigcode =3D TARGET_TRAP_BRKPT; - sigaddr =3D env->pc; + case EXCP_DEBUG: + gdbstep: + force_sig_fault(TARGET_SIGTRAP, TARGET_TRAP_BRKPT, env->pc); break; case RISCV_EXCP_SEMIHOST: env->gpr[xA0] =3D do_common_semihosting(cs); env->pc +=3D 4; break; - case EXCP_DEBUG: - gdbstep: - signum =3D TARGET_SIGTRAP; - sigcode =3D TARGET_TRAP_BRKPT; - break; default: EXCP_DUMP(env, "\nqemu: unhandled CPU exception %#x - aborting= \n", trapnr); exit(EXIT_FAILURE); } =20 - if (signum) { - target_siginfo_t info =3D { - .si_signo =3D signum, - .si_errno =3D 0, - .si_code =3D sigcode, - ._sifields._sigfault._addr =3D sigaddr - }; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); - } - process_pending_signals(env); } } --=20 2.33.1 From nobody Thu May 2 06:56:47 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 1641931497086547.1829709294027; Tue, 11 Jan 2022 12:04:57 -0800 (PST) Received: from localhost ([::1]:47848 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NO3-00049n-NO for importer@patchew.org; Tue, 11 Jan 2022 15:04:55 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44598) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCZ-0007x9-Fh for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:53:03 -0500 Received: from mout.kundenserver.de ([212.227.17.13]:47567) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCX-0008Gv-Fe for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:53:02 -0500 Received: from quad ([82.142.23.158]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MVeDq-1mxNL51qho-00RaBO; Tue, 11 Jan 2022 20:52:59 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 21/30] linux-user/s390x: Use force_sig_fault Date: Tue, 11 Jan 2022 20:52:38 +0100 Message-Id: <20220111195247.1737641-22-laurent@vivier.eu> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220111195247.1737641-1-laurent@vivier.eu> References: <20220111195247.1737641-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:xXYbnggBpHice1j8KQ61ckvVlBlTSwThdP+l0zzZZ/lnurPOnRX QgRHqopYvD13CArWjsI+G+FQccaae9Nd6hEazyoNDOk6HN5yrXIkEXwfTTHQEt4EM2uZ/Lt 7Dp1dq+ORYkM3SXFqn+RmaUtU2EF836AWZ82i+P6Z0EqPK64fZUNH+n9lvz4iPcloxhlz88 KZOQdmLnaFz9fx/sQILgg== X-UI-Out-Filterresults: notjunk:1;V03:K0:dbWlLPKaIoo=:TUl9dF3l5K4OqCky6bi5CJ dI/9tBnLRk5PWkjfOE3pnXTIWbZ9u0hlPJjGXNJZVlZg1W2jW+MqDTDwdJlGJRMAZLhz9aiHa v7oT14s7quIpIqxXXjQbKIHuabNfcExZAhpKroJzMpwk3d75xhgMi3zVsDzueShQhjIe+Obg8 WD11qm1R3INTArTnBukg4xW+HpKbTeOL8Jv/qndI8udJGp3Lnx5aq4vs1GcZI4hub0RwxzAsC r2KjGHjjOrs7mWroa4Uod8kJ/i1uwTRnOUWbxucu2dmmVGi9RYRDZz6KZns9baUAMps7xSLKV 4HuqsRY4gJU2DH4sGp6PqWY4ogv+R37UAE+pkFrHctZvWyhmxi6oT+XnX8Yac0oEF/xcJNr2o OhE28R4z6J72GIN1zk6oVcBhdLLd5iRNtKwIyBzrvLtQA0n43rN7tJkz80uzdj5LwxuiqIqcR h4957eyZ5iuYqIoZD6oIEJViUFj6UUyMxf50c4gflmpljrSa0alihICBZqNQDrr01RTvdOvxu fiqf88K2dO5H0S6EtoYZgQCLapdxZzjPxn5MlNDRjgk2nBQ7kghVml/2v5Zzy4ytvA/XS15wh 3oAKb+OkeBTOmmCOQEt2S0P7mJ2GrWC/PET3Ym6LIkxz+a9PBnURcHntanUX7p2ZD/xdPr7oI 4DO90gwT5uXIFLD8mqToTTuNXyHPbp+k7vnVw3Xur983TWSZ2Qb+gMU43cImuxdelbOQ= 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 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: , Cc: Peter Maydell , Richard Henderson , Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1641931499149100001 Content-Type: text/plain; charset="utf-8" From: Richard Henderson Use the new function instead of setting up a target_siginfo_t and calling queue_signal. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-Id: <20220107213243.212806-22-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/s390x/cpu_loop.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/linux-user/s390x/cpu_loop.c b/linux-user/s390x/cpu_loop.c index ad0c3cd2635d..7901dfe6f518 100644 --- a/linux-user/s390x/cpu_loop.c +++ b/linux-user/s390x/cpu_loop.c @@ -58,7 +58,6 @@ void cpu_loop(CPUS390XState *env) { CPUState *cs =3D env_cpu(env); int trapnr, n, sig; - target_siginfo_t info; target_ulong addr; abi_long ret; =20 @@ -158,11 +157,7 @@ void cpu_loop(CPUS390XState *env) */ env->psw.addr +=3D env->int_pgm_ilen; do_signal: - info.si_signo =3D sig; - info.si_errno =3D 0; - info.si_code =3D n; - info._sifields._sigfault._addr =3D addr; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); + force_sig_fault(sig, n, addr); break; =20 case EXCP_ATOMIC: --=20 2.33.1 From nobody Thu May 2 06:56:47 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 1641932037332129.90588708122004; Tue, 11 Jan 2022 12:13:57 -0800 (PST) Received: from localhost ([::1]:38056 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NWm-0008Qy-9g for importer@patchew.org; Tue, 11 Jan 2022 15:13:56 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44650) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCa-00081o-Lz for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:53:05 -0500 Received: from mout.kundenserver.de ([212.227.17.13]:46071) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCY-0008H4-18 for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:53:04 -0500 Received: from quad ([82.142.23.158]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id 1M1pk6-1n5BL93pUG-002Ej8; Tue, 11 Jan 2022 20:53:00 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 22/30] linux-user/sh4: Use force_sig_fault Date: Tue, 11 Jan 2022 20:52:39 +0100 Message-Id: <20220111195247.1737641-23-laurent@vivier.eu> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220111195247.1737641-1-laurent@vivier.eu> References: <20220111195247.1737641-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:VapM+0y8XOb6nNKwDp4IRXK8ffrLcGsOs5a9dkkVDZTlrZ3M1uI +uCZ2PPAFxow09ls3HBNCos1EBXyacZKFuECQLhTmq+bySamluY5WyQxqpOQ3N5RGQfZJ5H ao5mOku3q/ZRJqsbGhIbhad1vJVp/jlVyGBzp/NyVNCyVwsRgoAriXiscNgBfSmDQMeo2yM FEwheZ5p+fmC2h28MWy5w== X-UI-Out-Filterresults: notjunk:1;V03:K0:LaoEkBNytHg=:pgZLbAVsi95vqRCVTQIp5P Kh2OVK8LiHXjIy98+0kQ3dvDNtGkZrCIw0yycacgcSlCPnZrKUIbFegO2jDLfKVTUT0zsKdgL 6zeJYCNCjNKBRK3x2lCyE49n/S5uQIBMlNS2oT8e2cBJ4Sk54IaD0HCmtHmwbD8z4IhuWd2Ub RPXM8Ew0A53zfR6wN/Q3gxl5qDBa8FV3+axeQfciCDFH02aBT253wb62pJIKnbwKtJ+Nl7jci 3j2fygULvUYuz/KqfhOcGsfKBxTD1ZWwCh5NN3HARaA1qTztJSmVgbHbmioSTldgBOe25actq QntFHldKWHvYyKhoawFEOxDJyXiYNSvMD+2+9CEkw7sqou6L5eJHt8TP8cJi2QPsAv93rsjkG hEDhqtHGyDvYEM3wL7akDXIHxA5Jt3gRHGJfwMP6s3R4fBvfhu40z55WqhS0RJm+KJxesbepR 2+18JGWfdeAYGGxGRNrOn4QxEzCqMdoEaLDx8IAlNTXHLx4mMm8POiOGvl+IVSsqcO7weewKj kVwTzvSFacG8cr+wxLdN/+GlrjuQJUvNo2/3BFc4qV4RbhiMiBvLbAoQK93tmFdADqaJUFSmQ 3VQF4RR4lPxcJJhIW6vAuC6TeUEWFNLGHoWGd1a+Rb+SBLYN8arFJFPSe+rAkNfmlH0qf72iZ QGfkDBUKaSkDCpD7abLjOBVyB13pdnOyxrLsgxTHphIL0usUH5WYbbY8zUd5m930jfA4= 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 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: , Cc: Peter Maydell , Richard Henderson , Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1641932039473100001 Content-Type: text/plain; charset="utf-8" From: Richard Henderson Use the new function instead of setting up a target_siginfo_t and calling queue_signal. Fill in the missing PC for SIGTRAP. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-Id: <20220107213243.212806-23-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/sh4/cpu_loop.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/linux-user/sh4/cpu_loop.c b/linux-user/sh4/cpu_loop.c index 3290f6445c5f..1bd313cb19a2 100644 --- a/linux-user/sh4/cpu_loop.c +++ b/linux-user/sh4/cpu_loop.c @@ -28,7 +28,6 @@ void cpu_loop(CPUSH4State *env) { CPUState *cs =3D env_cpu(env); int trapnr, ret; - target_siginfo_t info; =20 while (1) { bool arch_interrupt =3D true; @@ -60,10 +59,7 @@ void cpu_loop(CPUSH4State *env) /* just indicate that signals should be handled asap */ break; case EXCP_DEBUG: - info.si_signo =3D TARGET_SIGTRAP; - info.si_errno =3D 0; - info.si_code =3D TARGET_TRAP_BRKPT; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); + force_sig_fault(TARGET_SIGTRAP, TARGET_TRAP_BRKPT, env->pc); break; case EXCP_ATOMIC: cpu_exec_step_atomic(cs); --=20 2.33.1 From nobody Thu May 2 06:56:47 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 1641932034124757.1433472276659; Tue, 11 Jan 2022 12:13:54 -0800 (PST) Received: from localhost ([::1]:37780 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NWi-0008FH-Td for importer@patchew.org; Tue, 11 Jan 2022 15:13:52 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44660) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCb-00082I-88 for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:53:05 -0500 Received: from mout.kundenserver.de ([217.72.192.74]:38127) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCZ-0008HD-Fb for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:53:04 -0500 Received: from quad ([82.142.23.158]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MxmBc-1m9FnG1WtK-00zJDs; Tue, 11 Jan 2022 20:53:00 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 23/30] linux-user/sparc: Use force_sig_fault Date: Tue, 11 Jan 2022 20:52:40 +0100 Message-Id: <20220111195247.1737641-24-laurent@vivier.eu> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220111195247.1737641-1-laurent@vivier.eu> References: <20220111195247.1737641-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:ygX5BjSRQiIlCvBEMpI8fe/3afRBof4vum2DYpje31DUOmHiwlK EnPSyl7skrAg38WiVq2BzK0naoMffllYRgOefjMJygpiJZ26wKOzSe8sLHjv4nUUDcVz+qe Dszj6neIBbiwEeVQoeOtrNWU+exi0iVCnvdyUKB64nvFDmnBfSxloOCSMrR+8m5hiDCJXIu 0JIcoROe+ljMO262nzaSg== X-UI-Out-Filterresults: notjunk:1;V03:K0:oDZ88V+z/Dc=:Jbgr/6xVwAklUeG9tGlvCY nG/ukMYVSvJx9Ze2/hXMFamjJfFeaWaSFYDnPn0HzoxqUWjSTcXh+HWlOnAO/5GJXL4m4lul5 /oLxTs8L0424ocA4hAvBCntafgRV2FDau4lWyg2nJkqY7FgG3/Qbu7C+Wi41gE1J1kDchwUyU HE8qnVrDsGz6eh3YveQ68T+/zC1UveiV+eZPYwnZ4fo06//i1wLp4bQgUEOEjWshATPuEWL61 BO5Ggooq5B3j8bBi7AzCq+C5PCjtL5In/n51Z0t01STU52mlaxCgSrhZ/hrw5BlBEdXWnoQZ3 tTz0F/0KnShUn0vuighjG0T9tIZLr5F8IcJ1Y83v9CS9+zc4yPaxbmFrWy6FDvyCm5cZui92x 4X8YBpzv//jqTWbej+0ixbhbbv//arGze8pU0hyK8N+bLZqWTEoCi48bu+j3Z9wn2x6CrQFKv O7kg/y2RDJ4FINADSpXbx+cmY3j42Nj+oPiFShsZBPRSlRATxL/iUGpRkxtt+NxOFMNDXCJCR C+RRpUIpU0tJGKq5TxrApvT9I35A56LawMI73eODuL2Mz4k8p6qYNwe8SvXrWs8lj74ymkq/T qz0UkBdMJHHC4biGClp4hzs6+Oao+8GWxDPEtZ2WcCXKQ/6Mz3EtYSZsO+emFI8Q3DgAhMhqy JzY/wmkmL9c9TMzesrjRuqHawyK272Fndi5ykrxmCyDdCgG7zovBftkB5lzscEbCZHxo= 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, SPF_HELO_NONE=0.001, SPF_NONE=0.001 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: , Cc: Peter Maydell , Richard Henderson , Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1641932034909100001 Content-Type: text/plain; charset="utf-8" From: Richard Henderson Use the new function instead of setting up a target_siginfo_t and calling queue_signal. Fill in the missing PC for SIGTRAP. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-Id: <20220107213243.212806-24-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/sparc/cpu_loop.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/linux-user/sparc/cpu_loop.c b/linux-user/sparc/cpu_loop.c index 8765ab60205c..baf3d9ae011f 100644 --- a/linux-user/sparc/cpu_loop.c +++ b/linux-user/sparc/cpu_loop.c @@ -155,7 +155,6 @@ void cpu_loop (CPUSPARCState *env) CPUState *cs =3D env_cpu(env); int trapnr; abi_long ret; - target_siginfo_t info; =20 while (1) { cpu_exec_start(cs); @@ -241,19 +240,10 @@ void cpu_loop (CPUSPARCState *env) /* just indicate that signals should be handled asap */ break; case TT_ILL_INSN: - { - info.si_signo =3D TARGET_SIGILL; - info.si_errno =3D 0; - info.si_code =3D TARGET_ILL_ILLOPC; - info._sifields._sigfault._addr =3D env->pc; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); - } + force_sig_fault(TARGET_SIGILL, TARGET_ILL_ILLOPC, env->pc); break; case EXCP_DEBUG: - info.si_signo =3D TARGET_SIGTRAP; - info.si_errno =3D 0; - info.si_code =3D TARGET_TRAP_BRKPT; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); + force_sig_fault(TARGET_SIGTRAP, TARGET_TRAP_BRKPT, env->pc); break; case EXCP_ATOMIC: cpu_exec_step_atomic(cs); --=20 2.33.1 From nobody Thu May 2 06:56:47 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 16419317774811004.3733071487262; Tue, 11 Jan 2022 12:09:37 -0800 (PST) Received: from localhost ([::1]:56528 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NSa-0001fd-D8 for importer@patchew.org; Tue, 11 Jan 2022 15:09:36 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44652) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCa-000821-SW for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:53:05 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:49619) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCZ-0008HL-57 for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:53:04 -0500 Received: from quad ([82.142.23.158]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MIMXC-1nAezY3XS0-00EKcM; Tue, 11 Jan 2022 20:53:01 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 24/30] linux-user/xtensa: Use force_sig_fault Date: Tue, 11 Jan 2022 20:52:41 +0100 Message-Id: <20220111195247.1737641-25-laurent@vivier.eu> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220111195247.1737641-1-laurent@vivier.eu> References: <20220111195247.1737641-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:eYEeRwehWZjj3fsdJIxfyy9hMcsfYP9gy/rl2O+b8nLVIY3KZ8K jSNfbwIkbV2tiou3iincqt7ZIZO1al17udYJeUsJ5ma5dgh/o1wTAHIZCDoD/aDcOX4pA1v 1Zi8kQz+sHrnagWbf5Kpx0hl5W/QlbN+nh8cT6q/fZ3fm+TNtim67PIUTI8YbV6hL15hsZ4 2yM5Db40tcJRCSl/Oq+Bg== X-UI-Out-Filterresults: notjunk:1;V03:K0:Ezd9my7NH+w=:sgqTWBo2c4hxbEhfTY/24Z cYGeUYAgfIWyeqdqwGqjmvDzxEoD6r14JyByU6vfc5rkZblYSZj+IvucMhiyLE/GGhF0IVwQj 4vURmasz0KYguG1ZLi+/2iUxnkrKfU3fyLfTOrn+ZybeBG4826DP4e5BMlcn8zsZ8dAVUHyta 1LWgIv364DAh8gmi5Vjxx9U/XEWbug965eViPguBZhW0f/ZnfGQJn/3LNV5PZYk3lEb/HCnok uYH7621wm3xTUysQnsu/hTph3KqhzsOVg1H6yW3wx16WeiCfdZdlsU2Cf/BgTaEzqgi2QmqDw wJlHAQGdetRfC/FHzG0L8BueV3AaOrOjLeO3OkguNUeLm0BB/3UDZZ8RmtfpXxDuzFRD8cBJt ah1mnk9wcBdfi9RwWCyc53gPmA4hUVpna4Xc4Md8GGHPCVgFRnEkexHsb+pwTAz5CV9fGbdRK 2hfLsdlcnpkuqMlIN/FxgIDIIdJYuhyTrWOaJ3k5aBubsoN09bswJ9aqUMurUn0AETYondxUF J1Dai5YtNboosgTrVOFq4jwvUq11m3HR0xggh2pcme9jtOpncOFRF/QpiygAx3kPu246ucq/X /FyxmkN/PSY+qm3/3XLQCxtHiNNW/Gv6AeeGoFrqyhzwL5ygGMPLyPM54nBYj3Rz42TxLOJls hj9mdhq+KKMfcuJknszjg8cd10XFn0BfUhOz7iIlrChsSw1e1BwOJlwng7Pkjkn3c16g= 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.10; 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 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: , Cc: Peter Maydell , Richard Henderson , Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1641931778687100001 Content-Type: text/plain; charset="utf-8" From: Richard Henderson Use the new function instead of setting up a target_siginfo_t and calling queue_signal. Fill in the missing PC for SIGTRAP. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-Id: <20220107213243.212806-25-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/xtensa/cpu_loop.c | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/linux-user/xtensa/cpu_loop.c b/linux-user/xtensa/cpu_loop.c index 6bc6d6dee6c4..d51ce053926d 100644 --- a/linux-user/xtensa/cpu_loop.c +++ b/linux-user/xtensa/cpu_loop.c @@ -126,7 +126,6 @@ static void xtensa_underflow12(CPUXtensaState *env) void cpu_loop(CPUXtensaState *env) { CPUState *cs =3D env_cpu(env); - target_siginfo_t info; abi_ulong ret; int trapnr; =20 @@ -163,14 +162,12 @@ void cpu_loop(CPUXtensaState *env) case EXC_USER: switch (env->sregs[EXCCAUSE]) { case ILLEGAL_INSTRUCTION_CAUSE: + force_sig_fault(TARGET_SIGILL, TARGET_ILL_ILLOPC, + env->sregs[EPC1]); + break; case PRIVILEGED_CAUSE: - info.si_signo =3D TARGET_SIGILL; - info.si_errno =3D 0; - info.si_code =3D - env->sregs[EXCCAUSE] =3D=3D ILLEGAL_INSTRUCTION_CAUSE ? - TARGET_ILL_ILLOPC : TARGET_ILL_PRVOPC; - info._sifields._sigfault._addr =3D env->sregs[EPC1]; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); + force_sig_fault(TARGET_SIGILL, TARGET_ILL_PRVOPC, + env->sregs[EPC1]); break; =20 case SYSCALL_CAUSE: @@ -219,11 +216,8 @@ void cpu_loop(CPUXtensaState *env) break; =20 case INTEGER_DIVIDE_BY_ZERO_CAUSE: - info.si_signo =3D TARGET_SIGFPE; - info.si_errno =3D 0; - info.si_code =3D TARGET_FPE_INTDIV; - info._sifields._sigfault._addr =3D env->sregs[EPC1]; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); + force_sig_fault(TARGET_SIGFPE, TARGET_FPE_INTDIV, + env->sregs[EPC1]); break; =20 default: @@ -232,10 +226,8 @@ void cpu_loop(CPUXtensaState *env) } break; case EXCP_DEBUG: - info.si_signo =3D TARGET_SIGTRAP; - info.si_errno =3D 0; - info.si_code =3D TARGET_TRAP_BRKPT; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); + force_sig_fault(TARGET_SIGTRAP, TARGET_TRAP_BRKPT, + env->sregs[EPC1]); break; case EXC_DEBUG: default: --=20 2.33.1 From nobody Thu May 2 06:56:47 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 1641932462375685.2887736849923; Tue, 11 Jan 2022 12:21:02 -0800 (PST) Received: from localhost ([::1]:54936 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7Ndd-000393-A8 for importer@patchew.org; Tue, 11 Jan 2022 15:21:01 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44726) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCd-00086U-Im for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:53:07 -0500 Received: from mout.kundenserver.de ([212.227.17.24]:40921) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCb-0008I0-6o for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:53:07 -0500 Received: from quad ([82.142.23.158]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MAwPf-1nDfng1Nmr-00BH9T; Tue, 11 Jan 2022 20:53:01 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 25/30] linux-user/arm: Move target_oabi_flock64 out of target_structs.h Date: Tue, 11 Jan 2022 20:52:42 +0100 Message-Id: <20220111195247.1737641-26-laurent@vivier.eu> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220111195247.1737641-1-laurent@vivier.eu> References: <20220111195247.1737641-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:8ADUk6klj619kaP88H9mi5v3mUrFA5nPGnOoX+DGoCqHBWYln9G hOwMCzjWZAyTteX0ysiY/djJCCOOXTpukwbQpjUHCzRBGZjqM9pjCT+H5hjmjlVk1jPZh46 vkUQTNz9Y+tAvHVOPG/pSIInnhT7jb8N0UuoeHR0TmUSUlscCkInDp40uU/cJaILCqEtHkO vjOTYqp8hRLORioD+xcCQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:LFJMGnzhBMY=:qtJ7ZcqTEYFtkOVuU/O3Mz OmhrQDEDsUwwuiiR/FcCP8L4daCE0r5QwYYmEE003TMoWfnkkq4ttJbHEHHkEWTifNLQ48crx qyH8KuFabN36NVjwn0SRo2jfiVci2hkcfKRHoDdFQD6sUs5MutdIeEcX911bNMHGAUhZ6FHRd vJJ0QOIhox+8ZqJeIiZd51GgHu/VvTyB2XonrvaY3s2oTDL2RvwzLBOEmapw+15JeE2rIO5+a zghkCxUB0wLh0TcU+FJw4ZqUxg5ybehMxhZmbS7Fq3BFyA7uDhvujEmLyvaVRI9jMqXDV4alb RCtrDcMdQabG7cLR01cmtVQcUWIEf+bLxcyEXu+n5P9XdgWp5GAa9Jaib3Bo574YAQk24rEYb 6E77579DHWPbZw5sxWVg3gaatXVng324uIkBHPUeQ2oNzJAdPRqwhMqjPtEGmNoJAGSXTIrRl TaI73VZdqed+wFZt67+ism7QOlFCjoiY4VrLbQzQAC82d+aerGtdBLJSinIi7c8hMOXtMy++a Fg8fLYdPBGMnzhqCzkOFvXxh/86qkLe7E96SzVjhZzALXvMDesxlHlnpxmg9w8Xe5l/XKtHoi EQ3Sg47Iyyp62MCb/LIRZEM4C3Czk69St0K5eAQRQqro9g3UmCmz5gseQVJiBVEKHcL2VMA9+ Q/GsqwVi2GwUaAAtlJVVTA3p02QjOSrbvLDiUmHQYbu1/SkpDwBc7OhAIF1ZpRKAIhOM= 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 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: , Cc: Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1641932463166100001 From: Richard Henderson Place it next to copy_from/to_user_oabi_flock64, the only users, inside the existing target-specific ifdef. This leaves only generic ipc structs in target_structs.h. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Laurent Vivier Message-Id: <20220107042600.149852-2-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/arm/target_structs.h | 8 -------- linux-user/syscall.c | 8 ++++++++ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/linux-user/arm/target_structs.h b/linux-user/arm/target_struct= s.h index 339b070bf1a5..25bf8dd3a5c9 100644 --- a/linux-user/arm/target_structs.h +++ b/linux-user/arm/target_structs.h @@ -48,12 +48,4 @@ struct target_shmid_ds { abi_ulong __unused4; abi_ulong __unused5; }; - -struct target_oabi_flock64 { - abi_short l_type; - abi_short l_whence; - abi_llong l_start; - abi_llong l_len; - abi_int l_pid; -} QEMU_PACKED; #endif diff --git a/linux-user/syscall.c b/linux-user/syscall.c index ce9d64896cb8..ca6e0b8fb0a1 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -6927,6 +6927,14 @@ typedef abi_long from_flock64_fn(struct flock64 *fl,= abi_ulong target_addr); typedef abi_long to_flock64_fn(abi_ulong target_addr, const struct flock64= *fl); =20 #if defined(TARGET_ARM) && TARGET_ABI_BITS =3D=3D 32 +struct target_oabi_flock64 { + abi_short l_type; + abi_short l_whence; + abi_llong l_start; + abi_llong l_len; + abi_int l_pid; +} QEMU_PACKED; + static inline abi_long copy_from_user_oabi_flock64(struct flock64 *fl, abi_ulong target_flock_= addr) { --=20 2.33.1 From nobody Thu May 2 06:56:47 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 1641932453596489.0242688564658; Tue, 11 Jan 2022 12:20:53 -0800 (PST) Received: from localhost ([::1]:54156 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NdU-0002bW-GX for importer@patchew.org; Tue, 11 Jan 2022 15:20:52 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44776) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCh-0008HX-UR for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:53:11 -0500 Received: from mout.kundenserver.de ([217.72.192.75]:36691) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCe-0008In-1w for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:53:11 -0500 Received: from quad ([82.142.23.158]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MTRIg-1mvBTd3J0u-00Tm2U; Tue, 11 Jan 2022 20:53:02 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 26/30] linux-user: Move target_struct.h generic definitions to generic/ Date: Tue, 11 Jan 2022 20:52:43 +0100 Message-Id: <20220111195247.1737641-27-laurent@vivier.eu> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220111195247.1737641-1-laurent@vivier.eu> References: <20220111195247.1737641-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:KqkExzW+8Gr1H3ilsKULjYfvTe2UhBavMAhh5ic09kicGw17/kR a0D80t92mjybeMSnfobnB68lkr/T9+XSLHhuTAKqIoU3ijB/ODeYLVBrmWMW9NCfnafPEOa wDLkjr37I9lmNm1smX01vd5cx4DhKQqbXVA7KYAiiW3cK5yAfoWX0yeQ9NNljHbGIIV7KQi dSr0+hSpr3aqT3nZoKE0w== X-UI-Out-Filterresults: notjunk:1;V03:K0:+ZerTuXHPwg=:+yvlO5u9E5ti0l3IfTjrpN lpUaGt07iULR8QXKB3rY/mNUb9vy3xQvu/0lJUv7wjF8hhLZtcjNPEqkFAs8oVNickTvAHLxh ZDdSZlJWXfzt8LGf82GWUkcyza23VCpBitMy1wteOkJ/RPmUSF5cSBKbs6AeVc03cpS2S/qlx Sn1dgDSIA12GTe+1De/Yn2vts6PUbeICmnNsYZgQ4/BDrQPuKTqgY2P53BQIpNl3eF3pH6hnA tMBhJysjkz0QsJepUdDZPFvqutKYefNsuhj8PHCRakt80XJZELjyNmjuHDPl3//u+llNaEPzt 6W08VNGn9QVsBxwACWuTybIordJka4HjZ8sbAvJzOl7lcoMk2vcv9bNxGYwSHb0XQJlmX39xt Njaxn3DvBvKnbK9m+ub61phkEbLRQcrD+xUP8IOon1qNwbTrq14Y8+0NSl85D/+srs9ACgJN5 edNGIBQVm7wWZLvEYglzP/E+VLZU+2vNBZ5sCWk3JPBdaNIxwUvy3Z/EYf5CHGchTSoQbtrog caIOSutb2QwJA0aIghYSEa0QPkKUuIJypLQQMEStvPp5G9yt9EWQEElxMuaHxLN/VMzCcQQdf 85hB9McXpovNHsSzl5iOwKk01Hb1sTdRc3OoJS1k8HGLa23escPIJgEOBsKSw/lNedkuSyJsp Q1MuSIZiWRcLaqw4Idnc0gcZY+AQ+2TBm8tSVSHn6qoZyfjaP8Jr+M+JgAT5beECYopg= 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.75; 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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 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: , Cc: Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1641932455801100001 From: Richard Henderson Most targets share the same generic ipc structure definitions. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Laurent Vivier Message-Id: <20220107042600.149852-3-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/aarch64/target_structs.h | 59 +------------------------- linux-user/arm/target_structs.h | 52 +---------------------- linux-user/cris/target_structs.h | 59 +------------------------- linux-user/generic/target_structs.h | 58 +++++++++++++++++++++++++ linux-user/hexagon/target_structs.h | 55 +----------------------- linux-user/i386/target_structs.h | 59 +------------------------- linux-user/m68k/target_structs.h | 59 +------------------------- linux-user/microblaze/target_structs.h | 59 +------------------------- linux-user/nios2/target_structs.h | 59 +------------------------- linux-user/openrisc/target_structs.h | 59 +------------------------- linux-user/riscv/target_structs.h | 47 +------------------- linux-user/sh4/target_structs.h | 59 +------------------------- linux-user/x86_64/target_structs.h | 36 +--------------- 13 files changed, 70 insertions(+), 650 deletions(-) create mode 100644 linux-user/generic/target_structs.h diff --git a/linux-user/aarch64/target_structs.h b/linux-user/aarch64/targe= t_structs.h index 7c748344cabc..3a06f373c35a 100644 --- a/linux-user/aarch64/target_structs.h +++ b/linux-user/aarch64/target_structs.h @@ -1,58 +1 @@ -/* - * ARM AArch64 specific structures for linux-user - * - * Copyright (c) 2013 Fabrice Bellard - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, see . - */ -#ifndef AARCH64_TARGET_STRUCTS_H -#define AARCH64_TARGET_STRUCTS_H - -struct target_ipc_perm { - abi_int __key; /* Key. */ - abi_uint uid; /* Owner's user ID. */ - abi_uint gid; /* Owner's group ID. */ - abi_uint cuid; /* Creator's user ID. */ - abi_uint cgid; /* Creator's group ID. */ - abi_ushort mode; /* Read/write permission. */ - abi_ushort __pad1; - abi_ushort __seq; /* Sequence number. */ - abi_ushort __pad2; - abi_ulong __unused1; - abi_ulong __unused2; -}; - -struct target_shmid_ds { - struct target_ipc_perm shm_perm; /* operation permission struct */ - abi_long shm_segsz; /* size of segment in bytes */ - abi_ulong shm_atime; /* time of last shmat() */ -#if TARGET_ABI_BITS =3D=3D 32 - abi_ulong __unused1; -#endif - abi_ulong shm_dtime; /* time of last shmdt() */ -#if TARGET_ABI_BITS =3D=3D 32 - abi_ulong __unused2; -#endif - abi_ulong shm_ctime; /* time of last change by shmctl()= */ -#if TARGET_ABI_BITS =3D=3D 32 - abi_ulong __unused3; -#endif - abi_int shm_cpid; /* pid of creator */ - abi_int shm_lpid; /* pid of last shmop */ - abi_ulong shm_nattch; /* number of current attaches */ - abi_ulong __unused4; - abi_ulong __unused5; -}; - -#endif +#include "../generic/target_structs.h" diff --git a/linux-user/arm/target_structs.h b/linux-user/arm/target_struct= s.h index 25bf8dd3a5c9..3a06f373c35a 100644 --- a/linux-user/arm/target_structs.h +++ b/linux-user/arm/target_structs.h @@ -1,51 +1 @@ -/* - * ARM specific structures for linux-user - * - * Copyright (c) 2013 Fabrice Bellard - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, see . - */ -#ifndef ARM_TARGET_STRUCTS_H -#define ARM_TARGET_STRUCTS_H - -struct target_ipc_perm { - abi_int __key; /* Key. */ - abi_uint uid; /* Owner's user ID. */ - abi_uint gid; /* Owner's group ID. */ - abi_uint cuid; /* Creator's user ID. */ - abi_uint cgid; /* Creator's group ID. */ - abi_ushort mode; /* Read/write permission. */ - abi_ushort __pad1; - abi_ushort __seq; /* Sequence number. */ - abi_ushort __pad2; - abi_ulong __unused1; - abi_ulong __unused2; -}; - -struct target_shmid_ds { - struct target_ipc_perm shm_perm; /* operation permission struct */ - abi_long shm_segsz; /* size of segment in bytes */ - abi_ulong shm_atime; /* time of last shmat() */ - abi_ulong __unused1; - abi_ulong shm_dtime; /* time of last shmdt() */ - abi_ulong __unused2; - abi_ulong shm_ctime; /* time of last change by shmctl()= */ - abi_ulong __unused3; - abi_int shm_cpid; /* pid of creator */ - abi_int shm_lpid; /* pid of last shmop */ - abi_ulong shm_nattch; /* number of current attaches */ - abi_ulong __unused4; - abi_ulong __unused5; -}; -#endif +#include "../generic/target_structs.h" diff --git a/linux-user/cris/target_structs.h b/linux-user/cris/target_stru= cts.h index f949d2331e6e..3a06f373c35a 100644 --- a/linux-user/cris/target_structs.h +++ b/linux-user/cris/target_structs.h @@ -1,58 +1 @@ -/* - * CRIS specific structures for linux-user - * - * Copyright (c) 2013 Fabrice Bellard - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, see . - */ -#ifndef CRIS_TARGET_STRUCTS_H -#define CRIS_TARGET_STRUCTS_H - -struct target_ipc_perm { - abi_int __key; /* Key. */ - abi_uint uid; /* Owner's user ID. */ - abi_uint gid; /* Owner's group ID. */ - abi_uint cuid; /* Creator's user ID. */ - abi_uint cgid; /* Creator's group ID. */ - abi_ushort mode; /* Read/write permission. */ - abi_ushort __pad1; - abi_ushort __seq; /* Sequence number. */ - abi_ushort __pad2; - abi_ulong __unused1; - abi_ulong __unused2; -}; - -struct target_shmid_ds { - struct target_ipc_perm shm_perm; /* operation permission struct */ - abi_long shm_segsz; /* size of segment in bytes */ - abi_ulong shm_atime; /* time of last shmat() */ -#if TARGET_ABI_BITS =3D=3D 32 - abi_ulong __unused1; -#endif - abi_ulong shm_dtime; /* time of last shmdt() */ -#if TARGET_ABI_BITS =3D=3D 32 - abi_ulong __unused2; -#endif - abi_ulong shm_ctime; /* time of last change by shmctl()= */ -#if TARGET_ABI_BITS =3D=3D 32 - abi_ulong __unused3; -#endif - abi_int shm_cpid; /* pid of creator */ - abi_int shm_lpid; /* pid of last shmop */ - abi_ulong shm_nattch; /* number of current attaches */ - abi_ulong __unused4; - abi_ulong __unused5; -}; - -#endif +#include "../generic/target_structs.h" diff --git a/linux-user/generic/target_structs.h b/linux-user/generic/targe= t_structs.h new file mode 100644 index 000000000000..09ff858b6efd --- /dev/null +++ b/linux-user/generic/target_structs.h @@ -0,0 +1,58 @@ +/* + * Generic structures for linux-user + * + * Copyright (c) 2013 Fabrice Bellard + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, see . + */ +#ifndef GENERIC_TARGET_STRUCTS_H +#define GENERIC_TARGET_STRUCTS_H + +struct target_ipc_perm { + abi_int __key; /* Key. */ + abi_uint uid; /* Owner's user ID. */ + abi_uint gid; /* Owner's group ID. */ + abi_uint cuid; /* Creator's user ID. */ + abi_uint cgid; /* Creator's group ID. */ + abi_ushort mode; /* Read/write permission. */ + abi_ushort __pad1; + abi_ushort __seq; /* Sequence number. */ + abi_ushort __pad2; + abi_ulong __unused1; + abi_ulong __unused2; +}; + +struct target_shmid_ds { + struct target_ipc_perm shm_perm; /* operation permission struct */ + abi_long shm_segsz; /* size of segment in bytes */ + abi_ulong shm_atime; /* time of last shmat() */ +#if TARGET_ABI_BITS =3D=3D 32 + abi_ulong __unused1; +#endif + abi_ulong shm_dtime; /* time of last shmdt() */ +#if TARGET_ABI_BITS =3D=3D 32 + abi_ulong __unused2; +#endif + abi_ulong shm_ctime; /* time of last change by shmctl()= */ +#if TARGET_ABI_BITS =3D=3D 32 + abi_ulong __unused3; +#endif + abi_int shm_cpid; /* pid of creator */ + abi_int shm_lpid; /* pid of last shmop */ + abi_ulong shm_nattch; /* number of current attaches */ + abi_ulong __unused4; + abi_ulong __unused5; +}; + +#endif diff --git a/linux-user/hexagon/target_structs.h b/linux-user/hexagon/targe= t_structs.h index c217d9442ae3..3a06f373c35a 100644 --- a/linux-user/hexagon/target_structs.h +++ b/linux-user/hexagon/target_structs.h @@ -1,54 +1 @@ -/* - * Copyright(c) 2019-2021 Qualcomm Innovation Center, Inc. All Rights Res= erved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . - */ - -/* - * Hexagon specific structures for linux-user - */ -#ifndef HEXAGON_TARGET_STRUCTS_H -#define HEXAGON_TARGET_STRUCTS_H - -struct target_ipc_perm { - abi_int __key; /* Key. */ - abi_uint uid; /* Owner's user ID. */ - abi_uint gid; /* Owner's group ID. */ - abi_uint cuid; /* Creator's user ID. */ - abi_uint cgid; /* Creator's group ID. */ - abi_ushort mode; /* Read/write permission. */ - abi_ushort __pad1; - abi_ushort __seq; /* Sequence number. */ - abi_ushort __pad2; - abi_ulong __unused1; - abi_ulong __unused2; -}; - -struct target_shmid_ds { - struct target_ipc_perm shm_perm; /* operation permission struct */ - abi_long shm_segsz; /* size of segment in bytes */ - abi_ulong shm_atime; /* time of last shmat() */ - abi_ulong __unused1; - abi_ulong shm_dtime; /* time of last shmdt() */ - abi_ulong __unused2; - abi_ulong shm_ctime; /* time of last change by shmctl()= */ - abi_ulong __unused3; - abi_int shm_cpid; /* pid of creator */ - abi_int shm_lpid; /* pid of last shmop */ - abi_ulong shm_nattch; /* number of current attaches */ - abi_ulong __unused4; - abi_ulong __unused5; -}; - -#endif +#include "../generic/target_structs.h" diff --git a/linux-user/i386/target_structs.h b/linux-user/i386/target_stru= cts.h index e22847fd203b..3a06f373c35a 100644 --- a/linux-user/i386/target_structs.h +++ b/linux-user/i386/target_structs.h @@ -1,58 +1 @@ -/* - * i386 specific structures for linux-user - * - * Copyright (c) 2013 Fabrice Bellard - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, see . - */ -#ifndef I386_TARGET_STRUCTS_H -#define I386_TARGET_STRUCTS_H - -struct target_ipc_perm { - abi_int __key; /* Key. */ - abi_uint uid; /* Owner's user ID. */ - abi_uint gid; /* Owner's group ID. */ - abi_uint cuid; /* Creator's user ID. */ - abi_uint cgid; /* Creator's group ID. */ - abi_ushort mode; /* Read/write permission. */ - abi_ushort __pad1; - abi_ushort __seq; /* Sequence number. */ - abi_ushort __pad2; - abi_ulong __unused1; - abi_ulong __unused2; -}; - -struct target_shmid_ds { - struct target_ipc_perm shm_perm; /* operation permission struct */ - abi_long shm_segsz; /* size of segment in bytes */ - abi_ulong shm_atime; /* time of last shmat() */ -#if TARGET_ABI_BITS =3D=3D 32 - abi_ulong __unused1; -#endif - abi_ulong shm_dtime; /* time of last shmdt() */ -#if TARGET_ABI_BITS =3D=3D 32 - abi_ulong __unused2; -#endif - abi_ulong shm_ctime; /* time of last change by shmctl()= */ -#if TARGET_ABI_BITS =3D=3D 32 - abi_ulong __unused3; -#endif - abi_int shm_cpid; /* pid of creator */ - abi_int shm_lpid; /* pid of last shmop */ - abi_ulong shm_nattch; /* number of current attaches */ - abi_ulong __unused4; - abi_ulong __unused5; -}; - -#endif +#include "../generic/target_structs.h" diff --git a/linux-user/m68k/target_structs.h b/linux-user/m68k/target_stru= cts.h index e373d481e177..3a06f373c35a 100644 --- a/linux-user/m68k/target_structs.h +++ b/linux-user/m68k/target_structs.h @@ -1,58 +1 @@ -/* - * m68k specific structures for linux-user - * - * Copyright (c) 2013 Fabrice Bellard - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, see . - */ -#ifndef M68K_TARGET_STRUCTS_H -#define M68K_TARGET_STRUCTS_H - -struct target_ipc_perm { - abi_int __key; /* Key. */ - abi_uint uid; /* Owner's user ID. */ - abi_uint gid; /* Owner's group ID. */ - abi_uint cuid; /* Creator's user ID. */ - abi_uint cgid; /* Creator's group ID. */ - abi_ushort mode; /* Read/write permission. */ - abi_ushort __pad1; - abi_ushort __seq; /* Sequence number. */ - abi_ushort __pad2; - abi_ulong __unused1; - abi_ulong __unused2; -}; - -struct target_shmid_ds { - struct target_ipc_perm shm_perm; /* operation permission struct */ - abi_long shm_segsz; /* size of segment in bytes */ - abi_ulong shm_atime; /* time of last shmat() */ -#if TARGET_ABI_BITS =3D=3D 32 - abi_ulong __unused1; -#endif - abi_ulong shm_dtime; /* time of last shmdt() */ -#if TARGET_ABI_BITS =3D=3D 32 - abi_ulong __unused2; -#endif - abi_ulong shm_ctime; /* time of last change by shmctl()= */ -#if TARGET_ABI_BITS =3D=3D 32 - abi_ulong __unused3; -#endif - abi_int shm_cpid; /* pid of creator */ - abi_int shm_lpid; /* pid of last shmop */ - abi_ulong shm_nattch; /* number of current attaches */ - abi_ulong __unused4; - abi_ulong __unused5; -}; - -#endif +#include "../generic/target_structs.h" diff --git a/linux-user/microblaze/target_structs.h b/linux-user/microblaze= /target_structs.h index d08f6a53a8d7..3a06f373c35a 100644 --- a/linux-user/microblaze/target_structs.h +++ b/linux-user/microblaze/target_structs.h @@ -1,58 +1 @@ -/* - * MicroBlaze specific structures for linux-user - * - * Copyright (c) 2013 Fabrice Bellard - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, see . - */ -#ifndef MICROBLAZE_TARGET_STRUCTS_H -#define MICROBLAZE_TARGET_STRUCTS_H - -struct target_ipc_perm { - abi_int __key; /* Key. */ - abi_uint uid; /* Owner's user ID. */ - abi_uint gid; /* Owner's group ID. */ - abi_uint cuid; /* Creator's user ID. */ - abi_uint cgid; /* Creator's group ID. */ - abi_ushort mode; /* Read/write permission. */ - abi_ushort __pad1; - abi_ushort __seq; /* Sequence number. */ - abi_ushort __pad2; - abi_ulong __unused1; - abi_ulong __unused2; -}; - -struct target_shmid_ds { - struct target_ipc_perm shm_perm; /* operation permission struct */ - abi_long shm_segsz; /* size of segment in bytes */ - abi_ulong shm_atime; /* time of last shmat() */ -#if TARGET_ABI_BITS =3D=3D 32 - abi_ulong __unused1; -#endif - abi_ulong shm_dtime; /* time of last shmdt() */ -#if TARGET_ABI_BITS =3D=3D 32 - abi_ulong __unused2; -#endif - abi_ulong shm_ctime; /* time of last change by shmctl()= */ -#if TARGET_ABI_BITS =3D=3D 32 - abi_ulong __unused3; -#endif - abi_int shm_cpid; /* pid of creator */ - abi_int shm_lpid; /* pid of last shmop */ - abi_ulong shm_nattch; /* number of current attaches */ - abi_ulong __unused4; - abi_ulong __unused5; -}; - -#endif +#include "../generic/target_structs.h" diff --git a/linux-user/nios2/target_structs.h b/linux-user/nios2/target_st= ructs.h index daa2886f98d3..3a06f373c35a 100644 --- a/linux-user/nios2/target_structs.h +++ b/linux-user/nios2/target_structs.h @@ -1,58 +1 @@ -/* - * Nios2 specific structures for linux-user - * - * Copyright (c) 2016 Marek Vasut - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, see . - */ -#ifndef NIOS2_TARGET_STRUCTS_H -#define NIOS2_TARGET_STRUCTS_H - -struct target_ipc_perm { - abi_int __key; /* Key. */ - abi_uint uid; /* Owner's user ID. */ - abi_uint gid; /* Owner's group ID. */ - abi_uint cuid; /* Creator's user ID. */ - abi_uint cgid; /* Creator's group ID. */ - abi_ushort mode; /* Read/write permission. */ - abi_ushort __pad1; - abi_ushort __seq; /* Sequence number. */ - abi_ushort __pad2; - abi_ulong __unused1; - abi_ulong __unused2; -}; - -struct target_shmid_ds { - struct target_ipc_perm shm_perm; /* operation permission struct */ - abi_long shm_segsz; /* size of segment in bytes */ - abi_ulong shm_atime; /* time of last shmat() */ -#if TARGET_ABI_BITS =3D=3D 32 - abi_ulong __unused1; -#endif - abi_ulong shm_dtime; /* time of last shmdt() */ -#if TARGET_ABI_BITS =3D=3D 32 - abi_ulong __unused2; -#endif - abi_ulong shm_ctime; /* time of last change by shmctl()= */ -#if TARGET_ABI_BITS =3D=3D 32 - abi_ulong __unused3; -#endif - abi_int shm_cpid; /* pid of creator */ - abi_int shm_lpid; /* pid of last shmop */ - abi_ulong shm_nattch; /* number of current attaches */ - abi_ulong __unused4; - abi_ulong __unused5; -}; - -#endif +#include "../generic/target_structs.h" diff --git a/linux-user/openrisc/target_structs.h b/linux-user/openrisc/tar= get_structs.h index e98e2bc7995a..3a06f373c35a 100644 --- a/linux-user/openrisc/target_structs.h +++ b/linux-user/openrisc/target_structs.h @@ -1,58 +1 @@ -/* - * OpenRISC specific structures for linux-user - * - * Copyright (c) 2013 Fabrice Bellard - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, see . - */ -#ifndef OPENRISC_TARGET_STRUCTS_H -#define OPENRISC_TARGET_STRUCTS_H - -struct target_ipc_perm { - abi_int __key; /* Key. */ - abi_uint uid; /* Owner's user ID. */ - abi_uint gid; /* Owner's group ID. */ - abi_uint cuid; /* Creator's user ID. */ - abi_uint cgid; /* Creator's group ID. */ - abi_ushort mode; /* Read/write permission. */ - abi_ushort __pad1; - abi_ushort __seq; /* Sequence number. */ - abi_ushort __pad2; - abi_ulong __unused1; - abi_ulong __unused2; -}; - -struct target_shmid_ds { - struct target_ipc_perm shm_perm; /* operation permission struct */ - abi_long shm_segsz; /* size of segment in bytes */ - abi_ulong shm_atime; /* time of last shmat() */ -#if TARGET_ABI_BITS =3D=3D 32 - abi_ulong __unused1; -#endif - abi_ulong shm_dtime; /* time of last shmdt() */ -#if TARGET_ABI_BITS =3D=3D 32 - abi_ulong __unused2; -#endif - abi_ulong shm_ctime; /* time of last change by shmctl()= */ -#if TARGET_ABI_BITS =3D=3D 32 - abi_ulong __unused3; -#endif - abi_int shm_cpid; /* pid of creator */ - abi_int shm_lpid; /* pid of last shmop */ - abi_ulong shm_nattch; /* number of current attaches */ - abi_ulong __unused4; - abi_ulong __unused5; -}; - -#endif +#include "../generic/target_structs.h" diff --git a/linux-user/riscv/target_structs.h b/linux-user/riscv/target_st= ructs.h index ea3e5ed17e7e..3a06f373c35a 100644 --- a/linux-user/riscv/target_structs.h +++ b/linux-user/riscv/target_structs.h @@ -1,46 +1 @@ -/* - * RISC-V specific structures for linux-user - * - * This is a copy of ../aarch64/target_structs.h atm. - * - */ -#ifndef RISCV_TARGET_STRUCTS_H -#define RISCV_TARGET_STRUCTS_H - -struct target_ipc_perm { - abi_int __key; /* Key. */ - abi_uint uid; /* Owner's user ID. */ - abi_uint gid; /* Owner's group ID. */ - abi_uint cuid; /* Creator's user ID. */ - abi_uint cgid; /* Creator's group ID. */ - abi_ushort mode; /* Read/write permission. */ - abi_ushort __pad1; - abi_ushort __seq; /* Sequence number. */ - abi_ushort __pad2; - abi_ulong __unused1; - abi_ulong __unused2; -}; - -struct target_shmid_ds { - struct target_ipc_perm shm_perm; /* operation permission struct */ - abi_long shm_segsz; /* size of segment in bytes */ - abi_ulong shm_atime; /* time of last shmat() */ -#if TARGET_ABI_BITS =3D=3D 32 - abi_ulong __unused1; -#endif - abi_ulong shm_dtime; /* time of last shmdt() */ -#if TARGET_ABI_BITS =3D=3D 32 - abi_ulong __unused2; -#endif - abi_ulong shm_ctime; /* time of last change by shmctl()= */ -#if TARGET_ABI_BITS =3D=3D 32 - abi_ulong __unused3; -#endif - abi_int shm_cpid; /* pid of creator */ - abi_int shm_lpid; /* pid of last shmop */ - abi_ulong shm_nattch; /* number of current attaches */ - abi_ulong __unused4; - abi_ulong __unused5; -}; - -#endif +#include "../generic/target_structs.h" diff --git a/linux-user/sh4/target_structs.h b/linux-user/sh4/target_struct= s.h index 00ac39478b78..3a06f373c35a 100644 --- a/linux-user/sh4/target_structs.h +++ b/linux-user/sh4/target_structs.h @@ -1,58 +1 @@ -/* - * SH4 specific structures for linux-user - * - * Copyright (c) 2013 Fabrice Bellard - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, see . - */ -#ifndef SH4_TARGET_STRUCTS_H -#define SH4_TARGET_STRUCTS_H - -struct target_ipc_perm { - abi_int __key; /* Key. */ - abi_uint uid; /* Owner's user ID. */ - abi_uint gid; /* Owner's group ID. */ - abi_uint cuid; /* Creator's user ID. */ - abi_uint cgid; /* Creator's group ID. */ - abi_ushort mode; /* Read/write permission. */ - abi_ushort __pad1; - abi_ushort __seq; /* Sequence number. */ - abi_ushort __pad2; - abi_ulong __unused1; - abi_ulong __unused2; -}; - -struct target_shmid_ds { - struct target_ipc_perm shm_perm; /* operation permission struct */ - abi_long shm_segsz; /* size of segment in bytes */ - abi_ulong shm_atime; /* time of last shmat() */ -#if TARGET_ABI_BITS =3D=3D 32 - abi_ulong __unused1; -#endif - abi_ulong shm_dtime; /* time of last shmdt() */ -#if TARGET_ABI_BITS =3D=3D 32 - abi_ulong __unused2; -#endif - abi_ulong shm_ctime; /* time of last change by shmctl()= */ -#if TARGET_ABI_BITS =3D=3D 32 - abi_ulong __unused3; -#endif - abi_int shm_cpid; /* pid of creator */ - abi_int shm_lpid; /* pid of last shmop */ - abi_ulong shm_nattch; /* number of current attaches */ - abi_ulong __unused4; - abi_ulong __unused5; -}; - -#endif +#include "../generic/target_structs.h" diff --git a/linux-user/x86_64/target_structs.h b/linux-user/x86_64/target_= structs.h index ce367b253ba1..f1181383c4f0 100644 --- a/linux-user/x86_64/target_structs.h +++ b/linux-user/x86_64/target_structs.h @@ -19,41 +19,7 @@ #ifndef X86_64_TARGET_STRUCTS_H #define X86_64_TARGET_STRUCTS_H =20 -struct target_ipc_perm { - abi_int __key; /* Key. */ - abi_uint uid; /* Owner's user ID. */ - abi_uint gid; /* Owner's group ID. */ - abi_uint cuid; /* Creator's user ID. */ - abi_uint cgid; /* Creator's group ID. */ - abi_ushort mode; /* Read/write permission. */ - abi_ushort __pad1; - abi_ushort __seq; /* Sequence number. */ - abi_ushort __pad2; - abi_ulong __unused1; - abi_ulong __unused2; -}; - -struct target_shmid_ds { - struct target_ipc_perm shm_perm; /* operation permission struct */ - abi_long shm_segsz; /* size of segment in bytes */ - abi_ulong shm_atime; /* time of last shmat() */ -#if TARGET_ABI_BITS =3D=3D 32 - abi_ulong __unused1; -#endif - abi_ulong shm_dtime; /* time of last shmdt() */ -#if TARGET_ABI_BITS =3D=3D 32 - abi_ulong __unused2; -#endif - abi_ulong shm_ctime; /* time of last change by shmctl()= */ -#if TARGET_ABI_BITS =3D=3D 32 - abi_ulong __unused3; -#endif - abi_int shm_cpid; /* pid of creator */ - abi_int shm_lpid; /* pid of last shmop */ - abi_ulong shm_nattch; /* number of current attaches */ - abi_ulong __unused4; - abi_ulong __unused5; -}; +#include "../generic/target_structs.h" =20 /* The x86 definition differs from the generic one in that the * two padding fields exist whether the ABI is 32 bits or 64 bits. --=20 2.33.1 From nobody Thu May 2 06:56:47 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 1641932227292498.2500806868384; Tue, 11 Jan 2022 12:17:07 -0800 (PST) Received: from localhost ([::1]:45704 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NZp-0005II-LS for importer@patchew.org; Tue, 11 Jan 2022 15:17:05 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44702) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCc-00084U-OH for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:53:06 -0500 Received: from mout.kundenserver.de ([217.72.192.75]:58773) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCa-0008Hu-QO for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:53:06 -0500 Received: from quad ([82.142.23.158]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id 1M26j1-1n4uMJ2Yhd-002Vi3; Tue, 11 Jan 2022 20:53:02 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 27/30] linux-user: Do not special-case NULL for PR_GET_PDEATHSIG Date: Tue, 11 Jan 2022 20:52:44 +0100 Message-Id: <20220111195247.1737641-28-laurent@vivier.eu> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220111195247.1737641-1-laurent@vivier.eu> References: <20220111195247.1737641-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:SE4dYVY2AVKSKSTQZa96vrIh+nZKbCUxvESLmoSeiCoZoGG/CiJ sHi5Tb4afJ85hXQft0euyEf4NuI6WleagsYQ0REXyTcll6pecfpYMqI6K8/b7L3r3F/z+o+ 3nVkdO2NNORNalRFy2JzBqu7l0RisZkFyspejCvHabfkcSvworz4kb++XL86PAksz5mM5Vf hzLL5cZ41iDCc/MmAqCFA== X-UI-Out-Filterresults: notjunk:1;V03:K0:+lhDWaRqzDY=:UEnc7zTG8mdasdjUYyc7yi hvgdjsQoDUqe9iia0uuJWEVOGOshJiozrO78kc13h/+8QsgQJiTjD9lTqGM5+N+eOEPEOtt+2 e2rsgxvPmy9v13JI+LMrMhD+cCvXvNYWwz65zjs507BOlOXrbyhIElUJqJHSNjnyI8/3qXlBo kI7wthynA3NZo+z9rFZBeLlMaDOZu1zxfgdc9a4mZ0Ua0kVpgr0GzAG9J4QRKkIIku7/u2xp6 cPIljZEi2WoATnbO4GopA36wme6VKDpUZ8hafp2UAsxO/EEGdPJ/iuBSKNlOV+wjh8uIFNHBg 7d/f7g9fP4CmT6CFqXnRnyvf/m7TsAImHCwEE1V/TNaiNQ1Gwv1KPpfawILD9efTyZTiP3GHq YkYKsm6jbQhz25u54VHUoJJ21xQQb0LfjGCH+mZ+c4nluSjAsAgI4+piWBNSbDVXdWPuZcwPt 9MUiYQlpHmOaXLFF0LBYZgcxq24AvbqW/UMk5lF4XGBA9/bUP/HWgSvL0SIqqc5KinRMr0kA6 vhWRielfV5kj/6Yw1wiMf8QmTwLjstSwLUrp21Oh3RxDk8SbbdxJeYdvY/AD4yJgCCSqeDlP3 nQdR7YPf0HuSeVZHEZkKYA489a7iM+/mAoOBUEboCvs0XsZEH0rFMbte5DyGKBx/m4XxmV2yl cPZgqqb4a3pAm/wQTSb+v7GnxX6D3vSotHCgi0eTQh2r0k/4JrrpfKnhN0t89YKQNfkI= 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.75; 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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 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: , Cc: Richard Henderson , Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1641932229222100001 Content-Type: text/plain; charset="utf-8" From: Richard Henderson The kernel does not special-case arg2 !=3D NULL, so neither should we. Signed-off-by: Richard Henderson Reviewed-by: Laurent Vivier Message-Id: <20220106225738.103012-2-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/syscall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index ca6e0b8fb0a1..eff107b8bcfd 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -6444,7 +6444,7 @@ static abi_long do_prctl(CPUArchState *env, abi_long = option, abi_long arg2, int deathsig; ret =3D get_errno(prctl(PR_GET_PDEATHSIG, &deathsig, arg3, arg4, arg5)); - if (!is_error(ret) && arg2 && put_user_s32(deathsig, arg2)) { + if (!is_error(ret) && put_user_s32(deathsig, arg2)) { return -TARGET_EFAULT; } return ret; --=20 2.33.1 From nobody Thu May 2 06:56:47 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 1641932230176291.05531699717324; Tue, 11 Jan 2022 12:17:10 -0800 (PST) Received: from localhost ([::1]:45974 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NZs-0005TT-V7 for importer@patchew.org; Tue, 11 Jan 2022 15:17:08 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44758) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCf-0008BL-6D for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:53:09 -0500 Received: from mout.kundenserver.de ([212.227.17.24]:58019) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCc-0008Ig-Sk for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:53:08 -0500 Received: from quad ([82.142.23.158]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id 1M5wTt-1n14rs0DvP-007TW9; Tue, 11 Jan 2022 20:53:03 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 28/30] linux-user: Map signal number in PR_GET_PDEATHSIG Date: Tue, 11 Jan 2022 20:52:45 +0100 Message-Id: <20220111195247.1737641-29-laurent@vivier.eu> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220111195247.1737641-1-laurent@vivier.eu> References: <20220111195247.1737641-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:gusD8WIwIvT6sfPsy+wgSrGjAmw9BZN9GyF3Je8/mm9QeXTCLfd xRWxwjl+z1ibrqVmzTJ1+Xee1BJ1QyEtaCIPoQzn4RuX3nTNSMEmuarywduSn+8B9IRo4oO vdQVE5Ce7b6blFo6gSU5ysrS3RCdwV+MYcjiLIcgKOzTNlJiYcxWdfoCB+rn7eQgaA6r5B6 CVaXpAhZUjqpnhqQK+QrA== X-UI-Out-Filterresults: notjunk:1;V03:K0:DTrfcVDfJTg=:sAwGH8P64avVf8ZB/ycmOh 9W/1CNykr5p92oKHrsBY3VeuitypcX7DpPUq9/g5wnxVYDtLT5mw7KN8jkKkoJ+OomihFi6aC tWfqqKj/ICeRcefyW3uh+I9uKSpXYBYggOrLavV61M5VM8SchUKacM+cDslj6qRa8fe3/K2Tj z1+iEIdvHCZBf6zguItZj8eljsNAaXI3NGhSsUgOyfd2fUTZRRGEnR1PK311PFYig7XXmUREK vFyEhe7e3PSBK6BhdkxUF7+Vwe+l+khs625AMgcdwlJ7LozR1toPk05+GgrxxsyKCJB3UqD/Q 1cHFlBMw/SCdORy6Lv9vrWwVS0eociawp5jNmggmVNVoHdfXMZPgjyH/pHoVLQBBAB3+btdnE 2ceSuBNYIauZ4rwTntc6HJGM4CEjRk91rSCFnjDcOpM3oBzoUfND+zEp8ncM1EMDjLMWr0im6 onvMje87J9WYmYATCjcelv1QH0yGzQGO75TqEg62VXCzl1YhHTwtc3aYhBTVez4HLSIjUMjkn JJ251cA6Y162xcfBU5NnpLaIGonuT+6/pnDRxRLiBfRDPVGAL6b0fpZs0i4fVltYtNwkJiDxD UfoNmreLCONW2eiLu0DRG4h9MtuzqIpN79VvqHP//KoLQ4DcrmikRLTKjLEYfowGk3FaUJHEN favmGy1ZIYvodzxFe40PQDpyJmqd8vhWDBjE3AIXAmRir4VCNiv8V6ZvW/M2m/moCAR8= 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 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: , Cc: Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1641932231289100001 From: Richard Henderson Convert the host signal number to guest signal number before returning the value to the guest. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20220106225738.103012-3-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/syscall.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index eff107b8bcfd..b17cfe31c8b4 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -6444,7 +6444,8 @@ static abi_long do_prctl(CPUArchState *env, abi_long = option, abi_long arg2, int deathsig; ret =3D get_errno(prctl(PR_GET_PDEATHSIG, &deathsig, arg3, arg4, arg5)); - if (!is_error(ret) && put_user_s32(deathsig, arg2)) { + if (!is_error(ret) && + put_user_s32(host_to_target_signal(deathsig), arg2)) { return -TARGET_EFAULT; } return ret; --=20 2.33.1 From nobody Thu May 2 06:56:47 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 1641932234379373.86700061412523; Tue, 11 Jan 2022 12:17:14 -0800 (PST) Received: from localhost ([::1]:46376 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NZx-0005lO-7k for importer@patchew.org; Tue, 11 Jan 2022 15:17:13 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44752) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCe-0008A5-GX for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:53:08 -0500 Received: from mout.kundenserver.de ([217.72.192.74]:52787) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCb-0008I9-QG for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:53:08 -0500 Received: from quad ([82.142.23.158]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id 1Mt6x5-1mDuEQ1u3t-00tVw7; Tue, 11 Jan 2022 20:53:03 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 29/30] linux-user: Implement PR_SET_PDEATHSIG Date: Tue, 11 Jan 2022 20:52:46 +0100 Message-Id: <20220111195247.1737641-30-laurent@vivier.eu> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220111195247.1737641-1-laurent@vivier.eu> References: <20220111195247.1737641-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:g6DNtmrPiZ3wq/lx4Yv706OwXC+B7mgsMpHtj0fAsxDQ9gxEksZ 49HdrcsYBjINef/UEjiiFi4XvhkHr3kGecjTcsWfKccxtsFxBpyIgjvmnjWCQMJ8C/X+bYS cMBejhz8YTj9F6XS2Cv4Gsp5m0eGNJU9yLxSa+pJuDR1NyOmQABT1sZdG6NNBs7WYVSP19I M/SSp4FiN5vwBK3EGw2Pw== X-UI-Out-Filterresults: notjunk:1;V03:K0:VvQyIopO+X8=:hIr0zplx5Zuu+53+mCIh+M 5rZ466HD8pTIrVwORHd6glDGrPjHOw/XUi2Sw25LhcrWEov2vRrMuIJ8eHB3rP6YfPXHsw7QO HbWr5oDPfiUDDNIbOXRH6VG1P2HvspvBS1aldvs4mr/znpa+sRSvD1aRo572T+npiCelZFIa/ 1PORfNdKGyD3Hz9aMkkCAIrjUOpfK5dvr9thB2DzGQaK/diec0gNTVCwS+ELcp0byvZP4pOyc I9aTsAG8cBkLm5/NFBRNAM2I6HPWHfSRZ2UWUhO99dM1aYbTYKgojGmLn8MNoE2b/HHfBfDi7 IT7Xf2vAIGT30a/QOVUU2Kirg6XoHxMdnaqYxb4Zr42bFwR6jwtn3nITMBtlfOuQGzCgXg9QE 8gOXmG4H2Mna5dxNiODNiAyHzbd31NuZ3piGazYm01jeKi11AaPasi9xAslNv16WAqbF32VFG 585nPMezRf6CirWSCYdkKUp8UeiEZwIV5b5HKN2u2VRO+mntokIKF3LARIkS2sUeMh6Pnpa5f WpLXEoXw99Qw55gZKWVy1wcZFrFX+bsYT0WmqjzU4nzWTs/7TMAFK/Sx7jHreeAURz4fEAfrj 7x6iRawabPRDmLCCYWk92oXXc0VqSyxaVeVXzsFHvRx9mJIhOJPn8vH9BG+4Dt6pz0XNfQxSy llkuNXO7hKWUioN5bMBlYpIWTBbfp0GsEfmqa8mwQxcXHQ2T1VO4I78CCLZ6GuPA3tfc= 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, SPF_HELO_NONE=0.001, SPF_NONE=0.001 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: , Cc: Richard Henderson , Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1641932236025100001 Content-Type: text/plain; charset="utf-8" From: Richard Henderson Signed-off-by: Richard Henderson Reviewed-by: Laurent Vivier Message-Id: <20220106225738.103012-4-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/syscall.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index b17cfe31c8b4..f9ae6328b53b 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -6450,6 +6450,9 @@ static abi_long do_prctl(CPUArchState *env, abi_long = option, abi_long arg2, } return ret; } + case PR_SET_PDEATHSIG: + return get_errno(prctl(PR_SET_PDEATHSIG, target_to_host_signal(arg= 2), + arg3, arg4, arg5)); case PR_GET_NAME: { void *name =3D lock_user(VERIFY_WRITE, arg2, 16, 1); --=20 2.33.1 From nobody Thu May 2 06:56:47 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 164193269088548.17495319457237; Tue, 11 Jan 2022 12:24:50 -0800 (PST) Received: from localhost ([::1]:34496 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NhJ-0000AE-PV for importer@patchew.org; Tue, 11 Jan 2022 15:24:49 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44742) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCe-00088M-1g for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:53:08 -0500 Received: from mout.kundenserver.de ([217.72.192.75]:49479) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7NCb-0008IL-Rb for qemu-devel@nongnu.org; Tue, 11 Jan 2022 14:53:07 -0500 Received: from quad ([82.142.23.158]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MirfG-1mSYnb3b4W-00etze; Tue, 11 Jan 2022 20:53:04 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 30/30] linux-user: Implement capability prctls Date: Tue, 11 Jan 2022 20:52:47 +0100 Message-Id: <20220111195247.1737641-31-laurent@vivier.eu> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220111195247.1737641-1-laurent@vivier.eu> References: <20220111195247.1737641-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:X65KyYpmgvTzNs05peiuXT3UJPO51Dun7bUw3kYCzuStBpYY57I 7KrA2FLRg10RMPrSPVZA/cYSDcxZPg75YenFXBr//MUNBKsZa8QI+kPPjLNoH51fb8QqO9+ 6adNyJCtfpGZpDWHri0ALQpXxhNwx+MbBhEKFPkRtGcPSxK2Lr27aI+Ggjvo1UxOoH0bdbZ JOR9RBAWI6+vQDhbx13/A== X-UI-Out-Filterresults: notjunk:1;V03:K0:ixT0RA+x9a4=:25YiJ8Dra7/1ufTsPwiaDh 3Pvu0WuenYw8vfpIHGwVmmG/STdFrJQHfbAv6nyVPBzl3pQH+zJTFs2KX5kprNHk0sqfzrPMZ SgguvZM4EhI54BvaYpROP1GkaUC/RTFrvJGF50jHaeHhrDqqXGzGcT5/nUGsf2NNKU9n1bovP /4vFnkMIwnD9iWVrv3yV5ciIKBWUUStQZVDp1LUiVCRtHcIUNo64aGPAoh2qRSKRm8lUYW0Fa TFsCBDEzw6FjOyBZHE9qJwYsDRqcPR1T1IhWR10cso//m8xrSuGDeW3Px6Q2zjLUTn6pn09LO eADKYq6DH21axlQ30eZe3b0+hB+XXWnTf2brPjrKU9vfnf3pd5ixDfEiPK8VshbB2DAZe690V uZwYpRy9HzgA4y72LLRE0X769qK2ZYlerYVJp6JlDP3q7zcnHnLOasIt9WfWGkUSxdTZBoHsN mnyphN8W19N3fBtVtP9sIsFro54gi30rBoeAR70bbBeZvOQ61sG7gbw/ZC333fxOz4q1nzzy+ a89llI1EMDXMh5uX/0cCeUvwuJMYr7nltssGV444qP2BD8EnDnE2icRU0LlApmXlfAMOb0Tgm r1usbD68TV4G5hIt9ZUlBXdX2M/eHr0l/vf7KQLAgpWafL3N8rkbJxL/zpXmgp+jQLMtv5LaZ CJVMZSM9e3uFAtzMMmVhh6qlmK74PZF6V4T3pEtbT+FZ9OIBd631CncDx0x/mstGylss= 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.75; 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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 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: , Cc: Richard Henderson , Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1641932691795100003 Content-Type: text/plain; charset="utf-8" From: Richard Henderson This is PR_CAPBSET_READ, PR_CAPBSET_DROP and the "legacy" PR_CAP_AMBIENT PR_GET_SECUREBITS, PR_SET_SECUREBITS. All of these arguments are integer values only, and do not require mapping of values between host and guest. Signed-off-by: Richard Henderson Reviewed-by: Laurent Vivier Message-Id: <20220106225738.103012-5-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/syscall.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index f9ae6328b53b..5950222a77e0 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -6504,10 +6504,15 @@ static abi_long do_prctl(CPUArchState *env, abi_lon= g option, abi_long arg2, case PR_SET_UNALIGN: return do_prctl_set_unalign(env, arg2); =20 + case PR_CAP_AMBIENT: + case PR_CAPBSET_READ: + case PR_CAPBSET_DROP: case PR_GET_DUMPABLE: case PR_SET_DUMPABLE: case PR_GET_KEEPCAPS: case PR_SET_KEEPCAPS: + case PR_GET_SECUREBITS: + case PR_SET_SECUREBITS: case PR_GET_TIMING: case PR_SET_TIMING: case PR_GET_TIMERSLACK: --=20 2.33.1