From patchwork Tue Jan 11 19:52:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 531135 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp3780364imp; Tue, 11 Jan 2022 11:53:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJyNQ+WpQlGm8/DkbimL6HbrJmw/2hCp55IM5I8yPfy2KK/d427dTiyr8aVW/kN7s2p2BqaC X-Received: by 2002:a25:86c4:: with SMTP id y4mr4580456ybm.646.1641930825254; Tue, 11 Jan 2022 11:53:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641930825; cv=none; d=google.com; s=arc-20160816; b=CSt8sL2CNMZYPyYKu+jVsnXvo989xOJY3HebCxXQshN5iLH6zweDGjgQce7ubw91fs ix5ra/kDixQy7YE+zsXV7qD6i17ZJhiXdDE6xo7ovq5HewIq8QnDZWJaXq+ouxu4+Ecq qu0RPhUS7WT3n8cLGPIcyDWDvPXC1Y5RP3wQuShTiQ0wjho5qf3sMzfvkXSI7jrdkAcY nsMgFt8+RxkqaM9psLR43CVMqUvAXDetoSOcTTa4N4t0s8t3IxvpNfNW+pFLinKSBZ9/ qmW6S8vsWUzYzVqfrrSHr4jnxjo9cAamcJ53y5zulkxPCbqwb4pxGwF5ZPcU66WwCw3D 0xNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from; bh=o38eZmHaaH1XPLUub5Je5f6q/hxcBS+rPb7Up6TPSn8=; b=P4Dr8dzLDM59Qx2v+tpe+L7GZ9/kpiH7tqu3vbeoWsmi2Lurr/3ggZQOHLJKBIpkbA Ow1+E3EJKE10pJSJTnWdOol36UJauw5afjSx0Y702GvO0NZnn8e8w9zDHFQFAnngxbRp cZBUQo4aLd5A7FM8j6JOTdTetBdBgz6wJ820bXw6QqdNGD2/LPXhD9kGPHK7Ihtaudah Jd0bnJd2jkQsJ544FjRI3pHIcCj6xz3uJgAMqkN8EA2Anbf1jWwnxNX471/931agUdRi vuPJNcplsxaA88i/XGECDisMPuDNUTdD3JoEth+/Jp1jDvtispbfM4DjZv5OguHkMQIj K1uQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id o127si8389823yba.152.2022.01.11.11.53.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Jan 2022 11:53:45 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:46906 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NDE-0007ip-O3 for patch@linaro.org; Tue, 11 Jan 2022 14:53:44 -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 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: 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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 = TARGET_SIGTRAP; info.si_errno = 0; - info.si_code = 0; + info.si_code = TARGET_TRAP_UNK; info._sifields._sigfault._addr = 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 = TARGET_SIGTRAP; - info.si_code = 0; + info.si_code = TARGET_TRAP_UNK; break; } info.si_errno = 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 */ struct target_rlimit { abi_ulong rlim_cur; From patchwork Tue Jan 11 19:52:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 531138 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp3782615imp; Tue, 11 Jan 2022 11:57:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJyvd/EHl3fz1rVoHsWmfH5AYOBH8eegiLWBU2YU+taOA6g4HbdRSj3x6VpdAMx82rqU3HuZ X-Received: by 2002:a25:9f04:: with SMTP id n4mr3277121ybq.492.1641931059900; Tue, 11 Jan 2022 11:57:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641931059; cv=none; d=google.com; s=arc-20160816; b=pDe1hE3boWhJ++dLsVC99ioCy4vhHMr0rB/MieJ9eMe56YL3KANBxmJuNRPyfljxYf r2yB6a4kh8L40dPLs1IGjHCHz0TgeLHlxM0SPHtLDwFrZMQ26UJmY0Wa5GDnaBCAPS+i 1px8vJAWGZay9ykACrmyaKS5V7UznMtq7NEm2CoP7MYHkR4AMZPypsmkm/QMaAv4BYrk kLAuuNRlRP6WKl7cpuXDoJ7jKRQq7kbAB2qzb0JzGV5Tw5rxmChdyTkcpGON1e6PiwNY dXEXTamn5acIuVhn4AmGeFy2aGcbsUzTT1kCs86DA3XjhggBEV0kXxTFcAp+csfcpXDR Z4/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from; bh=4k6Gz94+0B6nB4rdOuVPJFhRjLpYJnWiKY2HqTrY+QY=; b=cWdiTt3f33Gfv++/iWN5LAP+nlFKXTTHyzysiO/K6PoSyRWSVdE+kRj+BvbbWJnElN XPBoXcxVxyd9kl4A68E1NM+PIGCuVFdaWZ8TnoXOoYQwQ36vXp6RHoCseKbr4lftJbF8 pP0lBVXBdGVyY3FrUIo44fnWfUHG32h2CHpXKCI3ZT/ZKmtdjFnRmWj/9uueyuZUOdJg e9B8SEgB883htEBS8bF18KmdlWPACvaY8cGe7ruhCMuDV/CDvNw5iIvS4/TqJC7OhAR6 M2zlA6OelFJIb160PuPrIF9nxillx4YWzRC5EDdqQULbIqHbC1dUAuVNM1jCReoUbgH2 0fIQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id v1si7080261ybo.344.2022.01.11.11.57.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Jan 2022 11:57:39 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:55350 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NH1-0005Ar-Bj for patch@linaro.org; Tue, 11 Jan 2022 14:57:39 -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 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: 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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 = TARGET_FPE_FLTRES; break; case TARGET_GEN_ROPRAND: - info.si_code = 0; + info.si_code = TARGET_FPE_FLTUNK; break; default: info.si_signo = TARGET_SIGTRAP; From patchwork Tue Jan 11 19:52:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 531140 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp3782659imp; Tue, 11 Jan 2022 11:57:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJxs0lP7yLO/akoRFx2KfL/kRQeTrwEhwPMO/BCGRwjyG9UpHwJOsQmBWdGWaCdKuyEQBe7h X-Received: by 2002:a5b:34e:: with SMTP id q14mr7925078ybp.742.1641931062539; Tue, 11 Jan 2022 11:57:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641931062; cv=none; d=google.com; s=arc-20160816; b=BBl2ac6kRwAe2BJOu+4ZD5bxkGVpT4qErOoN3+32gvhz7Mo1Dzham7eQKP2mH2u9GG waaKtR1n+y8Go70fdMXD0hyxQX/EUMUbvDHgsZQgB+j7F9ogVwWo9lFQ/vntpvhZdGJ9 4PlqxlhV9uLd0J1GF4Dx+Cr05iB3Cqj0VLVyAny7aFfl13o2+sn9nsCAYU/Oz6KTIjJ5 AY3n/qSY+dDqluR02E3BPotOHmR6qgmqF6gJYwRtvD0CYkhYzeOqC8+bPh2+guPuk43H zaCDAfAEZ/+vSuKs04Pp2mHy6kWzpKKCa74hSQGK8d21mfKEE4Q/xRM0t/UooG8MQ4sZ IA1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from; bh=8QUYVAfNDNi9slOS2uAHowWQmDm0yme7kjzw2yBE6KY=; b=N2qxNuGtzP9++gz8eBTcMV1mXRmt5gNgWptPFTAaeKFlMBBd9iGb7qE6r+ERGKrzr5 E8rylDVVVCwKCxZpBcLkp7AmaLxMXmpMx7eXXfCLsTvD1/LIdplpbA8+wy6smiZM9YK1 q1BiArcYRYg25FTAREuw7aIeNhBKCHNvGFkwImQSG1dqEHVsxnETVN+EWrTqWan8bvVM Sp8964Q0on21ukvqPay3Qmezk5y+ulFfmPNr/U6JH6yE4pHE2AnR0U8LnMdPve2gz0l2 EgVHOWhm9jwsnMQTfrcLkbp+y0DzB5tdHh1ZHziRQqlOjmA474cEuNtQomK6KIoKr4ub ugVQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id w7si10395693ybc.410.2022.01.11.11.57.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Jan 2022 11:57:42 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:55564 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NH3-0005KB-Us for patch@linaro.org; Tue, 11 Jan 2022 14:57:42 -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 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: 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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 = env_cpu(env); - int trapnr; - target_siginfo_t info; + int trapnr, si_code; abi_long sysret; while (1) { @@ -56,18 +55,10 @@ void cpu_loop(CPUAlphaState *env) break; case EXCP_OPCDEC: do_sigill: - info.si_signo = TARGET_SIGILL; - info.si_errno = 0; - info.si_code = TARGET_ILL_ILLOPC; - info._sifields._sigfault._addr = 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 = TARGET_SIGFPE; - info.si_errno = 0; - info.si_code = TARGET_FPE_FLTINV; - info._sifields._sigfault._addr = 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 = TARGET_SIGTRAP; - info.si_errno = 0; - info.si_code = TARGET_TRAP_BRKPT; - info._sifields._sigfault._addr = env->pc; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); - break; + goto do_sigtrap_brkpt; case 0x81: /* BUGCHK */ - info.si_signo = TARGET_SIGTRAP; - info.si_errno = 0; - info.si_code = TARGET_TRAP_UNK; - info._sifields._sigfault._addr = env->pc; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); - break; + goto do_sigtrap_unk; case 0x83: /* CALLSYS */ trapnr = env->ir[IR_V0]; @@ -130,47 +111,43 @@ void cpu_loop(CPUAlphaState *env) abort(); case 0xAA: /* GENTRAP */ - info.si_signo = TARGET_SIGFPE; switch (env->ir[IR_A0]) { case TARGET_GEN_INTOVF: - info.si_code = TARGET_FPE_INTOVF; + si_code = TARGET_FPE_INTOVF; break; case TARGET_GEN_INTDIV: - info.si_code = TARGET_FPE_INTDIV; + si_code = TARGET_FPE_INTDIV; break; case TARGET_GEN_FLTOVF: - info.si_code = TARGET_FPE_FLTOVF; + si_code = TARGET_FPE_FLTOVF; break; case TARGET_GEN_FLTUND: - info.si_code = TARGET_FPE_FLTUND; + si_code = TARGET_FPE_FLTUND; break; case TARGET_GEN_FLTINV: - info.si_code = TARGET_FPE_FLTINV; + si_code = TARGET_FPE_FLTINV; break; case TARGET_GEN_FLTINE: - info.si_code = TARGET_FPE_FLTRES; + si_code = TARGET_FPE_FLTRES; break; case TARGET_GEN_ROPRAND: - info.si_code = TARGET_FPE_FLTUNK; + si_code = TARGET_FPE_FLTUNK; break; default: - info.si_signo = TARGET_SIGTRAP; - info.si_code = TARGET_TRAP_UNK; - break; + goto do_sigtrap_unk; } - info.si_errno = 0; - info._sifields._sigfault._addr = 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 = TARGET_SIGTRAP; - info.si_errno = 0; - info.si_code = 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. */ From patchwork Tue Jan 11 19:52:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 531144 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp3784895imp; Tue, 11 Jan 2022 12:01:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJyUzM39xWKiV2nVta5vqRCiPgXYtAvIK5oaYRPRF7ZxX2zYMmsHhXLVfFuwukXqLt4IUZBF X-Received: by 2002:ac8:4142:: with SMTP id e2mr5036739qtm.603.1641931269791; Tue, 11 Jan 2022 12:01:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641931269; cv=none; d=google.com; s=arc-20160816; b=F3hpL/yhDHZ8e4o8Khr2xJQhj88ExroTm/w3+ox2hDQy+zFrcGLlvKvizxkdwjIgGL tU6sh5L5wcXfYOpVz9mPNSmSFOvoAI7Rtl0t7M++ZPqBZBcaI1drz9opamHIvRcXLYQR BzuIGorGTfUheckb8OSGMWe8T0uYhZQBKxWPX8rK4Q8HKRzcJJkBat4CkQuaj2DW+kie Bix92tIYuzQMTvI4UUJa1dEPbul9A3P+HJRFsGChCKOmFHVlvV9rKJ4oRuzwLGr/dVoz gVoyEdg/GQVCY20uI0TGrHjQqlG+solfxOJ+gh3c8+iWjcJu23+PlXKoezAnHXcB2R9v kgFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from; bh=rTxlw7pqzvjbZzGAFjgCa3iY4ZsXh7yX4Rgy6Piftvg=; b=pAbwkv3oUyLzWpG29pHtt03uCGNEVBJkdxsQqmi/fcS+memtWHEM15TlVDCI5XMKkS GkrTdHGx0UpCC9nHee2viZm7N8gHQoo8Jl0fCC6cj4IH9r3ooqYbSc4zO9BRJSZUFcDZ G10vapl9D3vo11Y8mqvXF+6z+BOXXdwLZ5pS+zs7mIAD8tSqefbvdKupA9Opi210t75Q 7iEH4GnnJJWZXGprwC8f8EQq++7prpqL0Eudm79BFaQEGkQAlz9CaTnx6zaAkmtzawrp KBqIissgwSDyjRuHjt64dVRJ7nLK7x3a3ZpTQzxrFRgNWK9Xt5oLy1J7KdWMQeayVrNw urTA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id y3si1473989ybq.823.2022.01.11.12.01.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Jan 2022 12:01:09 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:36214 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NKO-0004E5-Qs for patch@linaro.org; Tue, 11 Jan 2022 15:01:08 -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 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: 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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 = env_cpu(env); int trapnr, ret; - target_siginfo_t info; - + while (1) { cpu_exec_start(cs); trapnr = cpu_exec(cs); @@ -38,8 +37,8 @@ void cpu_loop(CPUCRISState *env) 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 = do_syscall(env, env->regs[9], @@ -57,10 +56,7 @@ void cpu_loop(CPUCRISState *env) } break; case EXCP_DEBUG: - info.si_signo = TARGET_SIGTRAP; - info.si_errno = 0; - info.si_code = 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); From patchwork Tue Jan 11 19:52:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 531136 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp3780394imp; Tue, 11 Jan 2022 11:53:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJyF6RIbLhQnO3XKzddv+Xi6PFd1rLm8TcVdIvrrS4I0fQCI4x8fKFdAaFzeRFe39Q0yr/LJ X-Received: by 2002:a25:8c86:: with SMTP id m6mr7798518ybl.506.1641930827277; Tue, 11 Jan 2022 11:53:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641930827; cv=none; d=google.com; s=arc-20160816; b=S4vDqmgCjckTEUxlwBn1xJANiRBvHfoE0WN3mB1rs8a5SSzugtlgSplfH65uVBbWi9 y9gLIC32kfJFWOy0IcSKpofQS5TFnbMBeqVaS3VZrfLse25ulgfgeNbmSdFTGeMZLSEj i5JYmPd1NMSGX7IpNzjemlj8zIoryKG3tTA2uOYMh3zOVu+urQcZXJvUV5xIv9LnNm2k Q4AqNPckAJQ/YI0GQiKGl/kT0ixrxhLAPryGfmj1GvsmQ7cz2t4odRWSGLUnpwt+mdKw MwGvcf2jC/6dhzQ8zj55H4XHCfpZaY18CxPF1aUyDi2pHN2T+carYeC4utgjebe9c87+ qtNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from; bh=nO8Ceu2PV8phSbpYbbp5HHZKb8CVMkb5COGy74WYJkQ=; b=vLMKldAAdtbwgLjIXcrmYasaOMgW0iSgOL52Dc25KfDtuOp/9qg82GrlXa7qeZjTLH S4tdv8SMZF7ooJu4BrXA5vDI2vyTdUZ8w2FuCp2pH9yoElJQVjMmRxSpz/1TIxtRUgTQ KFNQsX+IXfNbh8i6hy+sWzxBKyb9mvJRDsfhBkGM7WyTahIhCO7PZYyZZTyTXPm52c5F 72cE5c7lnbPXatk2FreAhH5EM4W2FrAnk4V46HLu/OWbJm2fJ1KEApbK5O6jXQKl3RJV +zk0ResKVNhJVkRGwYkUo0ciBtYUdPwLEsfCZG3GDXIloO9d3Fj05g9yquIfq6d5fZ7N BNxQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id y15si7315913yby.185.2022.01.11.11.53.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Jan 2022 11:53:47 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:47004 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NDG-0007nM-Pi for patch@linaro.org; Tue, 11 Jan 2022 14:53:46 -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 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: 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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 = env_cpu(env); - target_siginfo_t info; abi_ulong ret; int trapnr; @@ -147,26 +146,15 @@ void cpu_loop(CPUHPPAState *env) case EXCP_ILL: case EXCP_PRIV_OPR: case EXCP_PRIV_REG: - info.si_signo = TARGET_SIGILL; - info.si_errno = 0; - info.si_code = TARGET_ILL_ILLOPN; - info._sifields._sigfault._addr = 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 = TARGET_SIGFPE; - info.si_errno = 0; - info.si_code = 0; - info._sifields._sigfault._addr = 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 = TARGET_SIGTRAP; - info.si_errno = 0; - info.si_code = 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 */ From patchwork Tue Jan 11 19:52:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 531139 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp3782631imp; Tue, 11 Jan 2022 11:57:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJymMORk5EnwpayjkE7XMkvj2NpmuZnawtz8aRYyytZLa+PZwG44q8YC6A00MBtyq51ORMXL X-Received: by 2002:a25:dfd6:: with SMTP id w205mr5071639ybg.505.1641931060854; Tue, 11 Jan 2022 11:57:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641931060; cv=none; d=google.com; s=arc-20160816; b=SFh253ObYEXMixFBYobNks3SWEfiKTRBdPiAJVgNd4qVw61kO/iYR1hy5xUFZ3jqxJ DAJypiaaNg9+PQ1IYFArCYxOXGvoQno1N51S25XxtLrrzaHECiXusCWKN4S/CdGQ0EQ9 xXhlwopQ3emjJvmOrMl83zWpplUvmsqMcc7VS3tfnxtbnG6zb9SW4W6W5o8zvVC8Get8 zX1TXnA9OcY6mSA6KMErGblAb8YxUdj/MxmaOTYhzm0xc7hVRI4xUzAPSloMEUEN3Bzq LfKqd7q/okuwrsgEeYY9xdXd4/fHB08NbI+3ryOHK7tChcmgysmaKipiuVRrpSBsognp moVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from; bh=KAX2Buek7rubDO98qZ9q/urzsZJDaRgNHOKZHwnk5A4=; b=z2Dvzgyyy44rx7zw8Fqtbu6kzHEjHX8vX1jA8d03H5+/jX7vneImlg/NpqXoifNOnD P1Wwqp/spuUXA6yZ6FEesK6fjTDheMfqxkvebh9pN16RLNOFVmBWvTzPB3hYRy2cOHqS 5sq/TQKRwnwnkQclQEFNmdGiZnXU/7hQPrCGFCcm3jNpKhGQylHklKyinKf8yye1+3bf AlIoTd5DkIzXuD4uU5P9mjDiYzgU6JKo5gMvMn524nBwZoMTRkwLlrQ1mI1d23fcfk1X Yfn9ntOR+AUlEfezEK2TR0MV2kQ3dW7p3rgrL3oNpl7fQ0Dutx2DWl5mFR4Qkp4+eeoE 22Kg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id q189si1476523ybg.233.2022.01.11.11.57.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Jan 2022 11:57:40 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:55510 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NH2-0005HX-8G for patch@linaro.org; Tue, 11 Jan 2022 14:57:40 -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 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: 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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 = 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); From patchwork Tue Jan 11 19:52:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 531137 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp3782562imp; Tue, 11 Jan 2022 11:57:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJzKRN1Lc2+44yjz86VyLKGg+20pytCxKblQ3R3+MQ3JoSLiW0WvNxyLU8OXXFX/DsNoCEpA X-Received: by 2002:a5b:dc7:: with SMTP id t7mr7887563ybr.17.1641931054256; Tue, 11 Jan 2022 11:57:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641931054; cv=none; d=google.com; s=arc-20160816; b=B3Z8a3xn6I0gJSiTxznlNv9UO9Mr3AJPwUBBqR+UFlgwFwK+yOQQQBrS2FO+PrjfwI 1+6H0dcUbvhA3Yt+bi2Rsjd0u1pLdpr/RLse8nk0tHjgYND+6IOC9E0GTGmOO3uuKx8V jLU+NdufGioKTo7YS4Ag4z1/QCktoj07bgyb5ruDi95F/mcuBODoMTctWZv76aSTeIpC JzVD1qZGNyGHNhOD6ai3JvpOsUyan+KXbeUwpskn7xYk7nZLDZ8nObss2dE0d0dIr0+8 IWMTM/hk9bwBjwn0K9Mjy2uYOSq266Mgb+QmA1hkDvkhpMOj/EKVlIcH3LcbbmYlpc5A xOGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from; bh=v5OctcKFXtw6o777juCFtfvMtHavUmpU5Nn6A8iGMdY=; b=AUvEnjX8EEgJr6iFU+8BIdYdPTCKWwd0qNrTzmvq9CPG/8ifhncEZJCsXDDvyIQGcY PYjWMfb7r3SMb8xgqtdxHsx+fZdWV1Ay59prjhiQLRJedPqh3BzxA34tLaqe0qy5N/a0 uV9lr4mInhOrESgBuNFD9XfzmXFoNkdNuvvlrYHWPzNWeVugZTGz54M5INmcLE9zF5vn STS3sgPQ9cdTivS36cKBdHYoRm1zoyUDpaeukkbe888GgS2lwWUTmKY8q6gyJCa/PiZs HN4yHyohW85HplEfmL0oKZXZXK1gCe0yq+RhlIgHqXyI+78nIoPc2DFWYRlJBn2gFoyg 7+0A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 19si1849270ybc.577.2022.01.11.11.57.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Jan 2022 11:57:34 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:54638 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NGt-0004ff-Rl for patch@linaro.org; Tue, 11 Jan 2022 14:57:32 -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 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: 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_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , Laurent Vivier Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson This define is unused, and we have no similar define for the other signal sub-codes. Reviewed-by: Philippe Mathieu-Daudé 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 /* * SIGSEGV si_codes From patchwork Tue Jan 11 19:52:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 531153 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp3793509imp; Tue, 11 Jan 2022 12:12:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJzXR9t8p/9WjNFg1uDHqFGL2gtjR4I9oyCmAkEIcADE78AO2Czvj2xceExQbZWEikZrlCQ1 X-Received: by 2002:a25:4402:: with SMTP id r2mr8536562yba.16.1641931942325; Tue, 11 Jan 2022 12:12:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641931942; cv=none; d=google.com; s=arc-20160816; b=ovLleSIwYojy0Ms0o7JbRnsK1f5vkWy+xfM974vbmH7YOZJ5p2VLDgwNLImgLn08Xn Oj799wkMW+6KifiuR72tF0BmWgQZeMSvfN+zVwXWxicJxcEJxmBv3jYoN2C52dzdYw/t af6GM7AiP7GFz8sHDPSptf9t+0OAy0JH2j7vAsNb4GQ2hFUybSwhdPbO7UROyHZxn7WI /2UEqkkdWGVIMsLsVc4KKEMBQjnr2YoGKcFNkaU/nT2e40lmqCDgMa049w4SVnGsqQ68 NjIYu7O8X0cHwBjTTBxbuhpqNCEkT3y56CUz7vKYLzY0gBmM+rho5YuKTWE49HQC5ewk az8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from; bh=e8+GwxFfhPnOaTDiFwUjz1r9M8RNNtviv/R5xxmE/BI=; b=h+LTWAGXg2NkHvE5WFUD0qg71VyPW7rIEr7z6FlP0lqT7L+Sz4u9FtdTk4+VbGTq5M bO3Ry/J6QAqVGMnUdl4b4RFBsGLYdLlJFfnTNd/LCESQ7HxBsGHU7juSGxME2mbN38ot ptUPYX8LdTHDo1WV1aDXEmhD+gHUPC23TJTtGzGKvKJQrQ+aVTJ5spgmBQuca6DzjY/l DLmD9S0FdJBENS6OwChD/VnFXBNjtNdTn+voq+son6zpCB4CgCeAhdDzGmAAAG8yWKAh ImbgGqV49Z8aDDWFZ2VErwmMAcgIs42vNSl5eR9na1AUvyu7jUts+Tfipl/wxAGnd37d vx2w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id e80si6123368ybf.217.2022.01.11.12.12.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Jan 2022 12:12:22 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:33058 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NVF-00053I-P0 for patch@linaro.org; Tue, 11 Jan 2022 15:12:21 -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 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: 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_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , Laurent Vivier Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson This si_code was changed in 75abf64287cab, for linux 4.17. Reviewed-by: Philippe Mathieu-Daudé 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 */ /* * SIGSEGV si_codes From patchwork Tue Jan 11 19:52:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 531148 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp3787848imp; Tue, 11 Jan 2022 12:04:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJwONIhuO/en78CAAN0QraCkaEhXj1v/a6v0u+YiFuoYrJuhkX+VTieeeTmoCIqCcapRom+n X-Received: by 2002:a25:a548:: with SMTP id h66mr408198ybi.368.1641931481033; Tue, 11 Jan 2022 12:04:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641931481; cv=none; d=google.com; s=arc-20160816; b=j8XtV/OcXrTeaX7ofB9gJDiq9mg6VmMEVnuV34xjyIJeUXaZcSPKvuKF5Zp98Ya0jA hG27a6MYW1MOATiB5DSYqhjC2eZANNCfVUfzqONVlso9tYMK6JCVhxqiehjc2xGZx5gc 31w710mvEEwSt6m76NNC57WtTmx0qvRN5hu3cger3qgl1btkAd5eSlX0GXmsnJcIocX7 qa+S7weS6pSQ41UTxshVQHBmzn6qpqe47wILTsztK5WJ2bannmgeON7w0gMumo7Xy7Gd uVM6Pn0W+GLQoY4ZKON2iid1JCSM7yIbXUVPh+urC5o6ZvWjVrL0D4mthpckw1V+rH9o vGpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from; bh=ISuMKhUzKQAiUA1aWIsdQpKfvnNA7lgvAulrwbyyAKw=; b=LFBphEGft4JVfi0WGAJo8eRaHsbukmwkzAvwjLcABvJ3LHEEtqacR0JiQT5fVSYrYE qTzHwscHyOIuuzi4ndtkQcmy8qugP4oKV+ubkjxWi1FcB/fPGufbkTY2OAL929HvXG7c 9iRJkw6tF4AwqG5p505RovaysypOTWHaDK76p3RGirzO0mBfoAw6jGWJu20vmo237KXB loegU6NZOa4YabcWnJqMpsIEl8JsJSFYagkqqangfV9h8tLqrX5VRK+zudB4HP1fLMVL OaMP4Heb6yTrw2XT0s1XLzz6BXCukkgCIjsiMAgVHUiX+30uSFGqw3iAa0xYW5PKjs04 19Zw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id g18si2459025ybq.234.2022.01.11.12.04.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Jan 2022 12:04:41 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:44864 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NNo-0001ze-IA for patch@linaro.org; Tue, 11 Jan 2022 15:04:40 -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 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: 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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 +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 = 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 == EXCP01_DB) { gen_signal(env, TARGET_SIGTRAP, TARGET_TRAP_BRKPT, env->eip); } 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: From patchwork Tue Jan 11 19:52:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 531143 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp3784628imp; Tue, 11 Jan 2022 12:00:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJxM1Xr4fjpJih0B4iXUMUQ0hsyxxcum/Oq3MiMSndqROuqeiPcZ9KYd11NmHRBnTlImOHl5 X-Received: by 2002:a05:6e02:1b03:: with SMTP id i3mr3105721ilv.17.1641931250390; Tue, 11 Jan 2022 12:00:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641931250; cv=none; d=google.com; s=arc-20160816; b=M/kf3qo/RKtNZbYmD45tSunYPe/o8P1i3H1sY1js3HEhK2/U9JjnvRJxpssnPVdpz2 INO+/zBu4WR6ws+4WbyivVVnvPmS1aIO9TUuoluaCUJZWwfjLbHlO4Y+NgxZOH/4prMb VtNIoyFlCxR1N2r8jywWA8odJ1mNL7udqYB+S5Zb3C4Pl1WkexAKhIhkwX39poVWltzy sC9wHBNuDMv+2bWVBut4BUraPtW1E/dwJO7WL7yYWuyr3ZmxAq1tMcOIUjEAVYrd76mE YrArnUCSBVIHWJuHTx4w1CFOGOeIDc2C7hNMJn4kQ2tJE+/Wq8oKBKz9Sy20njLfkfAz Tweg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from; bh=eOI4/vBXBo5bpb7Sk3u68tsABCr8t2jUcTy75WOYP1Y=; b=K1xFxAH1m0UCW7ag2uIV0PfZ4SItaiUyI2HN3M80+ELoVAM7G+LxaVMGdMXJ9wCEev xu+7+oZecf831hqPD6gQs+kVRxSYkUAFaWChh5t62BI/CzYbHQX3lIs3DZGZuhkx6d/5 vjGJLOT+31hQxjlk2aagFE64PRW6o+3eymhhTF5rqJA6TWF/vrls6ot6kfySEnmcPCDo Fou6G1fl2ngEGKJO5DdookOcxGYs/v1TlQ6dJR/kT5WGnztn8mAy9u96l27ZZX1cxgAC SbDNoir7l0VYU3WTuipaFm6Qsr612HMfX5acmf/n5WNqKiMNLb9twTpAFvxvyF0dBbPR vkbg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d20si4115574iow.33.2022.01.11.12.00.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Jan 2022 12:00:50 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:36006 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NK5-00045n-QT for patch@linaro.org; Tue, 11 Jan 2022 15:00:49 -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 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: 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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 -static void gen_signal(CPUX86State *env, int sig, int code, abi_ptr addr) -{ - target_siginfo_t info = { - .si_signo = sig, - .si_code = code, - ._sifields._sigfault._addr = 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 addr, size_t len) } env->error_code = 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; } @@ -193,8 +182,7 @@ static void emulate_vsyscall(CPUX86State *env) return; sigsegv: - /* Like force_sig(SIGSEGV). */ - gen_signal(env, TARGET_SIGSEGV, TARGET_SI_KERNEL, 0); + force_sig(TARGET_SIGSEGV); } #endif @@ -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 == EXCP01_DB) { - gen_signal(env, TARGET_SIGTRAP, TARGET_TRAP_BRKPT, env->eip); - } 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); From patchwork Tue Jan 11 19:52:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 531142 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp3784530imp; Tue, 11 Jan 2022 12:00:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJydtjLUlLR5FK2lHtOHoOuIcbHNdgFrUc7QHT8VaLqMUw3GyEAIfb6VQJvVyCwBYN6j2SlD X-Received: by 2002:a05:6e02:1569:: with SMTP id k9mr3334236ilu.290.1641931244320; Tue, 11 Jan 2022 12:00:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641931244; cv=none; d=google.com; s=arc-20160816; b=zE/3yk7zJE3EPsj2df92rlP2dLJOHkMnC2TTqaTMjsOCKmBL4nRL7Q4cxckXTXFub8 6oSouNYxBjiYkXHbSEUIiM0dVJ+rzXU+IvUkddGJ/DiMko2Parqv9QJpI/oo6AVT05H5 fhKKBN1194vaR5k5nKAV6Ny/IG53dxyCfijoWoDEdlQh1VQJRFUvC0Q6NIrIttE6ZfXC SYCkoKc7O4hLan69yGcCy704rmrBLxT6cz2vEnhjlreFo/S6JaXFL2wgmC8CXkHuzjCd BdnQUDR+zXgFWdzSZtyQZkHInvf+eWTRu9qHejK3FQ2F1BKVROhmJBaHxzZMNOVGfOP6 vbfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from; bh=/4cr6UaZAU1ZpFAwTWraWDKwcMqSb/uPqS0jxmLENwc=; b=LX5y94v0V0fR35yxCh3nb490wClqrFO+6bj6n8O22xOV95QCFnafIDvfSNodLVqTmg wYUFStNRAlvQ4R4nBm3WJOP7JS2s3BYtxwH1K/iydQaORXyaV5OsJTHoUNWtxZbih8pF 1hwGF1kQ7dkXHJbQKtGMtv+Pc2l7syjiADNV8ZAqzwLZ1uH5LtJQHRdg1bdrDZnJNJCW CQhDuzp5Wbp8lIuVCdfdBUpU4V8vUaaskNY1FUVsJQHb3izG506DskykyGllypKN0qRO /FHoLxU4XvLdv0WmJOGykcR8JXtVWJcu33fRqzikhAy03tNURB5rEkR+WBzbvCgrEB/F m9Lg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id t15si5697169ilu.156.2022.01.11.12.00.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Jan 2022 12:00:44 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:35754 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NJz-0003v5-O4 for patch@linaro.org; Tue, 11 Jan 2022 15:00:43 -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 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: 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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 = env_cpu(env); int trapnr; unsigned int n; - target_siginfo_t info; 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 = TARGET_SIGILL; - info.si_errno = 0; - info.si_code = TARGET_ILL_ILLOPN; - info._sifields._sigfault._addr = 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 = TARGET_SIGFPE; - info.si_errno = 0; - info.si_code = TARGET_FPE_INTOVF; - info._sifields._sigfault._addr = 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 = TARGET_SIGFPE; - info.si_errno = 0; - info.si_code = TARGET_FPE_INTDIV; - info._sifields._sigfault._addr = 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 = TARGET_SIGTRAP; - info.si_errno = 0; - info.si_code = 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); From patchwork Tue Jan 11 19:52:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 531147 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp3787830imp; Tue, 11 Jan 2022 12:04:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJxkMe3imbeR+jqSIKtZdIbYl1VRHVLqDMm1PtjH9lkyTDUHs1MOP5fk4JvP56Ppry3ifhXF X-Received: by 2002:a25:dfd6:: with SMTP id w205mr5110191ybg.505.1641931479903; Tue, 11 Jan 2022 12:04:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641931479; cv=none; d=google.com; s=arc-20160816; b=WmkCAmx5utfRcmsIxqvtTmh4zWwuiQobuAjLdk205GrKtG6iFixp8kxKy24F09j7c/ uGnXVW81a9MHbVnXHbZG3xzrweFz5ODagmOkG2NuOHGZrNQDyiEu2yMojC0wK4ePqalh zdkGU1Cy//e0osLYEfgl+1DXju7vk5FzXfuATA8C/tJ4pMNZYcMUwGz4UCG3rjlso3fn 8arfyR/WO95FkAcmnWZiA1AiWpQ+8HWbjm3Gs0/Bwf+BcD+DItI/1BU/e76/7Tqm05AG 3tLvxc5JEdsDLvLzxtuK5d+/vdQA3KPQAxFmjqH2u2QwxyttOkGGTQA2tBAcOf/oWiN1 qyVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from; bh=v0TW0Hyg9/pNsDN3LZijo7yaa0H+PEvZ/wUIxEtPEPw=; b=asKCEs0HDdFqJDLp/Vq3augzqCM9JrG40xcQ/IIm8A4Y2ZuFGsJa4kBkMFS9B8StP7 zaWD25cH5oZsOYmDIlM7PN2tkmsyR9YXsqLhQ9qa0jyQ5D+E7402VO8ZyLUrurWZBy9n yDt9NdlnUetxTWoh8zjcsFrw0EvFbTZttFzxyEW2aHSnEJUeThCPo8znkAgAMX73dS4x jDi2QKDutqT6f+z2+BmUWTnV1Jz51DJYIi9pqR2EVurtaQnUpwfqMj4BZqeVHvpMkIlz hY9UEn2Gz3pYuflM1NC7ktEgf1yO3Mi0zdewmkNLVl0+TMI0X0wZgqPVA0O17K7h6jDD M3Tg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id l15si10877909ybt.501.2022.01.11.12.04.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Jan 2022 12:04:39 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:44776 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NNn-0001wA-B2 for patch@linaro.org; Tue, 11 Jan 2022 15:04:39 -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 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: 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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_loop.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 = env_cpu(env); - int trapnr, ret; - target_siginfo_t info; - + int trapnr, ret, si_code; + while (1) { cpu_exec_start(cs); trapnr = cpu_exec(cs); @@ -38,8 +37,8 @@ void cpu_loop(CPUMBState *env) 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] += 4; @@ -67,6 +66,7 @@ void cpu_loop(CPUMBState *env) */ env->regs[14] = env->pc; break; + case EXCP_HW_EXCP: env->regs[17] = env->pc + 4; if (env->iflags & D_FLAG) { @@ -74,42 +74,31 @@ void cpu_loop(CPUMBState *env) env->pc -= 4; /* FIXME: if branch was immed, replay the imm as well. */ } - env->iflags &= ~(IMM_FLAG | D_FLAG); - switch (env->esr & 31) { - case ESR_EC_DIVZERO: - info.si_signo = TARGET_SIGFPE; - info.si_errno = 0; - info.si_code = TARGET_FPE_FLTDIV; - info._sifields._sigfault._addr = 0; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); - break; - case ESR_EC_FPU: - info.si_signo = TARGET_SIGFPE; - info.si_errno = 0; - if (env->fsr & FSR_IO) { - info.si_code = TARGET_FPE_FLTINV; - } - if (env->fsr & FSR_DZ) { - info.si_code = TARGET_FPE_FLTDIV; - } - info._sifields._sigfault._addr = 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 = TARGET_FPE_FLTDIV; + break; + case ESR_EC_FPU: + si_code = 0; + if (env->fsr & FSR_IO) { + si_code = TARGET_FPE_FLTINV; + } + if (env->fsr & FSR_DZ) { + si_code = 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 = TARGET_SIGTRAP; - info.si_errno = 0; - info.si_code = 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); From patchwork Tue Jan 11 19:52:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 531146 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp3787587imp; Tue, 11 Jan 2022 12:04:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJxbwvYGUE9epwi1Xp9EuAfig87/W3Gqij4TpNJk0rzjq42XqztrWE1EwWRu9L6ccctB/+7h X-Received: by 2002:a5d:9681:: with SMTP id m1mr3136819ion.53.1641931460637; Tue, 11 Jan 2022 12:04:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641931460; cv=none; d=google.com; s=arc-20160816; b=k6U6a+cFPU3i/oOzWJavF56EWLnU9Eo9oeeDPyR0oBMemGmEc8RUUSs2QJaUZmuQZf 7Ire3U5Y+QSLBNSgr+nq+tmwEcv2BwuoSWY9o4YO3bhAoWdtTOPqYnWBE/LuNcBx3c5I mZXyTx2bGyyE1fpx+U9KtDW8CujRa7GTWV41HfqwtQMWKCxzIHCFVqcFpuTPwF8JlKpp BaLsDoXrwiK7GnDO/Ky+yxlAWWfD8h020eu8LwJ26iZ8299VPR8/4sHhId2S0HjVqbkD IYRIXizRidxqbTy6n3ULLJ7B7TihXb+U2/0U3ybc2+MoPeFiiuZC4PXvL8goC1PB3ui6 wC9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from; bh=aXRmK/TKkZseAreGbFK6D2VVQBiZf0tA8zDhJIP+P5U=; b=ZeBURvGrx67XRDGEf2Rv5ejZb345UjLTU+tb4UzyI0gfq99k00DbHnv5q9iYArp4bE EwfiUhCIQ3JL6Q8199SaHnpJEJzLcthk5JkRZXvrUrqdqkHXrBB4d7GTdxs5b2ukfpe/ 0Oko3HF1LJAwTUD0y4TdYeAha/Nz6OyjxWPLvhV7paFP6qXTFKN1NqqPmne3Ax8rDlSF JUDL3hGXyljjw+FP+cc1OiVSr39C1Z5pErXUv0Zr5fc8eauM7ngWw5b8bWTC/piN9GVz Z/vT3StVuT5qdepY5QpmjBq63SA9DTwYvefEC+t/aVjUYTwYOHMKaXchpN34O0cTDh8W 8WNg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id j18si3689943iow.83.2022.01.11.12.04.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Jan 2022 12:04:20 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:44234 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NNU-0001XM-4Y for patch@linaro.org; Tue, 11 Jan 2022 15:04:20 -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 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: 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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_loop.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 &= ~(IMM_FLAG | D_FLAG); switch (env->esr & 31) { case ESR_EC_DIVZERO: - si_code = TARGET_FPE_FLTDIV; + si_code = TARGET_FPE_INTDIV; break; case ESR_EC_FPU: - si_code = 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 = env->fsr; + if (si_code & FSR_IO) { si_code = TARGET_FPE_FLTINV; - } - if (env->fsr & FSR_DZ) { + } else if (si_code & FSR_OF) { + si_code = TARGET_FPE_FLTOVF; + } else if (si_code & FSR_UF) { + si_code = TARGET_FPE_FLTUND; + } else if (si_code & FSR_DZ) { si_code = TARGET_FPE_FLTDIV; + } else if (si_code & FSR_DO) { + si_code = TARGET_FPE_FLTRES; } break; default: From patchwork Tue Jan 11 19:52:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 531160 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp3796610imp; Tue, 11 Jan 2022 12:16:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJzvsU7KFnlQA5+YrCtQ9+lb+r3UeBRH4B2pBeOk2vKnNCeCf9iJrjVG2Z7R7XOBAAhx0Ysu X-Received: by 2002:a25:1381:: with SMTP id 123mr8416908ybt.168.1641932210466; Tue, 11 Jan 2022 12:16:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641932210; cv=none; d=google.com; s=arc-20160816; b=Bx2OUkT5zUKkEpZUKnEp+B82ZD7L3jSmGIaPX+DOxvtxCEHmkWLQoyyDAaKdttaSC3 9MnP+0h+TjK0+3Osv4sjjxZbv3UhjkDAYC+Z0czKN1kcstEom61MXt5GS4zooHw4I4Bw +EZDHvOLE0x12nJ2KXYR6M8/Upz7VgKYBRjg6EsWeN0zQoh4O05y10lV8QJv/MQ7pPYI jI8VNYrGkGHIP1jKCpK6nAlhlCVPAdSxeiJJtI/08VGBec87zMTAmkIxmLEK6m3PWLZf WHBICamkm3e8vG4Rk11HrR1BrQmo/l+7LkmQgfTDHQp0IigSPOE4n18cKObqJ7j2bDg/ hpVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from; bh=VeKnLBNgR2XmxXNL9TEb5u5QXA9csw6P4uuvWmjb10k=; b=jbr+qdFY96QXy0frKRETQNgu6ZNGX3pMRFA2veND+fCHT1p8AmeNQA5i84Iq7NuBg0 Y/m1AIYLvn6toHHP1YrdQNAHD6BFXXhY9E1EtcAx8QM3M00+GWQ5pXCzFe3Tp0035oVL 2+Jj+urO5N31AXibJB5UhDza4hCm5lhJ1QuV+DyAFM72sYUFGsoEfDhqSUBtBwTCy89n DCFCtIDei3pgZszK1R7Mv6rIMvZii172YpvRc94MBmWyvOjp/yhaqkLU8q23cdks/8I2 GI4+gvD/syMJErxzxwOGKaT5dUfJ089RwsumtwZTn5SQGw9wlKZhvG0FGS95JAV02TNh 5MtQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id g205si2878582ybg.527.2022.01.11.12.16.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Jan 2022 12:16:50 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:42600 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NZa-00031z-0p for patch@linaro.org; Tue, 11 Jan 2022 15:16:50 -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 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: 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_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , Laurent Vivier Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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é 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 = 7 }; -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 = -1; + target_ulong pc = env->active_tc.PC; switch (code) { case BRK_OVERFLOW: + force_sig_fault(TARGET_SIGFPE, TARGET_FPE_INTOVF, pc); + break; case BRK_DIVZERO: - info->si_signo = TARGET_SIGFPE; - info->si_errno = 0; - info->si_code = (code == BRK_OVERFLOW) ? FPE_INTOVF : FPE_INTDIV; - queue_signal(env, info->si_signo, QEMU_SI_FAULT, &*info); - ret = 0; + force_sig_fault(TARGET_SIGFPE, TARGET_FPE_INTDIV, pc); break; default: - info->si_signo = TARGET_SIGTRAP; - info->si_errno = 0; - queue_signal(env, info->si_signo, QEMU_SI_FAULT, &*info); - ret = 0; + if (trap) { + force_sig(TARGET_SIGTRAP); + } else { + force_sig_fault(TARGET_SIGTRAP, TARGET_TRAP_BRKPT, pc); + } break; } - - return ret; } void cpu_loop(CPUMIPSState *env) @@ -205,6 +201,13 @@ done_syscall: 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 */ @@ -257,9 +260,7 @@ done_syscall: } } - if (do_break(env, &info, code) != 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 = 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]; @@ -293,9 +301,7 @@ done_syscall: } } - if (do_break(env, &info, code) != 0) { - goto error; - } + do_tr_or_bp(env, code, true); } break; case EXCP_ATOMIC: From patchwork Tue Jan 11 19:52:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 531151 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp3790872imp; Tue, 11 Jan 2022 12:08:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJy1htruO6tq/FLCSdz85ke4hUra57BzQZ1AHDYPV+6lTCKjYg8XYTAVGx6WLcL+S0tsEw7X X-Received: by 2002:a05:6902:20f:: with SMTP id j15mr6970648ybs.235.1641931719129; Tue, 11 Jan 2022 12:08:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641931719; cv=none; d=google.com; s=arc-20160816; b=teRl60wUvI1fcGGoV6Lfz3tElZnvcEvGPrVKBDheFrMQkdqHkQoLCO/HccmxOCl9I/ voYuZXTvgiNKNp9PDG6m0SNanxt0/e84u6KaF7moB70WF5JwgU1lTnjYnKuSc3k9sta/ TRIQ7KbEAJ+fY1PdGtpZzSnvrZr9h6nnsMkqE283Taly+nwOoTS/nyJHBlgQzIIeWsDL 1ThiU6SknfSmV0kNoingb73KaWOHaEYLM+Z2hdeNyCkuw5Q3dyonHZ18O2QZpeO0ouX4 cMvXI4pFtY2UCltP/BHgCirlLmx2kHgiWEuYYLOtTSbMnp358Px4ULy1rak/vgl85HKB l5Qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from; bh=mocRKHs0gTXi7FJwPIQP0TkVLvPc1mFYj8oCZbeDGBI=; b=aIuog3NCKA+rnVa9nZ/HOCXl6h0df3M1t8wviMHCnkrjeaEzGfPeGy4UZN6VLnMnXv eT+YWRZdL9NTWtivZNLBlkwjdJjZUsx9dxzwlvDD28ME5+1TLhth4ObQbNKRYmLvIME6 ZzBB53hG12jNsizLnB7MpeuMrASw+hlDGewp2W3K8JRkio6nrjj4mgu/cHDYoQ6lHCFZ F8k3aXRl+mvc6Q9kKg+kt3o1xLEpiGGH/kQ3w6VHwD5wTl3GYHeIVHGkYwUQIB8FRjeZ W0nYB9kLtbTdAaEGKscI0H4gBZCQwThcTt/WEqP0Ik2ghtJmXh/kqZifhTbfN4z11Sq2 hW9w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id t128si7796901ybf.91.2022.01.11.12.08.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Jan 2022 12:08:39 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:53418 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NRe-0007xj-L3 for patch@linaro.org; Tue, 11 Jan 2022 15:08:38 -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 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: 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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 code, bool trap) void cpu_loop(CPUMIPSState *env) { CPUState *cs = 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 = TARGET_SIGILL; - info.si_errno = 0; - info.si_code = 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 = TARGET_SIGTRAP; - info.si_errno = 0; - info.si_code = TARGET_TRAP_BRKPT; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); - break; - case EXCP_DSPDIS: - info.si_signo = TARGET_SIGILL; - info.si_errno = 0; - info.si_code = 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 = TARGET_SIGFPE; - info.si_errno = 0; - info.si_code = TARGET_FPE_FLTUNK; + si_code = TARGET_FPE_FLTUNK; if (GET_FP_CAUSE(env->active_fpu.fcr31) & FP_INVALID) { - info.si_code = TARGET_FPE_FLTINV; + si_code = TARGET_FPE_FLTINV; } else if (GET_FP_CAUSE(env->active_fpu.fcr31) & FP_DIV0) { - info.si_code = TARGET_FPE_FLTDIV; + si_code = TARGET_FPE_FLTDIV; } else if (GET_FP_CAUSE(env->active_fpu.fcr31) & FP_OVERFLOW) { - info.si_code = TARGET_FPE_FLTOVF; + si_code = TARGET_FPE_FLTOVF; } else if (GET_FP_CAUSE(env->active_fpu.fcr31) & FP_UNDERFLOW) { - info.si_code = TARGET_FPE_FLTUND; + si_code = TARGET_FPE_FLTUND; } else if (GET_FP_CAUSE(env->active_fpu.fcr31) & FP_INEXACT) { - info.si_code = TARGET_FPE_FLTRES; + si_code = 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. */ From patchwork Tue Jan 11 19:52:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 531162 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp3798557imp; Tue, 11 Jan 2022 12:19:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJwAKn3vORH9p24KW2sjF4mEjSPwcOedMdtvUzakNIRjRSZoLd+eWC1/NEqR8alnAkq70hD1 X-Received: by 2002:a25:bacf:: with SMTP id a15mr8482014ybk.462.1641932391171; Tue, 11 Jan 2022 12:19:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641932391; cv=none; d=google.com; s=arc-20160816; b=Q/X66X2Ek8ymHgFdt7uf0m6MwzzEo7YT/3exGSbgngPDEIGq/o/pqAp3x2tE4VSbX3 ZmfhqgVDep001Cjhyxj02F9iMm8qqroCL1mplzf5rr3qx1xGlKbRn9yx3Yyx6FssnlhF HNqaTgIsgHNnAdnoWs5wzpHE59V7aGHjnPHqqigHeekjF1FR5iyCF9oIzBdZ3FO0ut5Q gZQY8GYNg6vZa8AcdHRCbzjRMtwgfJ+701YdfUsjuPdtl0nOuy+TXk8+QJgXsME866h7 ktv8eJAPsWWR0bF4wB5x0QWH1AuaK+J+dcYpeJYZYpHzUkDLHuvP5Rmr5dTbZmiBXHCm 9PVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from; bh=xW+2jsW7CcyAMj1cAaPxkFrhrSmPL1yL1A007obikb8=; b=jufnWW/iyyC1iOzsImvxC1O+5/Fy6hvvRUNrdfx53ohsHGi4IX+pAWcA4Prx1ctZSw A8X9yWoxyjKd8QxlA+AOiMb5swQxvjmeiLsyEmBnHOm5LxHoE3tIe46QyzVX2nwcvTYm Em0z6BK4qr0oJIa6bDUtF40Vuprrz2XVuIq203gZLwtyVvW9NQh/HEpxQHxUZP/9BOyQ xxzzKyJZN0SZrE8PDADjs3BaOQFQT7kszyxSLuqsjZGyg/TRbcbpg2kRd1K5uC7YsygR vd6J5lbLoKFEiI6157bnSgPcd3sIHO6NWpERFUTZhwJSvKNX52bt/e6U+mHrxIXimVHi +sDg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id q15si10920190ybu.40.2022.01.11.12.19.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Jan 2022 12:19:51 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:50518 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NcU-00006A-Kb for patch@linaro.org; Tue, 11 Jan 2022 15:19:50 -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 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: 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_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , Laurent Vivier Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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é 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 = 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 = get_user_u16(trap_instr, env->active_tc.PC); - if (ret != 0) { - goto error; - } - - if ((trap_instr >> 10) == 0x11) { - /* 16-bit instruction */ - code = trap_instr & 0xf; - } else { - /* 32-bit instruction */ - abi_ulong instr_lo; - - ret = get_user_u16(instr_lo, - env->active_tc.PC + 2); - if (ret != 0) { - goto error; - } - trap_instr = (trap_instr << 16) | instr_lo; - code = ((trap_instr >> 6) & ((1 << 20) - 1)); - /* Unfortunately, microMIPS also suffers from - the old assembler bug... */ - if (code >= (1 << 10)) { - code >>= 10; - } - } - } else { - /* MIPS16e mode */ - ret = get_user_u16(trap_instr, env->active_tc.PC); - if (ret != 0) { - goto error; - } - code = (trap_instr >> 6) & 0x3f; - } - } else { - ret = get_user_u32(trap_instr, env->active_tc.PC); - if (ret != 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 = ((trap_instr >> 6) & ((1 << 20) - 1)); - if (code >= (1 << 10)) { - code >>= 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 = env->error_code; + if (code >= (1 << 10)) { + code >>= 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/micromips_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/mips16e_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, DisasContext *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 excp) generate_exception_err(ctx, excp, 0); } +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, DisasContext *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); void check_insn(DisasContext *ctx, uint64_t flags); From patchwork Tue Jan 11 19:52:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 531141 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp3784348imp; Tue, 11 Jan 2022 12:00:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJx5lcd6hRAvaOHtf7BNmp7YrHioIZ0mS72UzDfSFdk2bZj/vOC3xCCJolyVNM2XXU71faa4 X-Received: by 2002:a05:6902:1147:: with SMTP id p7mr8613733ybu.184.1641931226217; Tue, 11 Jan 2022 12:00:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641931226; cv=none; d=google.com; s=arc-20160816; b=lMJGg2ytVd7/eD1RWUC2Z57/N2ZIHetcVf7DA81+Z6fmyUfYmQ4/s+6FFCCYks2pJR mqvGj2+VEbAz8CBY0p3gVwjNaQe+alwY6WZ1694OSl5iM6/RZCs6eZfN1t6VHU9PDCgH u+VoG6xUghD7RusbXsoM/wNPMOacwpfxiAbd1MulJjomvd5hWnP9ahWNTPMZoZpWGfKK Pm1pULM6v8FxPLl/VcVNGtoTv0fp/IAcXgybmMGjEja72kMbXaJ1uhoxpNt0tZBurDfp bxBsJWIngI/QNFSJyf0gwEseLmt7dQvvvJAhe4Nzrv9lgHmUbyNyiqTXe5H/DJRvJI0I kfzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from; bh=Z/nQEYxwJGOPFFVr6kZji+WNEbmUzDAGTxvUbxevXEk=; b=IdGLLR4Bs1ralhzqJ7yZrV/aHrIueRAL1Ff/s6Rb6BHbGxJbGEpEQJMpDCuflrXlbN aO1BrcykIDcfELfGQj+u+JUmChasrjBfXPworIJ/c9c9mCfcu3YscyxaqmPVqtseqznf w3z9ATJDLHuvGsi7BLv/d6Z2ClZkwjPCqzFL9y/wjlYTJ3OFDR2X97pgZmVJModlGNj3 uAWMCOKre824rBdzfX4UAQSY/GjwotIymTGICMfr2X9RpH4NBI5x6a05Jp9G2VEhdhUX 4w1z4o9yCxJ2aRzvTCiGQOmTnJ+KFCg2Nq4tEY34UfJNpXur3t3NJuEPjHjWWovpFNfr D4Ew== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id m184si1702299ybm.446.2022.01.11.12.00.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Jan 2022 12:00:26 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:35214 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NJh-0003Z2-5D for patch@linaro.org; Tue, 11 Jan 2022 15:00:25 -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 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: 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_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , Laurent Vivier Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Simplify cpu_loop by doing all of the decode in translate. Reviewed-by: Philippe Mathieu-Daudé 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 = 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 = get_user_u16(instr[0], env->active_tc.PC) || - get_user_u16(instr[1], env->active_tc.PC + 2); - - trap_instr = (instr[0] << 16) | instr[1]; - } else { - ret = get_user_u32(trap_instr, env->active_tc.PC); - } - - if (ret != 0) { - goto error; - } - - /* The immediate versions don't provide a code. */ - if (!(trap_instr & 0xFC000000)) { - if (env->hflags & MIPS_HFLAG_M16) { - /* microMIPS mode */ - code = ((trap_instr >> 12) & ((1 << 4) - 1)); - } else { - code = ((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/micromips_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, DisasContext *ctx, int rt, int rs) case TNE: mips32_op = 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 = OPC_TEQI; do_trapi: - gen_trap(ctx, mips32_op, rs, -1, imm); + gen_trap(ctx, mips32_op, rs, -1, imm, 0); break; case BNEZC: diff --git a/target/mips/tcg/nanomips_translate.c.inc b/target/mips/tcg/nanomips_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, /* 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 = tcg_temp_new(); @@ -4778,6 +4778,11 @@ static void gen_trap(DisasContext *ctx, uint32_t opc, case OPC_TGEU: /* rs >= rs unsigned */ case OPC_TGEIU: /* r0 >= 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 != ctx->saved_pc) { + gen_save_pc(ctx->base.pc_next); + } + if (ctx->hflags != 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, DisasContext *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); From patchwork Tue Jan 11 19:52:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 531152 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp3790907imp; Tue, 11 Jan 2022 12:08:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJwIDbUw7sUs+fjggb6MhpewFTFI8bdkDVlCE9cWIn12XxMc5YBDZfKjp9QwMEz5ZbUB+c83 X-Received: by 2002:a25:1082:: with SMTP id 124mr8169146ybq.530.1641931721613; Tue, 11 Jan 2022 12:08:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641931721; cv=none; d=google.com; s=arc-20160816; b=Al6Xp/kTIbCLkvOau/FxPqhrQVxIG2aiNyLpwPPydJDBwAZSZfGTarSQ32VrwUXLcv HprE2IRDdRpxS1iRomEPzNbeW0YoXfoW3/LR76EuPPne4LNqdXU68fyojVE5OfbrFF2U Tv4Y5/aUGSEqLJCyX6a9KA57lHfmO5WJshxPnvtZ05JLYXtSxmPswReRQtR4PIhNvNd1 5w/TIZfgroNeGLaqPrZYdYusHwfpYn0tYHYxGTm0aowyNIp01MwMryTMf8SMWdJiK3nY 3/pVGugGW6/Ykfbbcjzks48vk9qMc6U9Y09ezy91kHvLbHg9/eRSiim0JR1dYQauwMDr Q+EQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from; bh=Z849zir6geY2ICot8epPuzwtuBAvKNKy7PzqMl4QRaI=; b=mAuvzxf5dzmA9sF1xeZ184Y3voQwHhb/+qp0xagOMY6/n8braaY9iQJ3BVm5zXhIDj uM8JpbPDIw6lyfGMT18267Qpy4FGudAQ1CewHPUBS1Gj71sqSizGCMAmTtIGMK+dpudG JvufP0S1QpD3sjxrpQEHlr/dqVJ21NwkrPar0f3KJgUG3hLiS0dRyzc2u5MDoKNHQdwa ct6aCJxzAL1MGKpG1hQ/z0I8tlR/lh4g/UlIU/KUMJp2vE7MNpCe826NHX7om3UV4X+F beqoEbuBJMv8kLsN2wsmRciS5IC2zxkzwIfkbBK9fo1J7C7xBKlApbFda7dJ19ZNC5pB 3h5w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id u17si9619950ybj.113.2022.01.11.12.08.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Jan 2022 12:08:41 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:53570 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NRh-00084A-2S for patch@linaro.org; Tue, 11 Jan 2022 15:08:41 -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 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: 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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 = env_cpu(env); int trapnr; abi_long ret; - target_siginfo_t info; for (;;) { cpu_exec_start(cs); @@ -55,27 +54,16 @@ void cpu_loop(CPUOpenRISCState *env) } break; case EXCP_ALIGN: - info.si_signo = TARGET_SIGBUS; - info.si_errno = 0; - info.si_code = TARGET_BUS_ADRALN; - info._sifields._sigfault._addr = 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 = TARGET_SIGILL; - info.si_errno = 0; - info.si_code = TARGET_ILL_ILLOPC; - info._sifields._sigfault._addr = 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 = TARGET_SIGTRAP; - info.si_errno = 0; - info.si_code = 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); From patchwork Tue Jan 11 19:52:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 531154 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp3793583imp; Tue, 11 Jan 2022 12:12:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJyh1XkB3rxkn9Sf2hj79kYWpmR8T5lEOKA9Nmj4X0F6b0TZd3FGvAFDNRBmm3hLfgGimSWP X-Received: by 2002:a25:d817:: with SMTP id p23mr4710859ybg.29.1641931951405; Tue, 11 Jan 2022 12:12:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641931951; cv=none; d=google.com; s=arc-20160816; b=imMgr0lG2NopVByu/GSdztySt7kHkbTwCNKsm6jZPGFXfNCWu4Dp0sN12UWr9alJTH K+4Q2Im66c7XC0fiK+BNh4dXTqJzbQ2P/2BcF5b2CTfpEP2wPt84S7xL2obxNw91GCEU I4DSp4P3D6haytBEFp1P/cNAXqPCB0bRy15QNdVQ9aa+dszAWJZguHMpbo4AajEyJ+pm 0SysGEhloDrR9gkLfsF5dtbmo4i9+6I5hi/DO480uk5SSuKZcS4rg9knXscquwBgY18J 7Zzwq/Fx723mZUleU0/vwgAky8GS5c/ZifZt1DPSepZZNYZ6gGo6lvLbp34fqYl1IxIK vgfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from; bh=9VCgL+3LSnjBCXK6/yqaD98xQxyEFATz33sSEw/zyZw=; b=re51dXlyRtalUhD9zr9K3mt/1XMPJbfRT/mMQUCDt9y1lp3Mw3jXN+H3DEs6wjoFZ0 vcoJCvm5SgAQird1IMOlk8yIBFxyacpm8XJURQtq/SGKnPKjdOH3EnMykL+jY/aErhSC XTlwUHvRdYqkE6FahON7hmLZNADjcOT4t/j6waR2QNuKpd+4tX9aDmhoKx8PAnZmHmqh H8XIUasGExnuRuu4PyiVP1OJrG68SKz27lab7e1j+7DerMXiS1EBLSc7BxHxVJXVyJkn 6ATxcO2lxcxr5RdQXmD2JWO29pQtJ2fbC8lcOiIpE6YMyzMzpFcFIWZkPNHH9Blfddvd 21fA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id t5si2893370ybi.80.2022.01.11.12.12.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Jan 2022 12:12:31 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:33272 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NVO-0005Cd-SM for patch@linaro.org; Tue, 11 Jan 2022 15:12:30 -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 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: 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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 = env_cpu(env); - target_siginfo_t info; - int trapnr; + int trapnr, si_signo, si_code; target_ulong ret; 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 = TARGET_SIGSEGV; - info.si_errno = 0; - info.si_code = TARGET_SEGV_MAPERR; - break; - case 0x04000000: - info.si_signo = TARGET_SIGILL; - info.si_errno = 0; - info.si_code = TARGET_ILL_ILLADR; - break; - case 0x08000000: - info.si_signo = TARGET_SIGSEGV; - info.si_errno = 0; - info.si_code = 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 = TARGET_SIGSEGV; - info.si_errno = 0; - info.si_code = TARGET_SEGV_MAPERR; - break; - } - info._sifields._sigfault._addr = 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 = TARGET_SIGSEGV; - info.si_errno = 0; - info.si_code = TARGET_SEGV_MAPERR; - break; - case 0x10000000: - case 0x08000000: - info.si_signo = TARGET_SIGSEGV; - info.si_errno = 0; - info.si_code = 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 = TARGET_SIGSEGV; - info.si_errno = 0; - info.si_code = TARGET_SEGV_MAPERR; - break; - } - info._sifields._sigfault._addr = 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 = TARGET_SIGFPE; - info.si_errno = 0; + si_signo = TARGET_SIGFPE; switch (env->error_code & 0xF) { case POWERPC_EXCP_FP_OX: - info.si_code = TARGET_FPE_FLTOVF; + si_code = TARGET_FPE_FLTOVF; break; case POWERPC_EXCP_FP_UX: - info.si_code = TARGET_FPE_FLTUND; + si_code = TARGET_FPE_FLTUND; break; case POWERPC_EXCP_FP_ZX: case POWERPC_EXCP_FP_VXZDZ: - info.si_code = TARGET_FPE_FLTDIV; + si_code = TARGET_FPE_FLTDIV; break; case POWERPC_EXCP_FP_XX: - info.si_code = TARGET_FPE_FLTRES; + si_code = TARGET_FPE_FLTRES; break; case POWERPC_EXCP_FP_VXSOFT: - info.si_code = TARGET_FPE_FLTINV; + si_code = 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 = TARGET_FPE_FLTSUB; + si_code = TARGET_FPE_FLTSUB; break; default: EXCP_DUMP(env, "Unknown floating point exception (%02x)\n", env->error_code); + si_code = 0; break; } break; case POWERPC_EXCP_INVAL: - info.si_signo = TARGET_SIGILL; - info.si_errno = 0; + si_signo = TARGET_SIGILL; switch (env->error_code & 0xF) { case POWERPC_EXCP_INVAL_INVAL: - info.si_code = TARGET_ILL_ILLOPC; + si_code = TARGET_ILL_ILLOPC; break; case POWERPC_EXCP_INVAL_LSWX: - info.si_code = TARGET_ILL_ILLOPN; + si_code = TARGET_ILL_ILLOPN; break; case POWERPC_EXCP_INVAL_SPR: - info.si_code = TARGET_ILL_PRVREG; + si_code = TARGET_ILL_PRVREG; break; case POWERPC_EXCP_INVAL_FP: - info.si_code = TARGET_ILL_COPROC; + si_code = TARGET_ILL_COPROC; break; default: EXCP_DUMP(env, "Unknown invalid operation (%02x)\n", env->error_code & 0xF); - info.si_code = TARGET_ILL_ILLADR; + si_code = TARGET_ILL_ILLADR; break; } break; case POWERPC_EXCP_PRIV: - info.si_signo = TARGET_SIGILL; - info.si_errno = 0; + si_signo = TARGET_SIGILL; switch (env->error_code & 0xF) { case POWERPC_EXCP_PRIV_OPC: - info.si_code = TARGET_ILL_PRVOPC; + si_code = TARGET_ILL_PRVOPC; break; case POWERPC_EXCP_PRIV_REG: - info.si_code = TARGET_ILL_PRVREG; + si_code = TARGET_ILL_PRVREG; break; default: EXCP_DUMP(env, "Unknown privilege violation (%02x)\n", env->error_code & 0xF); - info.si_code = TARGET_ILL_PRVOPC; + si_code = TARGET_ILL_PRVOPC; break; } break; @@ -250,28 +196,19 @@ void cpu_loop(CPUPPCState *env) env->error_code); break; } - info._sifields._sigfault._addr = 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 exception */ - info.si_signo = TARGET_SIGILL; - info.si_errno = 0; - info.si_code = TARGET_ILL_COPROC; - info._sifields._sigfault._addr = 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 = TARGET_SIGILL; - info.si_errno = 0; - info.si_code = TARGET_ILL_COPROC; - info._sifields._sigfault._addr = 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 = TARGET_SIGILL; - info.si_errno = 0; - info.si_code = TARGET_ILL_COPROC; - info._sifields._sigfault._addr = 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 = TARGET_SIGILL; - info.si_errno = 0; - info.si_code = TARGET_ILL_COPROC; - info._sifields._sigfault._addr = 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] = ret; break; case EXCP_DEBUG: - info.si_signo = TARGET_SIGTRAP; - info.si_errno = 0; - info.si_code = 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 */ From patchwork Tue Jan 11 19:52:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 531150 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp3790654imp; Tue, 11 Jan 2022 12:08:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJzvk0skAzZDqkPhY6Wagwaf55Y1MjJJHBRwt0zngNB0wDz7CMZAUEbs0Gf6OLcMjInAqENo X-Received: by 2002:a05:6e02:1a86:: with SMTP id k6mr3490935ilv.223.1641931700709; Tue, 11 Jan 2022 12:08:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641931700; cv=none; d=google.com; s=arc-20160816; b=tXjFWw6himPAT+vUoPqiSthikLcdPLR72NpbefM9X1e8/8QbQQTUu9nz0s2WrzZkB/ w0Jsxnb0XItp0jBapa647VIrYhh8DFzzU//faBjYGdTjjSdTczVSsMrGUFAOYUGJ9C4Z SNWVg632f2tBjC7Vrn6mi4eqlgwDQxMzelNFAduBAFvoI51xoGJpha3FMtoczM7Y6qty 3Cb5lPaLW1BR6etf12RkObKc7Tj0TQMB0Y9yu7tjYvlQkeBgai1pSfFPog/JCypdd1iC sRAvhjphC/dRsdW9XLRmndujtz+vbLq4isXsTBUlDx06aWQpvoLAEmA5Uxn99jgt6zIe Qg2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from; bh=i6WJJvYciPXb7PzZ1CNg5m01BGPtfU1reNwO8S3mtkA=; b=bUpNWXOZ8sFrqt3hUkSUr7E70b5TR4CQeO0mZXtdbhEKlTRPxV83d985nQp1Hxj1+6 cynpP1tIhtM5+FEUBLYxkJRk3JT5n+/iYLRSloD4GqRU5UFyQKbpVwWK99EvsXVB7Kaa 5Ypanln1ju/P73IXICufdAMmxkVTmv5OiQ6Dqgm3aVoaCC8w3/wM1+7DYjtFWjbzJWiE ovmmTHWhsnwAOSpMm3Qxy3rh2Xpf49QJrIC8yikaEvd97jOLJsQuro+3NO5eUjGb1PEe OlDB8r1e/HgnMyEQgpWrmBH9qA7cNdSkww+EmcLAXBc0rHWkR5zvq58/yGaGXjsN4izt MI+g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id i2si5258003ila.77.2022.01.11.12.08.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Jan 2022 12:08:20 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:52906 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NRM-0007cl-8A for patch@linaro.org; Tue, 11 Jan 2022 15:08:20 -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 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: 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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 = env_cpu(env); - int trapnr, signum, sigcode; - target_ulong sigaddr; + int trapnr; target_ulong ret; for (;;) { @@ -40,10 +39,6 @@ void cpu_loop(CPURISCVState *env) cpu_exec_end(cs); process_queued_cpu_work(cs); - signum = 0; - sigcode = 0; - sigaddr = 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 = TARGET_SIGILL; - sigcode = TARGET_ILL_ILLOPC; + force_sig_fault(TARGET_SIGILL, TARGET_ILL_ILLOPC, env->pc); break; case RISCV_EXCP_BREAKPOINT: - signum = TARGET_SIGTRAP; - sigcode = TARGET_TRAP_BRKPT; - sigaddr = env->pc; + case EXCP_DEBUG: + gdbstep: + force_sig_fault(TARGET_SIGTRAP, TARGET_TRAP_BRKPT, env->pc); break; case RISCV_EXCP_SEMIHOST: env->gpr[xA0] = do_common_semihosting(cs); env->pc += 4; break; - case EXCP_DEBUG: - gdbstep: - signum = TARGET_SIGTRAP; - sigcode = TARGET_TRAP_BRKPT; - break; default: EXCP_DUMP(env, "\nqemu: unhandled CPU exception %#x - aborting\n", trapnr); exit(EXIT_FAILURE); } - if (signum) { - target_siginfo_t info = { - .si_signo = signum, - .si_errno = 0, - .si_code = sigcode, - ._sifields._sigfault._addr = sigaddr - }; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); - } - process_pending_signals(env); } } From patchwork Tue Jan 11 19:52:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 531145 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp3787280imp; Tue, 11 Jan 2022 12:03:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJyRK/e2XMi4wmsRax5FG3iruwvrzFO+rAqBwwr3bwYnkiYzOISipL7jMthNtnJoq1RE+hZQ X-Received: by 2002:a05:6602:1548:: with SMTP id h8mr3223159iow.14.1641931437820; Tue, 11 Jan 2022 12:03:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641931437; cv=none; d=google.com; s=arc-20160816; b=YIassJeFwGBWODi1w2o+exVfnHnIE7DRqJV64EtVmx7bGAI2UORTqoO97Aw2Fm9Ssy T9Ci7c88opwZhl9ylh7fb9tdUJMsvay+FVmkwEptoXuwGk6FmFV06v0kkvr5RlrvJAOB 3TWO5vyqKPGJScnps7fCt+oAUbdm69UuFFvl8VWiMIqsl9rECm6TqFf0VcdikWgIvHnC tpjh1q8vUm1uP672T2DcpH7T9LPSsXLHwKwGRCOO54EZUCWtK9NZg3kCttx7rXDYoYxU SqPQweq0Hk7sjLQ/24lFR+iS2qh0/5/FE+34ebOkTU52Oc/5NXaC9JeNilhPnezBDwfV MPwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from; bh=Rk4yeXlRhzEutixNtLTsh4GPw3WQrx40JylzxJGD6W4=; b=UhOVtScwtAD8r7dkSX4ltrP715bTOKYpsP7nec7COMnEwqqVTe1db2OELH5jtUddS6 Fx8p2kJFi1XMU4DAO/UYjVlmWt7lUZn1QevJ1hUEwKHm4A6jLRls8TvUXvFi57qRvZoY Uu1OFs1foBZXnVuc899Q/9suvgd0wvduPbA+Bv21c6OZEIJ9kDtoMpVqb5slbwbfoR4u kVueTYM7ejz9WTb/soI5APKWtNz3luP7+yhxQGrhDSK1RMWoBcev0mafcPTYjNErI8MU /D+Fe3m+eXU/8USisfJ0nlrtEqjvmcZlCL3oAnRgxTbay1clKS98Ma2DFOsBc6RTOcor ZVTQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id n65si4628906iof.12.2022.01.11.12.03.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Jan 2022 12:03:57 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:43792 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NN7-0001Aw-2s for patch@linaro.org; Tue, 11 Jan 2022 15:03:57 -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 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: 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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 = env_cpu(env); int trapnr, n, sig; - target_siginfo_t info; target_ulong addr; abi_long ret; @@ -158,11 +157,7 @@ void cpu_loop(CPUS390XState *env) */ env->psw.addr += env->int_pgm_ilen; do_signal: - info.si_signo = sig; - info.si_errno = 0; - info.si_code = n; - info._sifields._sigfault._addr = addr; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); + force_sig_fault(sig, n, addr); break; case EXCP_ATOMIC: From patchwork Tue Jan 11 19:52:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 531156 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp3794001imp; Tue, 11 Jan 2022 12:13:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJyZLZZeL1JFtNYIG76cVGaq7lzVk15ZkNx0Dg/2zQkQG3WUNY2PGDNCqkg+LMaIdZ2NMsgB X-Received: by 2002:a25:ba52:: with SMTP id z18mr7875760ybj.236.1641931989960; Tue, 11 Jan 2022 12:13:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641931989; cv=none; d=google.com; s=arc-20160816; b=YxqS3P9Sqen2XUK0DjR7z4SkM5cWCzC5HFGxMqJ0XjmUA1Ewot/+3k3maYJvrpUUPW Gug0bDshf3ODAMLpciHAs7S3UbYdZNwfsSH7ESv2rAgzZfJ1JKIOLAFwb2MlVewjFjyv PPTa5GjfX+zzRSmLupSdsiJPOu3Co500Q1YizkSedTBomv7Vxil2Nty/qq6Y1uJjNefs ijDzwY6I3f1EZ+Rr8zWgL0anAEBcJYJafULG3N94dLG1KV191waue2sedDt5ylQHD9ob AiXpzqZ1UBEoGT2bDlI6azY+ESMrpNuu/NZ8YlERCRy1hgF/ZinaUFW2iM1nm8siNx/C SOIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from; bh=MjLQz2nBlKionogQ0cwt2H8kkusbqadh92bC0uQAFYY=; b=T7zrOp06Awxp+f80k2sgIUCgb+4zPOHvm/i0jZhGAWN/Eg92leCjrs7xNn7MajroBr wqhpxZHlmpUI7U0rf3PF/ePl9pAFmdvehNRGlZ53JIh9b1mpoR6EPPQhL5R/z5+XWmdh d9Eaah6BVmq5en3AoIh8+0Ed8KmxkA9sQFvqHd2ntLYiKRqCiPWjLRZvg5B6U+D0BoL4 IWss8tJOXHw32WzNsQsGUXpS7Hj+qgq2IjOIkptP/O+0MbpEmheYEkc64PnZf8ybsLAD BtzMHe6EM63imZcaukbMhoPoTWU96AkJ2aVXh1Ujhlr6ggCckkyQkLG3SS2597yxtTJP DqcA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id m12si8383619ybm.602.2022.01.11.12.13.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Jan 2022 12:13:09 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:34020 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NW1-0005hx-Fd for patch@linaro.org; Tue, 11 Jan 2022 15:13:09 -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 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: 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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 = env_cpu(env); int trapnr, ret; - target_siginfo_t info; while (1) { bool arch_interrupt = 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 = TARGET_SIGTRAP; - info.si_errno = 0; - info.si_code = 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); From patchwork Tue Jan 11 19:52:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 531155 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp3793849imp; Tue, 11 Jan 2022 12:12:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJzWOIzcxYsfokjfdol3jX2Xk4CSKMgXQDDckXpS7+9TpQWufAsqP0/rpSH6IHKOLN/Upq25 X-Received: by 2002:a25:1483:: with SMTP id 125mr8566546ybu.548.1641931977396; Tue, 11 Jan 2022 12:12:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641931977; cv=none; d=google.com; s=arc-20160816; b=nxpDJsUa+bPZ1+6Md01lOT7viXHDg4q7uKEQcb8m+P9Kauw57SS9LggbRo+i+c8R49 MKWIcPHIF49oeyqt+JueJrBcKmsJfAKlWDC5kuiUmSIVyqueO5XvpVm1ZG7G4chA79It Rn9u3vqPAwBCVLuSHm0k+wTXrTY4PGxWpN2ONiY6guI7RXFI2xs0tSoFyXigqKBGMacl zj3+tOzVss7AXcH61IQ+VI/7C9kACQ6XXIghxvfB0q9UPcizWRK3Qu7CqpE5EcIcbYHE Ftci51oSrkIqJqDHu3zMkevxEzjaonkMIexkV1uKyM3SqsyjNfWlxvJes0+bl5ireLaQ Yujw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from; bh=82h90smh8L18PHO8SfKf9wuT+9TyefyO1GTXr5ZLbVg=; b=NnlZnO2NDhxA9iDFW0pP7rYLt99Prj1Knj0hxyiM9OMwFl36KEMFFxJLke2qjN4Od/ HDZAlP9TFXNEfqyPYUcNr76oZLAgYRVN9QMCReXwoFQm7ZaKux+oKj6wLUEzax7onP/K ILonOjcrQ2vJuHz/o0hsE9Hj+6zcLT3QN++9Qk/gUBzk0nu+Kf8nys32Oxp+01RBHKi3 9JokLIyX8elUSHyhB7C+8H+nHBm2LHbSPYM0xYOaIGweyZ6U1MbTIRgxq8k+avnAcPHj 5HEZynFhOWZAjV8C7QG2IjH4r+mD2gUvjEw/w2SMqL4tfYGXsd4In09nwI47zd6QiYKG XkdQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id q1si8255581ybp.228.2022.01.11.12.12.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Jan 2022 12:12:57 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:33794 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NVo-0005Xg-RJ for patch@linaro.org; Tue, 11 Jan 2022 15:12:56 -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 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: 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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 = env_cpu(env); int trapnr; abi_long ret; - target_siginfo_t info; 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 = TARGET_SIGILL; - info.si_errno = 0; - info.si_code = TARGET_ILL_ILLOPC; - info._sifields._sigfault._addr = 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 = TARGET_SIGTRAP; - info.si_errno = 0; - info.si_code = 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); From patchwork Tue Jan 11 19:52:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 531149 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp3790428imp; Tue, 11 Jan 2022 12:08:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJx/SxMSUEKn9FWXOeT55bawFO97xrBq9zvDmHG2WyPA+2yGTDmrrzOp9Yt6G57QCb8bROH2 X-Received: by 2002:a02:920a:: with SMTP id x10mr3171692jag.12.1641931681933; Tue, 11 Jan 2022 12:08:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641931681; cv=none; d=google.com; s=arc-20160816; b=bp2g4VtxeOn37w0tqoi7Coy+kd6u/jP1zGFKHBc/8NamAYJXIwsXf/1XdLw0vrqUkL x23WDxsoPhiI1AQMYerErvl6Hy4zZIWQAuwlcQkSHW6j4KlA90PmDpd25I3wL1fOARjj 0zG5CESFkeOtbcKJhdcECc1/tqXxC6PQ+eL+G/Qo4rpp7Lv2eKmOFovx5K1a89Kr8x30 0EHW1CXluGTsFUPavCNbKPF/aGX/gMcTADDlpNYVDDaTfEaCWAvT++JlQtjfUMzR+WfQ TXmAz8NFrHWBgWyVO+VINz/Qj0D2C1iyRdBw98ZQUcQTbV/r2MxYYDWmGQOasvE2Kq9p dUPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from; bh=Hk9iEpMt6K9myxrZBETTZZ42SqOTm9/tcet1HsIwmTo=; b=nmyf/Eg7clC/R0xhSN8Mur0xXT4h/SI1wRyl3WrcvbDgOT50TCzVMOwW9Q9qvhzraR k/dvVxunKGXRbItKua7DyXEroivQTy9lt7NlqheiEaxdUtdvsA0AVb/tYSiL3Um00JJF tIZ4e3nj3aqWGCionWqPTkW9aiW2KPRX5cYOwt9t3as+9LBIMPYZ58OmKRCuNogM1PyU YDibfpBIOEP2RPsobnfPpXCrVeCjh+KgaT0c7Rv23bvoMTWrgLL6jc292adhqWyHTmil 9Ns0KufPgv627h5X2nDTrz6nmWEO1HBIgaMVzl8G8rl8ERB000Gj0b955Wnblo4bIsEx peBw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id q5si5450401jaj.125.2022.01.11.12.08.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Jan 2022 12:08:01 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:52526 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NR3-0007Mg-Fl for patch@linaro.org; Tue, 11 Jan 2022 15:08:01 -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 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: 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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 = env_cpu(env); - target_siginfo_t info; abi_ulong ret; int trapnr; @@ -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 = TARGET_SIGILL; - info.si_errno = 0; - info.si_code = - env->sregs[EXCCAUSE] == ILLEGAL_INSTRUCTION_CAUSE ? - TARGET_ILL_ILLOPC : TARGET_ILL_PRVOPC; - info._sifields._sigfault._addr = 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; case SYSCALL_CAUSE: @@ -219,11 +216,8 @@ void cpu_loop(CPUXtensaState *env) break; case INTEGER_DIVIDE_BY_ZERO_CAUSE: - info.si_signo = TARGET_SIGFPE; - info.si_errno = 0; - info.si_code = TARGET_FPE_INTDIV; - info._sifields._sigfault._addr = 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; default: @@ -232,10 +226,8 @@ void cpu_loop(CPUXtensaState *env) } break; case EXCP_DEBUG: - info.si_signo = TARGET_SIGTRAP; - info.si_errno = 0; - info.si_code = 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: From patchwork Tue Jan 11 19:52:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 531163 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp3798627imp; Tue, 11 Jan 2022 12:19:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJxJi6RwpLU0EwKwJ6mMYfiGlzlGUnh5lDAkeGKLcOWY/gs1HZFE15WP38XyhL27ErOXx/C6 X-Received: by 2002:a05:6902:84:: with SMTP id h4mr5766326ybs.722.1641932396989; Tue, 11 Jan 2022 12:19:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641932396; cv=none; d=google.com; s=arc-20160816; b=Z9M8HSkpVRw55SCF4u5Ppht4iTFwL2v+Lo+NwU4PbqbGpEUIulhUzV/HQ9ML85MlW7 i8ksveJPOIIyl+ZKd0VM6QiBA/JytGwLYzHs+a7ML23mkwyXP+8DSai7ePQT/ceowkQ1 fmzUumY58yaZ3NSUF78LL7gVEG/5Mx2iFNp9/BCUU+NAfJq6NC3F/urvo+0ko11Y4VYt 8WxD8TY5uEIZunoOw8qi0cYID2bT1er6IVH9Vc8LpAd8mTX9EpImW4L4NJnwmEcccfjH MCSNMRaBkpZTfei6MuhxMMWJ69HZKUIzb5J7d3IAjxALbEtChP2l+kf/wRyOVY+7OuTB w0Mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from; bh=qXQz/15cKU8SvoeIZWESu9+ouKgsRc2rrrXf5LFIVAc=; b=QI4Vdkb7vCLxjiYtx9ACdGwRHZ+m+3KJ074OgJ8LVh7vveLkqSD0lfuGDu98QKza+e 5MDosx3HimagQpjUBjuszsfIYTpeCPa+dn5kW3kc0QOtxtgBxHRBu40RMJxh1SuOtCn/ +xn+XtezZKxdIhtm2iJVIHHuBtmxy/TbnXRLGtZ5ZvDwA+LOtbuLkL7WLoUpjp4mM6Vf gmcVpSZKSnio61iq6GFRaDpIsE9Jl6PcCtz8k4HXrQGhEBcmz8CM5u/SE1ixJJuymakR b+Tn45U46s435lWuuNglFYP+18GXGPT24UqcG1dmdGNmexiIuNotFc/510IE/OzL7Jw2 PVdw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id x8si8658064ybk.831.2022.01.11.12.19.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Jan 2022 12:19:56 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:51160 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7Nca-0000bJ-EA for patch@linaro.org; Tue, 11 Jan 2022 15:19:56 -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 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: 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_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , Laurent Vivier Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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é 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_structs.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); #if defined(TARGET_ARM) && TARGET_ABI_BITS == 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) { From patchwork Tue Jan 11 19:52:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 531161 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp3798528imp; Tue, 11 Jan 2022 12:19:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJy+0ZrC6H1fQxW5JLkQUiWSVkTedT5inted16eELRj9Ad1ZQ6/HTpVTqsWWprNrtN+O9++o X-Received: by 2002:a25:3a82:: with SMTP id h124mr3134516yba.394.1641932387766; Tue, 11 Jan 2022 12:19:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641932387; cv=none; d=google.com; s=arc-20160816; b=DPJHWIn3i6WxCeaYDjjS4Eq/sHbqlHtEqVA56+egNc8Lx+PLJF/eJ83EozfCEmeH2o rS3VDqip84K6YtTAFedY08ybVe2nvPI9Lnviu0GixJ/C0CtCn4oMevGklPU29dEVWMSd iWn2k7OFczBaCJR0sRRESuAv1NomZCx3DH6Ni1joZWXu3xocc4CatEo1FPY5z7/CBi80 5ShweJ8weAhMnPAjY2T807/bb1GjrYYbcc8JlveX9dU6F2rAWsCOXssEk5kklJqWGJ7E nkajKIymUlKZUIGLTZkrfK/c5MGjm1+XcFOOd3EkpPtlSD9sDHdTz0l3GCF7/W0m6MKU KYtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from; bh=I7wuKrstLB5CJ6ZJIJJVs/CSFX3qzy/1ZLTgyUAVD+I=; b=i9DjlBRZygQNW7rQ41xoH/ouSfargqmlnadO+ydpnbCYY1qhZeQXGONqcvbMeLqRp1 QfuXJVbOgJT6Q1XmC0HGR+rEdfJ44WsTZ+kaKXePDkQQMT4znrjUHTLBBnQrMgWlVxJU Rth6Yys2U4UGefQcyuFfJyn5oQQKBDONsjoNpiE1/wTJJ8tPCK4droa5tU74uXToFHKn QQilhHNp6vIke1iWEFpIMzAA2X3/pynDAqsDC9yvJ64f/ftXuiZ28nozvXNyIProV3jN ducUPeIjDEV8zq0DeqIxyQTwfeZnlj/7DgpEXFiQ8hXi61Fu2CD2jwcxwWQei9h3AD+3 7Bow== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id w16si4354845ybg.255.2022.01.11.12.19.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Jan 2022 12:19:47 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:50248 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NcR-0008N6-5q for patch@linaro.org; Tue, 11 Jan 2022 15:19:47 -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 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: 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_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , Laurent Vivier Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Most targets share the same generic ipc structure definitions. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé 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/target_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 == 32 - abi_ulong __unused1; -#endif - abi_ulong shm_dtime; /* time of last shmdt() */ -#if TARGET_ABI_BITS == 32 - abi_ulong __unused2; -#endif - abi_ulong shm_ctime; /* time of last change by shmctl() */ -#if TARGET_ABI_BITS == 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_structs.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_structs.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 == 32 - abi_ulong __unused1; -#endif - abi_ulong shm_dtime; /* time of last shmdt() */ -#if TARGET_ABI_BITS == 32 - abi_ulong __unused2; -#endif - abi_ulong shm_ctime; /* time of last change by shmctl() */ -#if TARGET_ABI_BITS == 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/target_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 == 32 + abi_ulong __unused1; +#endif + abi_ulong shm_dtime; /* time of last shmdt() */ +#if TARGET_ABI_BITS == 32 + abi_ulong __unused2; +#endif + abi_ulong shm_ctime; /* time of last change by shmctl() */ +#if TARGET_ABI_BITS == 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/target_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 Reserved. - * - * 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_structs.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 == 32 - abi_ulong __unused1; -#endif - abi_ulong shm_dtime; /* time of last shmdt() */ -#if TARGET_ABI_BITS == 32 - abi_ulong __unused2; -#endif - abi_ulong shm_ctime; /* time of last change by shmctl() */ -#if TARGET_ABI_BITS == 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_structs.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 == 32 - abi_ulong __unused1; -#endif - abi_ulong shm_dtime; /* time of last shmdt() */ -#if TARGET_ABI_BITS == 32 - abi_ulong __unused2; -#endif - abi_ulong shm_ctime; /* time of last change by shmctl() */ -#if TARGET_ABI_BITS == 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 == 32 - abi_ulong __unused1; -#endif - abi_ulong shm_dtime; /* time of last shmdt() */ -#if TARGET_ABI_BITS == 32 - abi_ulong __unused2; -#endif - abi_ulong shm_ctime; /* time of last change by shmctl() */ -#if TARGET_ABI_BITS == 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_structs.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 == 32 - abi_ulong __unused1; -#endif - abi_ulong shm_dtime; /* time of last shmdt() */ -#if TARGET_ABI_BITS == 32 - abi_ulong __unused2; -#endif - abi_ulong shm_ctime; /* time of last change by shmctl() */ -#if TARGET_ABI_BITS == 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/target_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 == 32 - abi_ulong __unused1; -#endif - abi_ulong shm_dtime; /* time of last shmdt() */ -#if TARGET_ABI_BITS == 32 - abi_ulong __unused2; -#endif - abi_ulong shm_ctime; /* time of last change by shmctl() */ -#if TARGET_ABI_BITS == 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_structs.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 == 32 - abi_ulong __unused1; -#endif - abi_ulong shm_dtime; /* time of last shmdt() */ -#if TARGET_ABI_BITS == 32 - abi_ulong __unused2; -#endif - abi_ulong shm_ctime; /* time of last change by shmctl() */ -#if TARGET_ABI_BITS == 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_structs.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 == 32 - abi_ulong __unused1; -#endif - abi_ulong shm_dtime; /* time of last shmdt() */ -#if TARGET_ABI_BITS == 32 - abi_ulong __unused2; -#endif - abi_ulong shm_ctime; /* time of last change by shmctl() */ -#if TARGET_ABI_BITS == 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 -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 == 32 - abi_ulong __unused1; -#endif - abi_ulong shm_dtime; /* time of last shmdt() */ -#if TARGET_ABI_BITS == 32 - abi_ulong __unused2; -#endif - abi_ulong shm_ctime; /* time of last change by shmctl() */ -#if TARGET_ABI_BITS == 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" /* The x86 definition differs from the generic one in that the * two padding fields exist whether the ABI is 32 bits or 64 bits. From patchwork Tue Jan 11 19:52:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 531157 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp3796429imp; Tue, 11 Jan 2022 12:16:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJxwTWTGlbjo0gGAb33KTumMSXL7U0r3AWKnaGcUhKIZVTYvFu94PtWg3mTmE9jFIcGEezDe X-Received: by 2002:a25:ce4b:: with SMTP id x72mr3767986ybe.532.1641932194391; Tue, 11 Jan 2022 12:16:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641932194; cv=none; d=google.com; s=arc-20160816; b=lB1kPYdxOZZ9YWQTvgEHgCj0fGSIUQ0qPGnhyJHnzWVFH3pqYojUN2eB/0ieO6Ji2n oJXOuRYI/Xwbx+OZ6CtGmLIoULvZq/KxdtNFwvxeViWoKkgc5/fBX9gIckXpBVT+fnyl /Dbe72Y9MM1+nFzeZVLK/pttIuncCOkrdQYlGc+uRJGhJWwpD10DRUvAUd6zUgvGUz+E mTS15ngUnoW8CkPYUrcXNarmUZpwz6vbUYIbhREHLHWr6O9cQqvCLYkXNXZZ40LywjGZ DHAZKnJ51+ooZSOCRLvFOPGd9ia+/d9YHfWGT4rm1UhskwyKY6ZM/Q5xKTcgEiABqQ+y hPyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from; bh=WJN/6VHB6lhlTJ2QVo8EoUhvFN/C0Qt3o+7xPEnBWI8=; b=bVzMJoKBOY5tP4zTEze++2qVVmgk6mpxo5gRQeumVFj9UviXffUvWhu/4LMI7TxCDS JsP6e3701haTaYNbyEK17GN9pIqcHF1eNacI/x/duPW94j4wklCt7/7iWN0a3bebZnn7 QrV4w7iXBXYRAgXNFzmKUsvvD0xsd80nIIfokiG7smoZmB53H32QTRk0Ls1oMviVoi6t zcvvEc3hV+7ajCHxD7w25f0bOobSABeOUpn4ucF3No6Y+UfqKlt/PgU3xMJeSwfX50QM FzeM28N+ZVm0LbYTo+qXV7sZKGLRVkf/GX0DeKwAWg2LJ3g4mpV+RAvS4G1bwjjYPx43 9p2Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id b9si8873022ybk.381.2022.01.11.12.16.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Jan 2022 12:16:34 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:41626 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NZI-0002N0-BV for patch@linaro.org; Tue, 11 Jan 2022 15:16:32 -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 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: 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson The kernel does not special-case arg2 != 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 = 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; From patchwork Tue Jan 11 19:52:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 531158 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp3796477imp; Tue, 11 Jan 2022 12:16:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJy9l2UV6t5Xd630nhLTOWppwOIUHaf7uu+TM/vO0HgXpZkPQXXwAnU1E7k4S8rdYamCSWZK X-Received: by 2002:a25:7352:: with SMTP id o79mr9084444ybc.108.1641932199794; Tue, 11 Jan 2022 12:16:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641932199; cv=none; d=google.com; s=arc-20160816; b=BwmSfj4DKmIqBzF4R48GgEwa/ZAGPadV+ajjJO1VvUsJLN3CLVzgq0YXkUcjDZM85Q Tudtb0JsH8f2W8wAinVj58AVTQJp6AuYkqGckoTcHw3zEBJ33hu0ifZBDXu5knqgPaNa KWkCerb3ZjiqdW6RbOtwElBUquS0+yUD3i7HSoWNYp5RVvkbVWhkLZ/uX9HD9r4H8987 NqDOGkQTzDCsswTZ8oiPULwI38FPoA8tWF2jSRpYM9tE/q1PyiSfZ7/1d9nUJqNvDnrT To7mcsVScx82GV+XjY5ogttqNxRBWxat7m6QRNWzYatanMGEGTt6f0Ri3hsaA2yQqLq2 li1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from; bh=6JCV1xpOBdjXhWRqxXIsLPfvTrhebf5dxTdcCTnTaxw=; b=Kd8kT3yShpaILM1TVUUqJeGzUXJQ9hBqgAbjYYMi/GEJG2xoP7WxCwSCbRlDw98BAO VnL5cMDOD44SiZZjXVC427g0PslRZjgSaM9QrqXsVOnnc8aiAsxr1NXidPqlAgPO3T5z zU3fP1EJm6+yV/8Iw8pD3XcCdiihpfq8gcRpHHx3QqnTlbZ+49tmywTLKMEjVUGM+LIH aubiYlO3MBKCP2nonI0COGQ001Gcx4jPU62DpC83L6HY2QOcq5gwEjJ219gAK7uuz9F2 DuO5VHbzFJUrcZ0AZQq7mEbz1UUIICqhvVxcCQWRHRC//XLI2pxgXbq/SEHLVmwshgPV 3jaA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 80si8233433ybd.151.2022.01.11.12.16.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Jan 2022 12:16:39 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:41988 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NZP-0002ck-7h for patch@linaro.org; Tue, 11 Jan 2022 15:16:39 -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 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: 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_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , Laurent Vivier Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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é 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 = 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; From patchwork Tue Jan 11 19:52:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 531159 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp3796582imp; Tue, 11 Jan 2022 12:16:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJzL7aU8/ixoLZBh7xxxHpFeNcU9CxyQAk0lcOEfAlCTB+Fmb/aPvoqk/Op3eaq36fjHleEG X-Received: by 2002:a25:5d0a:: with SMTP id r10mr8683560ybb.166.1641932207947; Tue, 11 Jan 2022 12:16:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641932207; cv=none; d=google.com; s=arc-20160816; b=Uwza2xYV3iyP3IWDkiEaDgVUMZH8yhrC6dLbzqIkcMUasudlmr3UisrRxDW0gXA4mX gw74JewQCH0YBoQPZk1cOEXrc0QkQ6BOPYSCKcX1eJOAbrF/JJMdMjYlhXdw3TevxiqE 40+5CO2WjFrILiv3SgJb835BjdFoxcPV3nf1xZiYfvVbLR8QEgYi9bh7XcAnVEfQZJZz L+wE7YKJpbrN9UI4MUwlJlQzj5rinb+ert4iuCjOsJI/TzD6CGDfnmFGVnqLNPvs/HRW bbItiEMV2TV7/hnYIh8luAZkWncW8gtE4WdDdr0oMFfl4AAk0rfozZpHFwDyw03jkDdF yUPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from; bh=AClNghhCdMjV8UiMeJB+iUY4dgr4zlu9MKesP7/u/VM=; b=mhr8kMRFxqParmv8nH8qgC4n+0w90oL5dMFhzj7BNV6rDwl6nPaJbOm+0rofvmuDgg 47SjP1ChH2TV/ZM+q2RDAZJOl1hVQLWJBmpXpv+VQbmjOTU5Cx1IloP8txh/io60q5yr nlOv1gJpShK6jbQmVg+SbzA6s0VQps3mYUnypcwcLpnu+btGnXyMx/tg4VXPteYKgQur FSdTdfJLrdQcHZ3Kl8VdLf1z6JHJXcxZi7gqlauVePz27fF2JRGgPGWgt6nwIh0ud9EN c3+JB/lgVF8yNVFCWeutyBo0CBP83ODiXkUJeGiEqL2WL7EzPhCUJkeXt/964o4swgSR X7hg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6si8162450ybu.832.2022.01.11.12.16.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Jan 2022 12:16:47 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:42388 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NZX-0002t5-FP for patch@linaro.org; Tue, 11 Jan 2022 15:16:47 -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 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: 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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(arg2), + arg3, arg4, arg5)); case PR_GET_NAME: { void *name = lock_user(VERIFY_WRITE, arg2, 16, 1); From patchwork Tue Jan 11 19:52:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 531164 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp3801332imp; Tue, 11 Jan 2022 12:23:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJwCws+Cq/ec8J67BkOOIx9lFR53aFKWgkiCfp605XGYM1SAhLJ/e5eeKMQRsP45oDWnqRTR X-Received: by 2002:a5b:f91:: with SMTP id q17mr8324438ybh.546.1641932628437; Tue, 11 Jan 2022 12:23:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641932628; cv=none; d=google.com; s=arc-20160816; b=Ku1SGQ8KE27iNe+tzMPk9kiNnAOxiJX1j6Ez9or0quoMtiAg4+NUEZ2rLZh9fjb9BI T3oZdjAjiwCLY+3RVXx6ChHS6wzJeUV+f4zGFxM4qTmRO2Cg2tyz4qrf0GzQr9Rvqyo8 19XDoPgbhvtim371rMz0BzUDPETJUb8oEBbw1AXH7S66Xat81AlPrK26BHylcjmGFqMM 0gDbLYaav5O1Yls1rGt5clZyrw3z0givoptQnikNtC44xShifGKCYlj0cgi+ETb99h1p iRY5SmIUnB25IGG0AS8BWMcJqoG8Ue62HafjYFGHkuty5MAo5+Qky1jYLDA0BVyh1804 yHfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from; bh=tCkUV1ba7wd1vpenImiYkKvhltL/xQRCM529MV3LkJw=; b=BW3ug+6+xY1naR7mK0ryeYc0yhltD7rnaX0+yZUYEv4VrlCtr3kEFEbBcgCNgq9/QV lys/AkgoW6zSbGCL5QkFbAEdYMsVZQn3p4AJqfR1CuUQvn2B0tPA3vtzfFDW+CDF0IVp 9C8C09ZbNI0+UFCfxeOZR1EjDySXXT/6VbAmMGNwxfv49HFCv7U4prpkWL0VU6bucAJU +cY5b0WUhLQzCsHmgpMELhB5ymOG29JSHbhkZyJkyU7hEp81nB6PGXO48yBwE4glqHXW M3F83ablpZhlTl/GtrME490gYC95yAoJBzi8TmhNLQnGPeea8KN8gBj3KHR1mUCCIoSU wXTg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id t8si7741307ybg.109.2022.01.11.12.23.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Jan 2022 12:23:48 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:59364 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7NgJ-0006GW-Ue for patch@linaro.org; Tue, 11 Jan 2022 15:23:47 -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 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: 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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_long option, abi_long arg2, case PR_SET_UNALIGN: return do_prctl_set_unalign(env, arg2); + 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: