From patchwork Wed Mar 8 13:28:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 660445 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp330112wrb; Wed, 8 Mar 2023 05:34:51 -0800 (PST) X-Google-Smtp-Source: AK7set8bWgTDwUMg1fMMIj65tsozdEEYBPBkJru4wr3pxCzJwf4DvWWc6ro9KitTEdZ5KT2BvxBy X-Received: by 2002:ad4:5f4f:0:b0:56e:b59d:2ee7 with SMTP id p15-20020ad45f4f000000b0056eb59d2ee7mr34689780qvg.47.1678282491739; Wed, 08 Mar 2023 05:34:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678282491; cv=none; d=google.com; s=arc-20160816; b=LsMZREymmziQYdfuDhCS3ncgFhJEI8uJBGsHAt78Ed01XVJHoT2yQ5JnH8b0Fs6edR XAMM3tXYshqb04nCQNdgYfqAZ6Ly9HTPsR2934XZ7M8D8Pkf144zuhJZRCxbPpGHH1HT aLaMm0VDqWNFMgTAnpf0/7RO7gEGbRKq3kMq9O2BcuKPRwCmsrqb+tXlV1+0vqG6PGm7 k+YR2bFO9G5NJBR58h0nbs7cDNRsU6ZcZ1ybWzGPga1SvvCdOLGGBV9qF1V3Fm9+v+h0 dZAtLVI5fWtvSpcNzl/ZO1X4Sfqy0wc4PoA47Vd//MYIy7MpAYtaC8Opw8smbAYBswa/ 6Dog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:ui-outboundreport :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=Q5XYsOcRuUhudChN/bURcmhRJCpRSD4fiAxXv3BImqo=; b=dGDMHHlqFqRDmjN98kcgfbOfryzDlSKSSwhpLQeJz7AbVA3ERAGckXR34YY98XZGRT 1Sc5QVHsNXy/qziGmr8MTYNrLn8wdKR2lB697+zaLlH/V/F1JDLH81Z5jBAVBHLWAIdw jbCc/P7PG7nRdV32g22ZuHpmEjViM6pKdT/qCe/6OomO2QiU1HCtlsix4dmmIfhQajgp LrxyB4fxt3TWacySRdQDz2QkMHrFf2dAh+jvPmdzP9YWLOZu8FfmqczDZE32x6JQ84+z zL5gukyL+Z0H/lcUjVKy7GX/HMvI5HWzP88MFws1V8V5wUy09kWYcGV7QYFpl8xHwbBu 73/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 14-20020a37030e000000b0073b58c32795si11702901qkd.234.2023.03.08.05.34.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 08 Mar 2023 05:34: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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pZts7-0002pL-BG; Wed, 08 Mar 2023 08:30:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pZtr1-0001k5-Vn for qemu-devel@nongnu.org; Wed, 08 Mar 2023 08:29:18 -0500 Received: from mout.kundenserver.de ([217.72.192.73]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pZtqw-00065x-G1 for qemu-devel@nongnu.org; Wed, 08 Mar 2023 08:29:11 -0500 Received: from quad ([82.142.8.70]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MvJo7-1qQtwj15ub-00rL8P; Wed, 08 Mar 2023 14:29:08 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Cc: Richard Henderson , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , Laurent Vivier Subject: [PULL 14/28] linux-user/sparc: Tidy syscall trap Date: Wed, 8 Mar 2023 14:28:43 +0100 Message-Id: <20230308132857.161793-15-laurent@vivier.eu> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230308132857.161793-1-laurent@vivier.eu> References: <20230308132857.161793-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:74NF9BUavhkFdIHGsVoV/LB4EEsOrkxuu9jm+0mN+TtQvNYJdO0 AdDTp4IRSWxakLL15TyfcChNIFxhScQxo9a2sWjGE72hnId3CV+YeBcgQ7me1JwbJV4Wq6E RBJ1QeqYKSMsChr3raQX1cAYW8ADhVsF86DYnO0PSYuR6zc0nxjyZ/zoJTZCNmx7JqaW6FE fkhlVEkC+JzZp3tzRWkEg== UI-OutboundReport: notjunk:1;M01:P0:i4ILVZGdys8=;N2XPW5mi+T0BnvbfNue5zrMgars 642QsEqtcCvy9GanTFazO16beP63+WAqplExChsv1ikGNr/JFdw1jJDCcVyBUpdjtvR4CeW2p ofqAc+bmfjJNLxLT6K3pYxI5dNlCspFXyCjYf5b/HCz4nW7noJzVrk3Cxe1+F4SofSuVLFutu Otk3aLzD2aWOUEt/PjSR03/lTSQWfnF6ytsCt2qYD+If2qe5eWRklBBYRejsM01VAQ/G9snkI 2z8xiT3Z+FfS733YDjRfjfpaGmY6PS0lC4+N46+QB12bdNNVCudvDJ/8bFfvWJqL9VhgqerZn e02gpaGhyaY1ZBlq2pKLBVllyuZ1OSwd78tvcY8qWAffR10WbjnbTgjkxJROB0uBuIdohHkY9 /c5xyciPFTF4plLs0GTF/bdo1Q+K+zy+W/ub9tu1szAUmBc6h85HpXSaNs56TyDLxhGkKWyhd vzuNnyDPRt9smmMOLNN/xXB9iMGXIO3aQWMTcVsVTi1BoDjMKECoFe07HjWa4lHHe42/J975s RYVw2FfZ6kyURZxh2R9aorqEK2fxfykXcAJqlx+wEQb4xXgdo55Zx0ShwGSXsJ0zPhhNYtzEV ZtBKsEB8K/oQcvLcbzMFTQSxDBR2mi32l5HzhZ9sK445Ee/cVCJ9l10MmTALvnMMLuoeewJY4 XD3UXUrw0EcC53c3VppVTAN6la51f4ujc6Sc5eRZUQ== 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson Use TT_TRAP. For sparc32, 0x88 is the "Slowaris" system call, currently BAD_TRAP in the kernel's ttable_32.S. For sparc64, 0x110 is tl0_linux32, the sparc32 trap, now folded into the TARGET_ABI32 case via TT_TRAP. For sparc64, there does still exist trap 0x111 as tl0_oldlinux64, which was replaced by 0x16d as tl0_linux64 in 1998. Since no one has noticed, don't bother implementing it now. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20230216054516.1267305-3-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/sparc/cpu_loop.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/linux-user/sparc/cpu_loop.c b/linux-user/sparc/cpu_loop.c index c120c422786a..d31ea057dba1 100644 --- a/linux-user/sparc/cpu_loop.c +++ b/linux-user/sparc/cpu_loop.c @@ -149,6 +149,12 @@ static void flush_windows(CPUSPARCState *env) #endif } +#ifdef TARGET_ABI32 +#define TARGET_TT_SYSCALL (TT_TRAP + 0x10) /* t_linux */ +#else +#define TARGET_TT_SYSCALL (TT_TRAP + 0x6d) /* tl0_linux64 */ +#endif + void cpu_loop (CPUSPARCState *env) { CPUState *cs = env_cpu(env); @@ -167,13 +173,7 @@ void cpu_loop (CPUSPARCState *env) } switch (trapnr) { -#ifndef TARGET_SPARC64 - case 0x88: - case 0x90: -#else - case 0x110: - case 0x16d: -#endif + case TARGET_TT_SYSCALL: ret = do_syscall (env, env->gregs[1], env->regwptr[0], env->regwptr[1], env->regwptr[2], env->regwptr[3],