From patchwork Thu Feb 16 05:45:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 654017 Delivered-To: patch@linaro.org Received: by 2002:adf:f90f:0:0:0:0:0 with SMTP id b15csp178379wrr; Wed, 15 Feb 2023 21:49:32 -0800 (PST) X-Google-Smtp-Source: AK7set/ggYiwwT09j/FF84vU7D4XE1TGgv+kwRvZem5VaUy8rsaDwYX9g8ze1t3kMkDclmF7X61F X-Received: by 2002:ac8:5c52:0:b0:3b8:60b9:e75e with SMTP id j18-20020ac85c52000000b003b860b9e75emr8707168qtj.4.1676526572583; Wed, 15 Feb 2023 21:49:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676526572; cv=none; d=google.com; s=arc-20160816; b=PjuBuofd6KjUzt3QR3QY/2fOv25WHME5QHEgm7yLgwOKoNi+X2P3qdsq++4LxrSomL LfgNhWQJxZTG4g/bIx4pWGxt+VbsX6nurTi7DXS69A/Nrxmaaff0Gph7EKqgpn1zZHX0 bSLLvSV2697bTqYz7LX5SsQSxoRm+yo2EAGhjCQNh28LRDiisxOgPWkE5d4zthldLBJo LSdHFqutHDyxoaG6lKBX5LVKhJe4tJeIs+FeTEcEtPiT2sWVTRARveWohvBCqOKbeSFg W8tMqsMdKiHVi9iV7lvty33CV3vs3piaSm3R4DBvrJcOjs/E68y0/vDhQPzd8DZmV+lA RoZQ== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=3/GsGOhPL6d8HonZ9tvdFyDrYuAo6ZmEKf6gpoOjRcI=; b=SCUixQypsha8gTvl549WnecEvTZfESyfYZd4eJtGn9iCC2LZH9kXnE89CGoe2pQ7cW FkfN1fmCD4sise4IOxFKPoINmPQjH8srjm7kQ3k2OOSJ7PR3C7GcZMNXoGY4Izfc0fR7 DsYiguflDa3um3bYeniUOStYwVnPKwxust19trLIyJJRpidppmEq09R9TbiOC7PGr8Ij EdccC1SyHBiHAwO8r5skRlRqd2MytW0/+zZMb5bZ9l4y5Tk7s7s1VGXZs9JsK8VLDsSC 3d8NK0YdpS8T5iap2SGsSipe/iRYqPdn/lHWxYOzXuXOxL/1BXhAKM7KQp7aVR4Fb7Hy VZmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HQB3PJLu; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id z1-20020a05622a028100b003ba26e15f75si777884qtw.478.2023.02.15.21.49.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 Feb 2023 21:49:32 -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; dkim=pass header.i=@linaro.org header.s=google header.b=HQB3PJLu; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pSX7e-0003lc-7C; Thu, 16 Feb 2023 00:47:58 -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 1pSX7c-0003l4-La for qemu-devel@nongnu.org; Thu, 16 Feb 2023 00:47:56 -0500 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pSX7b-0004wc-3T for qemu-devel@nongnu.org; Thu, 16 Feb 2023 00:47:56 -0500 Received: by mail-pl1-x62f.google.com with SMTP id ja21so953293plb.13 for ; Wed, 15 Feb 2023 21:47:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3/GsGOhPL6d8HonZ9tvdFyDrYuAo6ZmEKf6gpoOjRcI=; b=HQB3PJLuA9MUG6bqVFdMuKez6pm27N5ZO2YnZFwvyh3Tyk1OQCVJYA/rtuYcFKNbqi KlzniEAY9LyGjZ6yjdHgC0Dmna8J5Oj6sMGstpAFvY6GXjxbjaDgETFC0AE3xH4flL5S CaZjCy/NwqXBEHnvcYegxUJw5lhQtUzGzrgdzWpNCq+bqx+1QqF3DRAhR7ZNu8SC9Gt1 3s2pGoHiNDQ33wr8JDkGmd4CML/K+1xEayNJ2UX79BkYwd2d/nxAS4pXlkOktNNtu7dP D/g9sjXsQGrSupzHg+TqBXBCjbLpQIikAxFoE62/4Yzb92NNsWQfc10fiFXXgx3T1pu+ 3RBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3/GsGOhPL6d8HonZ9tvdFyDrYuAo6ZmEKf6gpoOjRcI=; b=jhX8u97O5f3vw5jgE50/17qEoRc7bCZJdaUvW5eesWzaYaYOEm3E0z/pm8yTf7dcog RH/7bvVHdZhxlxHTHyMAaF2dBg21C9eOqQK+1suPYa3TBfIn9GJRo51yNHnTbC9R6zqH +ksRoi+z3E/rEMUXHiQFGxx4JMjwPAKpObjquE8MzjlwickRwiJ0psGZ0JMqSdGA9vwV 6tmXmIwlhDAuX9/Il9ksZOBVQHFoO6bwdqzoJaLM5ctPx4/qHppCdSiD+EPkcxvK9ZPT s8ab6QbvNGEwiM58gwrtUHRHalFFvI6HuisBJQu9hegGBlCqlk4p/pbVM8KwgIHKTQD+ J8qg== X-Gm-Message-State: AO0yUKVytprh4OXl7YXWcyWOo0r/NzBdWHhfxBVNXrRoHy8b5rstggXe FUbPXU6OUuja84s0uwyxQ5RwGVfSo0Q2zCyZLoM= X-Received: by 2002:a05:6a20:244d:b0:be:b8bd:83ad with SMTP id t13-20020a056a20244d00b000beb8bd83admr5174680pzc.0.1676526473761; Wed, 15 Feb 2023 21:47:53 -0800 (PST) Received: from stoup.. (rrcs-74-87-59-234.west.biz.rr.com. [74.87.59.234]) by smtp.gmail.com with ESMTPSA id j184-20020a6380c1000000b0047917991e83sm358034pgd.48.2023.02.15.21.45.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Feb 2023 21:47:53 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: laurent@vivier.eu Subject: [PATCH v2 02/15] linux-user/sparc: Tidy syscall trap Date: Wed, 15 Feb 2023 19:45:03 -1000 Message-Id: <20230216054516.1267305-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230216054516.1267305-1-richard.henderson@linaro.org> References: <20230216054516.1267305-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62f; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-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 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é --- 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 c120c42278..d31ea057db 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],