From patchwork Thu Feb 2 00:51:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 649633 Delivered-To: patch@linaro.org Received: by 2002:a17:522:d8c:b0:4be:c3dc:14d8 with SMTP id d12csp609200pva; Wed, 1 Feb 2023 16:52:46 -0800 (PST) X-Google-Smtp-Source: AK7set9d7M9VKzi6bkkveNfVh83/E59op84P68FP97kEF+dJGBuydEVxuJAP2HsvUGdkcw+VDAwA X-Received: by 2002:ac8:5dcd:0:b0:3b8:5057:3776 with SMTP id e13-20020ac85dcd000000b003b850573776mr8350181qtx.13.1675299166376; Wed, 01 Feb 2023 16:52:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675299166; cv=none; d=google.com; s=arc-20160816; b=rjYmU4RuBogJLOCfy7AYSYGco1gMi86dP32BOFZisxw/P+uALHlcsfcsJshsB3VAPn Mpv4pe/q2IUch35Vnbbi3G0urcgKteB9NSvk+1C2Z3OxHikLFMeHWMXCGGKy7LDM2KHS PIIQm79zzr+LBikWUYCwh2l1R0iQQ/y/VPDWVbIVkVldLOV3nykpE7HkV9d01BDkT8MO lqbpzTJHwVZ1uebG2Wm47gBV+YlPvzMiRBrf+wBYiTlqeUALKq5+ffYAvoDfpoSDuEoH 66gi6a50pQ17kF7gHgibZegS7gZjJr0LyZXXVexdxoJd1W5EkcD/aKhzPa/cbuz3bg0V hU+w== 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=UYdAcIsSiQ4fxqXbfF/P4rINlyMeoGQOg1RWsaI41p8=; b=RQxR8U2mHaK3zO+4moGSMlWG14VJw8Wi3UJGekaX3bAnFIvR2GZ2FLfRV4Uuky7BEs KflBqGSanTG0/xTAVstDoP0TS1t2qjSmuxqK46sQKraZkViGGTZj8ZIsKC8fFqwA/zVx DE3NOCD2N/D19PBRnbrpwg4zAhY9dIJ7r5D1td5QgWdAWiIQLHQw4U/H7t0DCZJEG0+U YJ4Y8pttBT+luAVIoW0wtosiyg1Pbi408YnZa0jvEdCGzqHRhn3nTNZ27yD46WFtw0mV Tmhg+9TxO99GlxBf3qwrTdYXrm/sNvj43lZzHbHDekFwMtP9H3ANxrf2/EapeKa5Vyln nPmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="uyY+/2XZ"; 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 e10-20020a05622a110a00b003b9b1ebad56si3921357qty.669.2023.02.01.16.52.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Feb 2023 16:52:46 -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="uyY+/2XZ"; 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 1pNNpo-0005zF-7T; Wed, 01 Feb 2023 19:52:16 -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 1pNNpm-0005yh-GA for qemu-devel@nongnu.org; Wed, 01 Feb 2023 19:52:14 -0500 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pNNpk-0000Of-Uy for qemu-devel@nongnu.org; Wed, 01 Feb 2023 19:52:14 -0500 Received: by mail-pl1-x631.google.com with SMTP id 5so299729plo.3 for ; Wed, 01 Feb 2023 16:52:12 -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=UYdAcIsSiQ4fxqXbfF/P4rINlyMeoGQOg1RWsaI41p8=; b=uyY+/2XZp4/KHzW5RN7FPJQIrALQ5pJtmKV0bkdjHShkzGaevux5XDjBFcWtP/QdCU aRaq52nXrRjeHLp3OH6pX65ZdwhoLn+IMl8ho7BuWxAT8YcRp1hKOYGamQKwtouu8C3h DNVknC8KJkGxTR6mBZjAh7FjbBi5gc9+NhS70GNqerr7qdOK9p+hOvO6DZUlnr4Zqt4W wgOXZG+ATsp9VOqQ7rnur+fvCQhckeDek1ICpu7Tr790bodshP/8bhxKXvXHrxX0f26M I7wU/6QDfQqNbZyYLYzRbjZeOUS6+mJXtDxIV7t9OJv2HxZZSBIBlxtGFPCcFMMvrcVG PO0g== 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=UYdAcIsSiQ4fxqXbfF/P4rINlyMeoGQOg1RWsaI41p8=; b=D4q4RDwcJSjPi2NKQuasd2d7Ctl9E5WmytRWlURx3UOyie1ekwJS2zzu5nYFjZDwUu yduG+E8Z1XetOAztiS5xeW32qRg4Lp3mMRLzQC8xnXzaXURubRKm0dBZ+dSwM3GnJu/7 +LwmEBEyyE7lfqY+MP/cgd3tus06JAZY7w9i+wEbFsqkW4BRxAJAGMEAeM88emIhY/wZ XcjfkTQSiDB9q7Vc3SsuBTSO8tvsLuQ1fnpkIFkPcMA1VO3BoyNnG/lR3jXs+dQqb4MP 8mXIiVfKyiWPZjj8gxnqj03W+MzYhtGQMyzYM17S7uRaPTDeW7uWCRssfvW+yxz+5HVa l3Ag== X-Gm-Message-State: AO0yUKWJt80jHTQO85yycZJXIcoOTqPPAWvc2/vvhpC2Ms+4KTnjKto1 Wgk3o5q4YGIaxer9YQTo/dPjPgKQHpkPBDpL X-Received: by 2002:a17:902:d2c9:b0:198:b284:c2f4 with SMTP id n9-20020a170902d2c900b00198b284c2f4mr4288696plc.61.1675299131699; Wed, 01 Feb 2023 16:52:11 -0800 (PST) Received: from stoup.. (rrcs-173-197-98-118.west.biz.rr.com. [173.197.98.118]) by smtp.gmail.com with ESMTPSA id z3-20020a1709028f8300b00192cf87ed25sm12391334plo.35.2023.02.01.16.52.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Feb 2023 16:52:11 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, laurent@vivier.eu, iii@linux.ibm.com Subject: [PATCH 02/14] linux-user/sparc: Tidy syscall trap Date: Wed, 1 Feb 2023 14:51:52 -1000 Message-Id: <20230202005204.2055899-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230202005204.2055899-1-richard.henderson@linaro.org> References: <20230202005204.2055899-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.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, as also seen in the adjacent code. We do not implement multiple abis, so treat this as !defined(CONFIG_COMPAT), which vectors this case to BTRAP. This was presumably a typo for 0x111, which is the "old" linux64 syscall number. Both old and new linux64 syscalls traps vector to LINUX_64BIT_SYSCALL_TRAP. Signed-off-by: Richard Henderson --- linux-user/sparc/cpu_loop.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/linux-user/sparc/cpu_loop.c b/linux-user/sparc/cpu_loop.c index c120c42278..18d5c24af1 100644 --- a/linux-user/sparc/cpu_loop.c +++ b/linux-user/sparc/cpu_loop.c @@ -167,12 +167,11 @@ void cpu_loop (CPUSPARCState *env) } switch (trapnr) { -#ifndef TARGET_SPARC64 - case 0x88: - case 0x90: +#ifdef TARGET_SPARC64 + case TT_TRAP + 0x11: /* tl0_oldlinux64 */ + case TT_TRAP + 0x6d: /* tl0_linux64 */ #else - case 0x110: - case 0x16d: + case TT_TRAP + 0x10: /* t_linux */ #endif ret = do_syscall (env, env->gregs[1], env->regwptr[0], env->regwptr[1],