From nobody Wed Apr 24 15:56:34 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1675299240; cv=none; d=zohomail.com; s=zohoarc; b=jqOQRP549g49I7EDZ7mliacHDDvkOIlF4w+zSqzheF+ujuKzE6I2UcvvciAizY56YwNEoGRYL++irRnkJC7yzdP5p4WRjeEu/wE3G2Es/XWl6k3LIXnjm182Dfxkwp888DHGt8DfmEgxOdTrUe0pkMIF1TcTpOvLWJpSgf40S3Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675299240; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=0NlXg86UHyXHALJd4CNrXKqdR3YhnMuvIdL7EfthOjo=; b=DpzGFR+wU6N7cWhfm8FfqpJYj+BbV/sqBcaGniMRjZDJ0zbEvU4QYMbgNMe9wpuzpwRzxr3krS5ogfhbGkl1vPwm7+rM4MA8y+DeBk9FjeT00LG+V0wcRIVL7atdeulmmQSmOLA9+qNHdlCjV0aBAJ7UXT5+NxEy9QB1wW2JkY0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675299240397888.0012334116582; Wed, 1 Feb 2023 16:54:00 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNNpn-0005zA-5m; Wed, 01 Feb 2023 19:52:15 -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 1pNNpl-0005yH-0r for qemu-devel@nongnu.org; Wed, 01 Feb 2023 19:52:13 -0500 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pNNpj-0000OW-Dq for qemu-devel@nongnu.org; Wed, 01 Feb 2023 19:52:12 -0500 Received: by mail-pl1-x633.google.com with SMTP id d3so270874plr.10 for ; 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.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Feb 2023 16:52:09 -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=0NlXg86UHyXHALJd4CNrXKqdR3YhnMuvIdL7EfthOjo=; b=EWXTppJcRBEzev53O9g0l9etB9YMbLO90jmFC1wOnQqMkq0TgXVsPun8yhL2UUAuzo hWQYGxTtNSHpQ1iF4HrKNaIh22ie1ug4E+lEWt3mlv6eq1xWNKGlfZMqcWG/znC1ws1v ULTtODWbHfGq9YJEIFwIaquk9HV5sGLae4ceQaeam5paDnYjq+1zrkzow1UnhofBNQr6 JoEMZj9c+sJA801DRktJXk8ERjA75Wuv8NZ0xRIlIFep2HnDTma6uiPKAIwLcHq9WNbr U8aobKq+M32DTVyRKAQNPPlIQCWPzoIbBCxF0JRFlFwIlVYzupv2Ku5YzjdNsSvu3An7 Ph1A== 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=0NlXg86UHyXHALJd4CNrXKqdR3YhnMuvIdL7EfthOjo=; b=kpTGK4dDLFP1CkdiRPaTggP/WXQevJC4miN18ERsdWPiaCkrNg/isozSEsuNWUWeFq GQhq/rsovDhYO1bcjuhZV7RWD6T/ToMV0QBn7C4ItIHoHjL6rAvSW64zmaThESb4/Xx5 e5+DaPJrhD1IRCPx2uVvuLLGMhkyKLbJ3IBdyXaYq3N4YBg/K722dWccTKs3s5P6OfFf R6PmaBHBTQSUdlApCKL2E9y4gs7dS84F4NOwBC7vYfF096lwEtdbmWqc1BZu4+tDK8KC zEB3OftIh7xw6BGVnufshC2TxOlwVU9jeLwEggs0DIpPmdBl1D6604/jIaSpLgZxR4Vx kP3Q== X-Gm-Message-State: AO0yUKXqpDuOK8lMM6BONo3KS/7X1iWyG7lWzLhkrQw1QrntRlfcNmya HZ193KC7hdsMe+ciyHwK3ERg+aQOGlu3BkWp X-Google-Smtp-Source: AK7set9zMtm98wKQEsNiLzCpN2SEmB9WkPhSCjYuxuV9a2WGnv8eEEMufdD7HvfCb2e2eV5+iK3E+w== X-Received: by 2002:a17:903:234f:b0:194:4b98:42c8 with SMTP id c15-20020a170903234f00b001944b9842c8mr5512643plh.28.1675299130093; Wed, 01 Feb 2023 16:52:10 -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 01/14] linux-user/sparc: Raise SIGILL for all unhandled software traps Date: Wed, 1 Feb 2023 14:51:51 -1000 Message-Id: <20230202005204.2055899-2-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::633; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x633.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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1675299241004100009 Content-Type: text/plain; charset="utf-8" The linux kernel's trap tables vector all unassigned trap numbers to BAD_TRAP, which then raises SIGILL. Reported-by: Ilya Leoshkevich Signed-off-by: Richard Henderson Tested-by: Ilya Leoshkevich --- linux-user/sparc/cpu_loop.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/linux-user/sparc/cpu_loop.c b/linux-user/sparc/cpu_loop.c index 434c90a55f..c120c42278 100644 --- a/linux-user/sparc/cpu_loop.c +++ b/linux-user/sparc/cpu_loop.c @@ -248,6 +248,14 @@ void cpu_loop (CPUSPARCState *env) cpu_exec_step_atomic(cs); break; default: + /* + * Most software trap numbers vector to BAD_TRAP. + * Handle anything not explicitly matched above. + */ + if (trapnr >=3D TT_TRAP && trapnr <=3D TT_TRAP + 0x7f) { + force_sig_fault(TARGET_SIGILL, ILL_ILLTRP, env->pc); + break; + } fprintf(stderr, "Unhandled trap: 0x%x\n", trapnr); cpu_dump_state(cs, stderr, 0); exit(EXIT_FAILURE); --=20 2.34.1 From nobody Wed Apr 24 15:56:34 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1675299166; cv=none; d=zohomail.com; s=zohoarc; b=YmgQb+Rz83D2Apvq8UegRcpGg5imtEhBoxnGHz7mOrdYuw/vkWXjkhhvdiwSpThOk4SwFIvBZXS//I1i+c3oWKfRoz9k6x8rm3CGHdeQmxQrhACdTRrmUYY8WwxQJzt31h/b4eW7ovBIUelNMCJ5hfG+/3YMNstjKHKXMCeYzjo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675299166; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=UYdAcIsSiQ4fxqXbfF/P4rINlyMeoGQOg1RWsaI41p8=; b=EiZZo5HEjeFOjvk3cJXO4Fm7Sxg6DB3r8WjjN4YR5YnUPZJT0R6sm2zMyj1NyHyRc1R1gkwHn/16CN9HXEvM0H+vSASn01E2FuByR8SPi1eqnNJ7/R/UAu9WStFF/i1IZX+wt/04WsUUpGyCerQpTCw0P+PN2sh1PxjN8HeDr2g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675299166915143.2212445056906; Wed, 1 Feb 2023 16:52:46 -0800 (PST) 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) 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) 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-Google-Smtp-Source: AK7set9NX/Tv5Rcsb+RqINBY+h0Zvd8y1v8JVyzReCZ7fxCgquQ8PJgZlzC01cssnVYEHcurhHX7lA== 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) 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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1675299168971100003 Content-Type: text/plain; charset="utf-8" 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) } =20 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 =3D do_syscall (env, env->gregs[1], env->regwptr[0], env->regwptr[1], --=20 2.34.1 From nobody Wed Apr 24 15:56:34 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1675299258; cv=none; d=zohomail.com; s=zohoarc; b=FKgpvrtXqtY6EdTGd532MfupNUr1uYfyFRXC2MNdel6uqWngs3+37pz+KBTlEQeQL1ZG0ohp/yzrpNJU5JEdlWjhwY0fzhtpsMjmFe2HJ5ym1A/hMQYDM0t2f3GF1EL4L9gaUWl6jHXmeHFpjy2fPHiBrEhaLYzSD+3kJRm1aIw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675299258; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=JZR6v1mutzuyGZ2hYhsQ0hkbJ/my9Uu96+Z1L/w+T3g=; b=gHISkQWTgznyKnPDpgzu25RFz08pdd0IpM2quCnVV32s33zk6IUirkmWpG3R7jgZP6Vu1LD3P1uF+9GW5ldvTxnnB/qybx+TbH+Y0KG8RkVY3IAtJmuPUK7/egG5ybGUTERSSNwR9xF2Ffhm5ekDOCVhimpAPG09/DMMYssvEw0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675299258956598.0912227312664; Wed, 1 Feb 2023 16:54:18 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNNpq-0005zZ-6m; Wed, 01 Feb 2023 19:52:18 -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 1pNNpo-0005zQ-Fc for qemu-devel@nongnu.org; Wed, 01 Feb 2023 19:52:16 -0500 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pNNpn-0000Ov-09 for qemu-devel@nongnu.org; Wed, 01 Feb 2023 19:52:16 -0500 Received: by mail-pl1-x630.google.com with SMTP id r8so304890pls.2 for ; Wed, 01 Feb 2023 16:52:14 -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.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); 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=JZR6v1mutzuyGZ2hYhsQ0hkbJ/my9Uu96+Z1L/w+T3g=; b=veDlFeYBi1ccUlByKu9vxh9AcIEoYIbOME+Toqr+rMi1sjlIa0F+TbQSzJEUOsIszc myulYZAdmGljYQQLxvAZVlDuyShie7fHdqDdgjkvsKk6liUkoB3LkxC1hMM0bOgutAzc EOvWyzh1QamwS4fnKqn31AmW/zPn8+BYXLm4sQZp9zKVaFO74UOwGJzlrCk10zSSpitE 7vZ74MoSQunBnTIipn2Yd4lNddfTjLTIw7kBJjTYs1hvgwkgQ6Dnr+SrWMj91B9uA/wy yel21H/OEldnE9VrT9ptamANJA1SnW344jHqZp7qK0RM+WgP6EGw2WyDEbj0v2BauPAF rAQA== 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=JZR6v1mutzuyGZ2hYhsQ0hkbJ/my9Uu96+Z1L/w+T3g=; b=i5G/OK/VRp9nmtpYEPBNNyGJ2HJd6F5YNcfYg0DwjGBnK+Jn3VyRNRzkHmAZxEPh03 0h2ZxFjbL1/ZR5gRG4kRbfXcL84PYQ2bNbFUOyKPTrztM/+I03I6joYRXLrM+zGTFWLA dDRHg4WeJ9HPM9q+/gdhflU69V62ydiKtuCNLjmauhlJn3nxl7/quDfQGGwY7Ub95wI9 +1KFCgsTByjQlZJJoXiiw++Al4F9e7BchcJHsngD1H1J6fL2v0bRJuO5NMIf2fJNkaFa NPhLupc88dwkyU9fCOvitHwB//8HSkiuBPTrqk0e+h1mC6fTJkTP6uhvyL7cc5azFd5O UVSg== X-Gm-Message-State: AO0yUKW1aj20jifyFYLlE+acepoJjITqwHBkfH/bR02ZZ9tAs0e6mBPM Qlx/tDbXpbH4xzhlddJxD2C6dsOEt9cow5oW X-Google-Smtp-Source: AK7set9xvQgf07EWc0oWPBdBePwQy9FNJUjDQVw9nV3fEEAXQwMkFz6mLBwT2KuXiAz8fJAS8RqhdA== X-Received: by 2002:a17:902:c992:b0:198:9597:9934 with SMTP id g18-20020a170902c99200b0019895979934mr3488470plc.68.1675299133733; Wed, 01 Feb 2023 16:52:13 -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 03/14] linux-user/sparc: Use TT_TRAP for flush windows Date: Wed, 1 Feb 2023 14:51:53 -1000 Message-Id: <20230202005204.2055899-4-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::630; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x630.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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1675299261091100015 Content-Type: text/plain; charset="utf-8" The v9 and pre-v9 code can be unified with this macro. Signed-off-by: Richard Henderson --- linux-user/sparc/cpu_loop.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/linux-user/sparc/cpu_loop.c b/linux-user/sparc/cpu_loop.c index 18d5c24af1..a94bffc583 100644 --- a/linux-user/sparc/cpu_loop.c +++ b/linux-user/sparc/cpu_loop.c @@ -200,15 +200,14 @@ void cpu_loop (CPUSPARCState *env) env->pc =3D env->npc; env->npc =3D env->npc + 4; break; - case 0x83: /* flush windows */ -#ifdef TARGET_ABI32 - case 0x103: -#endif + + case TT_TRAP + 0x03: /* flush windows */ flush_windows(env); /* next instruction */ env->pc =3D env->npc; env->npc =3D env->npc + 4; break; + #ifndef TARGET_SPARC64 case TT_WIN_OVF: /* window overflow */ save_window(env); --=20 2.34.1 From nobody Wed Apr 24 15:56:34 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1675299239; cv=none; d=zohomail.com; s=zohoarc; b=NB0okmmQ0br1ep3cs3YOtpD0yNvIXeTGqlCx10GV89tXh2o9ICeyjxXpNTdC8EIPMBszqax6YqQDhGfzpX105BmaC3iEooW5LsEUsxEh5YyhzeH5VorMO2EKhap3P4FrJP0aFlDVFWx6DpuYC7OBhlZA7mgehpTqGa2Xp3n7KU8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675299239; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=89UUaeY0rrKedYNMf8jAgL7z2598RbZiMA1VfAZ8r+I=; b=PgxwYAq1JrMYtZQ3n5RD0rOFOTdEl04KJC4/dvDxFkQmWm1/95iV1BnINZ56/YtLt/xL5v5QzhWw+x9ycsyubpmetDJnpp4ewg54ZSHpD0y/yDS8kYv2j9bDn+DTxvVb+SjYKkwyX9hMJmd8KHX8m7G31kup0/Vr6nKiMrKLlM0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675299239028442.6750190535622; Wed, 1 Feb 2023 16:53:59 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNNpr-000606-PP; Wed, 01 Feb 2023 19:52:19 -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 1pNNpq-0005zg-DG for qemu-devel@nongnu.org; Wed, 01 Feb 2023 19:52:18 -0500 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pNNpo-0000P6-LD for qemu-devel@nongnu.org; Wed, 01 Feb 2023 19:52:18 -0500 Received: by mail-pj1-x102a.google.com with SMTP id e8-20020a17090a9a8800b0022c387f0f93so4033194pjp.3 for ; Wed, 01 Feb 2023 16:52:16 -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.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Feb 2023 16:52:14 -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=89UUaeY0rrKedYNMf8jAgL7z2598RbZiMA1VfAZ8r+I=; b=W3AqVJa3EyhuH3IiE4Dlqu974rTnJiX4yKGX0JHI4gR/0avYMUrBJMBATPaCV9BBkM NEs85dsBrMI0vZfqoydIm6LzjO0tc1gRFlQMNjQjL96pLI57BG9zArMrOXtroKxvG5pj NK/5LGguZ68N4iYf2gF/r+ofwYhEzfJAJBjgwJXij7lIobHAeKcB86PL1MRTVkqSL+zd aadKLm2fraR+COmnYH3Z/K1GKYN+pNvHPh5Bj7g+dJK+t0lgudrqe0+5SZRSRbpmsIVf 49/7YWS6g3NwxmhuBPwG1sM0nb1AU9JiSopYSeRAdUxznTlR/p6/nWGp9Bb5OeSdcxQV Vu4A== 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=89UUaeY0rrKedYNMf8jAgL7z2598RbZiMA1VfAZ8r+I=; b=yf+egGH8X2jnsXqto/8Jc5qErNouyhV+phcjctkbAdNeSrODYc/nItNVspsmPTmErt Q2tcZS4kI0f20qNKyERldYVr4JKC7yKDXr4IgwxjrMzb3m5a/8WTQ44TVi2hwBrZ+jFF beN92O0AUdOA7n2ICUWCpWSoHTLkeVVDCqyiEcwiFRubagw3biZfGRKLuPv8NjUf244W YmEKMGjznfbr5aCQka3meGQt1XyS/LNlddtItCx6GF6UNVvpN3EOMJZwiwVlyxT5X7Et FgzOXw0NHokr/32rNdmQBUGCZRXq49jotLOtv4+HW/BlWn/Qpj+TwIlvL9NRpwiBwQg5 cxwA== X-Gm-Message-State: AO0yUKVgS2lny8mnzpK6nsV7Aedi5W32DRbCpVVdRGGsq4/P8sDXIUM7 wgXObHNVOdUiRXLk1P/IikmjpYid9YaSz8u0 X-Google-Smtp-Source: AK7set8yFgBNXbERioKDuqrIB1/Tvvuw/Sb9HeUBbG/rqE7aQLllKd6fnF0WHGXUryEk3EZgxwkDzg== X-Received: by 2002:a17:903:283:b0:198:96d2:9181 with SMTP id j3-20020a170903028300b0019896d29181mr544014plr.56.1675299135348; Wed, 01 Feb 2023 16:52:15 -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 04/14] linux-user/sparc: Tidy window spill/fill traps Date: Wed, 1 Feb 2023 14:51:54 -1000 Message-Id: <20230202005204.2055899-5-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::102a; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102a.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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1675299241050100010 Content-Type: text/plain; charset="utf-8" Add some macros to localize the hw difference between v9 and pre-v9. Signed-off-by: Richard Henderson --- linux-user/sparc/cpu_loop.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/linux-user/sparc/cpu_loop.c b/linux-user/sparc/cpu_loop.c index a94bffc583..efc0fa64d5 100644 --- a/linux-user/sparc/cpu_loop.c +++ b/linux-user/sparc/cpu_loop.c @@ -149,6 +149,15 @@ static void flush_windows(CPUSPARCState *env) #endif } =20 +/* Avoid ifdefs below for the v9 and pre-v9 hw traps. */ +#ifdef TARGET_SPARC64 +#define TARGET_TT_SPILL TT_SPILL +#define TARGET_TT_FILL TT_FILL +#else +#define TARGET_TT_SPILL TT_WIN_OVF +#define TARGET_TT_FILL TT_WIN_UNF +#endif + void cpu_loop (CPUSPARCState *env) { CPUState *cs =3D env_cpu(env); @@ -208,20 +217,14 @@ void cpu_loop (CPUSPARCState *env) env->npc =3D env->npc + 4; break; =20 -#ifndef TARGET_SPARC64 - case TT_WIN_OVF: /* window overflow */ + case TARGET_TT_SPILL: /* window overflow */ save_window(env); break; - case TT_WIN_UNF: /* window underflow */ - restore_window(env); - break; -#else - case TT_SPILL: /* window overflow */ - save_window(env); - break; - case TT_FILL: /* window underflow */ + case TARGET_TT_FILL: /* window underflow */ restore_window(env); break; + +#ifdef TARGET_SPARC64 #ifndef TARGET_ABI32 case 0x16e: flush_windows(env); --=20 2.34.1 From nobody Wed Apr 24 15:56:34 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1675299238; cv=none; d=zohomail.com; s=zohoarc; b=B94Rmx8Lwhjg+Z5/VCNIDqeHHa6l++LK6bXc64oHftkDxK+xOVxSYkTWNfTu3KGsT5lwNEx9UmPwm3A9aNek0qSrGH2LOMDklHYNbDnFbMla0N2CxfXllg5lFbWP1KczOoJ91aI6pA4AxgrZqll3f0irTCJj6SGG4thontJXsvE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675299238; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ow3wENU3re+t6rHOFJyfUAaWZx2l8P7stWpbA0l+Q3A=; b=AK8tWzAoFKJSPBQ5btDshKIUvVoo+QBNWm8HjAJlKdMXwnLlBkUBeWs6VUuomZwGfJCDv2zkdBRZ+J0Nmojjvcew+Sdd1Ibc0AFgjnYg0f8bNSAdzeUhc7a+6OiUZf/9zhlOEZYO+R3fXe1ZYzktcXJn8ddJoWKXSsUYu/hrh+w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675299238722648.5340681947835; Wed, 1 Feb 2023 16:53:58 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNNpt-00060Y-4X; Wed, 01 Feb 2023 19:52:21 -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 1pNNps-00060M-1U for qemu-devel@nongnu.org; Wed, 01 Feb 2023 19:52:20 -0500 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pNNpq-0000PX-El for qemu-devel@nongnu.org; Wed, 01 Feb 2023 19:52:19 -0500 Received: by mail-pl1-x632.google.com with SMTP id b5so290393plz.5 for ; Wed, 01 Feb 2023 16:52:18 -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.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Feb 2023 16:52:16 -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=ow3wENU3re+t6rHOFJyfUAaWZx2l8P7stWpbA0l+Q3A=; b=Jfy1TUH59hfVsGM0a86hOYcoJ9r2E8fayGJ8ciLiC0bSynywWBW7CKoT1kdtwtop6g HtmDD+6GieiLU+7XbxSy/gTsWamrK3y4S8J0MtqmhRaZmKQKEq6m3aN1RCZNTfjruRS7 P3QvhhL2199nJg30M4TlfGe0oNxDDkytPkvik1/YQGSrQG3a3zxBwgYiiheipt65FPVt e6XyuDTp2yLLbRUOOb4B9ltUj292oxerOIJXeOtLOCuiYlCUHyyxPbYouAyxTX2dsEiH jtPt5djjIuXBQ4YxcNPHBoTDzY4rnsPxVA4D4zkWsGbJBZoJxMaGJBmuYgD3cCaBrxPE rHrg== 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=ow3wENU3re+t6rHOFJyfUAaWZx2l8P7stWpbA0l+Q3A=; b=uampcCPUHarP+oK15GCqpwOlcQqYDTRYepGiVoNbJ1qB52Jw2V/7CmB8bh/lwtzlwv O1u8kaKin3ifqKbZve8nFQkcCx9ttxSFdY0iF1lQrCcDGmk80UWVyaNfcwbfweez0Fx1 nIODLOm36jwiJ7Fp+8wEOkKuL43bvRdyv49ADxdBDGQQQocww9mDRedIG5g5vonftzkB TChMl4p/t7O0T0NIWN5yQ4goetNZ0WFg35rW+15H7NOuQ5Tmz6onJYi+hm0Nw8ZeJ1Km 72s8apT04WTq2HSstpD/9yFRQIwJpSNLOPd2a2VeGTxP7Vmm05QK7ZrpLFzuYnLxZ/zP NaXQ== X-Gm-Message-State: AO0yUKWKE8FP6T/gnTzJVv/+wLDN32AZiAKwwDAEZ81PlNk2g841Gu5R gbzcHKgXxSwmR2xjJ7eJua+Pse+3PJwZI+QV X-Google-Smtp-Source: AK7set/qAeKNfFiI5DIewdjn/SZSitD0PR9h6d7zBQhzgvG0VZ1/Z5nXRo/0D/APrB15RJdONDhzdw== X-Received: by 2002:a17:902:f252:b0:196:768a:a9ae with SMTP id j18-20020a170902f25200b00196768aa9aemr3396299plc.47.1675299137019; Wed, 01 Feb 2023 16:52:17 -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 05/14] linux-user/sparc: Fix sparc64_{get,set}_context traps Date: Wed, 1 Feb 2023 14:51:55 -1000 Message-Id: <20230202005204.2055899-6-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x632.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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1675299239021100003 Content-Type: text/plain; charset="utf-8" These traps are present for sparc64 with ilp32, aka sparc32plus. Enabling them means adjusting the defines over in signal.c, and fixing an incorrect usage of abi_ulong when we really meant the full register, target_ulong. Signed-off-by: Richard Henderson --- linux-user/sparc/cpu_loop.c | 23 +++++++++++------------ linux-user/sparc/signal.c | 36 +++++++++++++++++++----------------- 2 files changed, 30 insertions(+), 29 deletions(-) diff --git a/linux-user/sparc/cpu_loop.c b/linux-user/sparc/cpu_loop.c index efc0fa64d5..493845fe76 100644 --- a/linux-user/sparc/cpu_loop.c +++ b/linux-user/sparc/cpu_loop.c @@ -217,6 +217,17 @@ void cpu_loop (CPUSPARCState *env) env->npc =3D env->npc + 4; break; =20 +#ifdef TARGET_SPARC64 + case TT_TRAP + 0x6e: + flush_windows(env); + sparc64_get_context(env); + break; + case TT_TRAP + 0x6f: + flush_windows(env); + sparc64_set_context(env); + break; +#endif + case TARGET_TT_SPILL: /* window overflow */ save_window(env); break; @@ -224,18 +235,6 @@ void cpu_loop (CPUSPARCState *env) restore_window(env); break; =20 -#ifdef TARGET_SPARC64 -#ifndef TARGET_ABI32 - case 0x16e: - flush_windows(env); - sparc64_get_context(env); - break; - case 0x16f: - flush_windows(env); - sparc64_set_context(env); - break; -#endif -#endif case EXCP_INTERRUPT: /* just indicate that signals should be handled asap */ break; diff --git a/linux-user/sparc/signal.c b/linux-user/sparc/signal.c index b501750fe0..2be9000b9e 100644 --- a/linux-user/sparc/signal.c +++ b/linux-user/sparc/signal.c @@ -503,7 +503,23 @@ long do_rt_sigreturn(CPUSPARCState *env) return -QEMU_ESIGRETURN; } =20 -#if defined(TARGET_SPARC64) && !defined(TARGET_ABI32) +#ifdef TARGET_ABI32 +void setup_sigtramp(abi_ulong sigtramp_page) +{ + uint32_t *tramp =3D lock_user(VERIFY_WRITE, sigtramp_page, 2 * 8, 0); + assert(tramp !=3D NULL); + + default_sigreturn =3D sigtramp_page; + install_sigtramp(tramp, TARGET_NR_sigreturn); + + default_rt_sigreturn =3D sigtramp_page + 8; + install_sigtramp(tramp + 2, TARGET_NR_rt_sigreturn); + + unlock_user(tramp, sigtramp_page, 2 * 8); +} +#endif + +#ifdef TARGET_SPARC64 #define SPARC_MC_TSTATE 0 #define SPARC_MC_PC 1 #define SPARC_MC_NPC 2 @@ -575,7 +591,7 @@ void sparc64_set_context(CPUSPARCState *env) struct target_ucontext *ucp; target_mc_gregset_t *grp; target_mc_fpu_t *fpup; - abi_ulong pc, npc, tstate; + target_ulong pc, npc, tstate; unsigned int i; unsigned char fenab; =20 @@ -773,18 +789,4 @@ do_sigsegv: unlock_user_struct(ucp, ucp_addr, 1); force_sig(TARGET_SIGSEGV); } -#else -void setup_sigtramp(abi_ulong sigtramp_page) -{ - uint32_t *tramp =3D lock_user(VERIFY_WRITE, sigtramp_page, 2 * 8, 0); - assert(tramp !=3D NULL); - - default_sigreturn =3D sigtramp_page; - install_sigtramp(tramp, TARGET_NR_sigreturn); - - default_rt_sigreturn =3D sigtramp_page + 8; - install_sigtramp(tramp + 2, TARGET_NR_rt_sigreturn); - - unlock_user(tramp, sigtramp_page, 2 * 8); -} -#endif +#endif /* TARGET_SPARC64 */ --=20 2.34.1 From nobody Wed Apr 24 15:56:34 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1675299207; cv=none; d=zohomail.com; s=zohoarc; b=CUypwo5iccc30WGuJ57oTRpSjvGgLxqYwuN+8J58xlNhLCwqWdSk1tp+kS2C2VGMoRRuOZc4evZHNtGYMLxubcMG+6+xIvso4X4P2BRIJaJpOMyb0jWeRbGQM6WNPFSn+9/Gwvv2MjNlSRtV9sw8qSPuzdVADHdPySC+cO76fVg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675299207; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=OkmjatRg9OxEuhuzHdWmE9IfcduIdOzoC0jbgvrF6fo=; b=G2vPQpo4i7YoCEcaCi9SUDDf2xlqjvctqt5JJQHNfZpm+zoNwqdBUXdFVwUyYrfzMhwywvHXNRDY5oMAZqxdV3g447D6rjvQtzGKfu6REY+6Kakq0Rg6S0miVN2IyH0Uji2H1l8fismoDSgZzSiJJyWhTYhS2PcVzXnSEUibgb0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675299207727103.42044752936226; Wed, 1 Feb 2023 16:53:27 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNNpu-00060u-OG; Wed, 01 Feb 2023 19:52:22 -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 1pNNpt-00060l-HJ for qemu-devel@nongnu.org; Wed, 01 Feb 2023 19:52:21 -0500 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pNNps-0000Pm-0u for qemu-devel@nongnu.org; Wed, 01 Feb 2023 19:52:21 -0500 Received: by mail-pl1-x62b.google.com with SMTP id k13so334741plg.0 for ; Wed, 01 Feb 2023 16:52:19 -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.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Feb 2023 16:52:18 -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=OkmjatRg9OxEuhuzHdWmE9IfcduIdOzoC0jbgvrF6fo=; b=g5tcX4sa0d+dYrQOiHYR+5f7vmbqAYswxTthUtFvnGB04HGmSKVLI3Oh0kxiU9rJJL GC0yQV1+ADE/zHLDTynR12H7MAYyakK/7bqfRIPyReFwZKN6fAj8N28dJgMlfGSwBruL h33Z0dzrZ0P9c8aTFPYfMGwJYdgWT/hg/DVFQMJFr6VG3kBCGPB+GFEsMCi/vkMdeRCt gd5bQhkVmcW/dgq1pJ8gd4pmXshf8R6/7/uTmOCRyvrW5d2I7jIWkeFuWBBBAht6f5fR tO2biHiHmPtL7LvxlnGc/OrEA5vCLxMT2NeS5C6b3bfVQG5WIKvUr6yc/bcCKuCquKPV jQUQ== 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=OkmjatRg9OxEuhuzHdWmE9IfcduIdOzoC0jbgvrF6fo=; b=LmwFJeQRfOLQX/VqsZwy32TsxBidK3UKV7I3gomptxa9R3SX5PG3TleVT6Y4acFtl4 m90S7Jmc/RaTKZLLoM4RPJk9ofHTfBqNecJM+0FtgpNhiTvnlRA/D0GmmyOcGkuo5mma JS0RkrCZwTrHhhatlM9AqepU6YeY6XABjIOL2K6rj6BFPJrvlSUZq7CPctICvq3rZH56 tqsAvKSMfUc7BFzqrR9TzMVr2BZgQmpJbiRBQMEM947q3p5E+TeSktLuSSrMg9j4Nk1B vMaOddeUIaZYtyjS5vqg6Re3jVKYEizpTQPTQWqKrmItyd/lBoGFOWD7He4xoqFrobR3 HS0g== X-Gm-Message-State: AO0yUKVwrLXrmWvNqO7o2CoGAYXEVeNQJTWNDMCBeQfEXPa73Wce17ie a+mkzxmEebx1Qs/Wet+DcNC4qiVg4cmok6cP X-Google-Smtp-Source: AK7set9G3JjayOq7h0sSNZ/wRVCiQHwmkqUZcI/tnBl+b+edYFDtdCLUul+8EvArrHXQBQb+b8fp8g== X-Received: by 2002:a17:902:cf08:b0:194:a6e0:3ba with SMTP id i8-20020a170902cf0800b00194a6e003bamr4933377plg.54.1675299138665; Wed, 01 Feb 2023 16:52:18 -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 06/14] linux-user/sparc: Handle software breakpoint trap Date: Wed, 1 Feb 2023 14:51:56 -1000 Message-Id: <20230202005204.2055899-7-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62b.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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1675299208912100006 Content-Type: text/plain; charset="utf-8" This is 'ta 1' for both v9 and pre-v9. Signed-off-by: Richard Henderson --- linux-user/sparc/cpu_loop.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/linux-user/sparc/cpu_loop.c b/linux-user/sparc/cpu_loop.c index 493845fe76..573d97c60b 100644 --- a/linux-user/sparc/cpu_loop.c +++ b/linux-user/sparc/cpu_loop.c @@ -210,6 +210,11 @@ void cpu_loop (CPUSPARCState *env) env->npc =3D env->npc + 4; break; =20 + case TT_TRAP + 0x01: /* breakpoint */ + case EXCP_DEBUG: + force_sig_fault(TARGET_SIGTRAP, TARGET_TRAP_BRKPT, env->pc); + break; + case TT_TRAP + 0x03: /* flush windows */ flush_windows(env); /* next instruction */ @@ -241,9 +246,6 @@ void cpu_loop (CPUSPARCState *env) case TT_ILL_INSN: force_sig_fault(TARGET_SIGILL, TARGET_ILL_ILLOPC, env->pc); break; - case EXCP_DEBUG: - force_sig_fault(TARGET_SIGTRAP, TARGET_TRAP_BRKPT, env->pc); - break; case EXCP_ATOMIC: cpu_exec_step_atomic(cs); break; --=20 2.34.1 From nobody Wed Apr 24 15:56:34 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1675299256; cv=none; d=zohomail.com; s=zohoarc; b=jkoaQ65oliMazus01SJ//Xjrxax/6XNL2IauXQAwHMDu1hU9aKjekKDVLxObIxA5RZCz58a/hlg78IvKX+ppx0NpAo2Qh6ALlHbMEQu84139Ga0dP22xSjEee54Qdf6iyJiOimiFUIUyXzLBQfK9pvHQwykQ+cR891NYsa06Rjc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675299256; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=B4jgsV9G6+y0a5q4tkqKuMYyQTrPsge9HTujb3pFb78=; b=IsPMWS/8cY0nRDjOvpr1dqlVwJBPgAuzd8s5jBwmxusOIaoQlwyS9woNOatCmi50xlRQ6YcqJaGSOWA+IPehpO9yQF0QIIfNsjDF5cJ+UYe3/pNzCCrcccqEYS9FDCwDxr5ftigjvMRKDqTBMAQ46C3A/vtwiaPTlb/LqdfrbtQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675299256510809.0990525474805; Wed, 1 Feb 2023 16:54:16 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNNpv-00061J-UG; Wed, 01 Feb 2023 19:52: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 1pNNpv-00060v-8g for qemu-devel@nongnu.org; Wed, 01 Feb 2023 19:52:23 -0500 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pNNpt-0000Q5-Lm for qemu-devel@nongnu.org; Wed, 01 Feb 2023 19:52:22 -0500 Received: by mail-pj1-x102e.google.com with SMTP id cq16-20020a17090af99000b0022c9791ac39so4035515pjb.4 for ; Wed, 01 Feb 2023 16:52:21 -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.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Feb 2023 16:52:19 -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=B4jgsV9G6+y0a5q4tkqKuMYyQTrPsge9HTujb3pFb78=; b=oyGat0RZYbBMgrafQwlMAk+EzPaep1cTa3gPHJNzSfJ143bzHIbQerH1v2bzSETwI4 p15LNFW/A67VSelmLiN9M5Tbdbu3Pbd2tTGTb+8xCNOHsZTzXls0bnLEYnjhyoFcbR9m X0bOK4jHZjzjQhL2PVtI9nT5BdXviyG3xP0IvVD+EuiEpeoQozYANfgnqKjLwjCbPkNZ TsXailbg/lcPWOjDf2XiJ4rAHrd3qNT8cEp06zPDXI7QzMW3QCxdmK2Rv29nIPgu60tW GvclfVt9EdZCf1OfLbApH9lS7YKTxHxeafepixGv9FFwRgN7fyvogvTsHWLGwEIt+jDw 7Q6w== 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=B4jgsV9G6+y0a5q4tkqKuMYyQTrPsge9HTujb3pFb78=; b=kYLAKLuagXWDOfBk3347RF8gf+zyOmxmIQN0m3cQ1zKxZ6/hNLB6wNr0/yZwboBkOY hIqoj3YaPnTPlSFwtF/qo5VSG/Uk4us3Y2i6J4B09UDC3zrEpuSaaQB97wViFEd3BeOQ SAX49XJit1l15roB8kc8W3zWWp/irayPGkuYBR6ymXKh0LzvD537EjxwvHGUAaLfInCz gNu6+aXfqM8sPxAIhxeHphC11wKLyDIIP0E9jC7amnaKMx+cIG3j8eBm8QRIydvPeSsS Yo4Fmd93a3kQhiuVIc4WFwL7ZFX3BiZ7QiwC3Bryby4yiGc4mZpUKNKe7012gLtQ9/l3 ZPHA== X-Gm-Message-State: AO0yUKWYXU/6qZQKK40J8bWY5rTsEcxo3VZjjlOd/tsYrUOMfM7aAcU5 omM7hfBEi9qpJOAO28jMbYz0qpGV5WSjNSXF X-Google-Smtp-Source: AK7set8O/rZTDYT1HPLuia+G37Vlb1ylRDEC7j1UUaOBWlI/1Dt3/ls/+S+8mfsXsc6wG4BPsLNK3A== X-Received: by 2002:a17:902:ea0a:b0:196:b66:eb74 with SMTP id s10-20020a170902ea0a00b001960b66eb74mr641603plg.57.1675299140441; Wed, 01 Feb 2023 16:52:20 -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 07/14] linux-user/sparc: Handle division by zero traps Date: Wed, 1 Feb 2023 14:51:57 -1000 Message-Id: <20230202005204.2055899-8-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::102e; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102e.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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1675299257033100006 Content-Type: text/plain; charset="utf-8" In addition to the hw trap vector, there is a software trap assigned for older sparc without hw division instructions. Signed-off-by: Richard Henderson --- linux-user/sparc/cpu_loop.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/linux-user/sparc/cpu_loop.c b/linux-user/sparc/cpu_loop.c index 573d97c60b..398418174f 100644 --- a/linux-user/sparc/cpu_loop.c +++ b/linux-user/sparc/cpu_loop.c @@ -215,6 +215,11 @@ void cpu_loop (CPUSPARCState *env) force_sig_fault(TARGET_SIGTRAP, TARGET_TRAP_BRKPT, env->pc); break; =20 + case TT_TRAP + 0x02: /* div0 */ + case TT_DIV_ZERO: + force_sig_fault(TARGET_SIGFPE, TARGET_FPE_INTDIV, env->pc); + break; + case TT_TRAP + 0x03: /* flush windows */ flush_windows(env); /* next instruction */ --=20 2.34.1 From nobody Wed Apr 24 15:56:34 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1675299258; cv=none; d=zohomail.com; s=zohoarc; b=aIvrVdlIiUlYLfqDHKNyKh5p9/WRVODYHy3fmAtcm/GetbSrNhakG05luQVPZ6ZqLQ0BB0F+Df2Ad7KYGHgh8SKZ0d+GkznUpX/HNB1z9k/s1BV6R6GPT3y0IHojKR4WcDuKE1nv6Ptre2CF1G5tVUCdbJt/r0VRL/WvO59x7kQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675299258; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=7p89/1SscirMpmVjsVuG7CRSn1YGBHWjDAFStdyXspc=; b=FH+IghbYjC2MF7hQBcUf9mQTYsb+A3wNyoqeNlmzX1X/oIT8+csjj4OJX4taA9b2j2F/cW6piKIWMZaHdSuSYdG1afbAmZTj6Oy2+ToIbueZrF0iuo6z509LzApenl+fTprAArAjNFAOgsBTHgtWb3K4AHKRcHP26sy3QrO2lwY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675299258418288.28709100924937; Wed, 1 Feb 2023 16:54:18 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNNpy-00067W-H4; Wed, 01 Feb 2023 19:52:26 -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 1pNNpw-00061g-VF for qemu-devel@nongnu.org; Wed, 01 Feb 2023 19:52:24 -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 1pNNpv-0000QM-9O for qemu-devel@nongnu.org; Wed, 01 Feb 2023 19:52:24 -0500 Received: by mail-pl1-x62f.google.com with SMTP id jh15so279372plb.8 for ; Wed, 01 Feb 2023 16:52:22 -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.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Feb 2023 16:52:21 -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=7p89/1SscirMpmVjsVuG7CRSn1YGBHWjDAFStdyXspc=; b=VeLDJeeFGoovUH+Cmgb7vAgJ4dSqjAn0GL7kb64hFDLz2y9m8IP/fDOjs4s++j1Xkd PrF9IRlht5UUD1RFSuMUtqpht/rzZ9O95nMkLNfVaiiNVuVRJrn80DfP0+Onz03hipPF VbRlPGviaHjvsEe14wtC3RCLHBMT1713+BZ+qMUcZuu/GGeZRHdVLL6YJWDsDtz8uKoM 3Us/us+EsHV+r4z7quIL5TU9t8bu7AkELkmBrk4hudzi+S0pxlWZ4fpBytqJc7s81Gj6 isjcKr3Ga4q/6Vj/KdOJwkW18FKQ8einGYg7cDJOmyPT40dd3dDdHZtMLx7TxN5nNpf8 jS+A== 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=7p89/1SscirMpmVjsVuG7CRSn1YGBHWjDAFStdyXspc=; b=1CiNJj/U35XgkeeuP3sNuHqVT4GkI4LHCZCg66EUJhUCtBQFh5/iOikY+g2M1iKltt nlBK8vockEILe616AGW8T5BY/ntNcRXv+DjUfC3UtW5SSH87Qxq8r+OnIOYxQ1a/5hFh Mk5V38bAuXgP72vl0fmEWQlzx++iaGxMe9q9EuKlc3gpynU3fI0qHl/bYixvq1FxHhhP EFo1YH6YpcbWwqKiGZGvDgLKH6R6nadf615TRbSVTr5ZWV3GwQBvPJts7U15Acfces9h PLBEx6/HTbr/qoYo0aZUi/RJtnK+GDlOtas1xPZod+m3aK7Dot3PLrhwhdxEmxIGSCAn 8zmA== X-Gm-Message-State: AO0yUKXk6k9rOPvJG6Le8rTZ9um9RsVG/eYXWvclTcZDhMRGeyKk/rUl IZ5L/5pCmWGjOESPnHzd2WbR3wujkpA4DXKb X-Google-Smtp-Source: AK7set9Y+q1snmgQXy0fmbU2d6zCaU5Da2OTWxJqdYHAbASTEnv1Qp05CDswMJDipHo/Hfmk0XRQUQ== X-Received: by 2002:a17:903:2342:b0:196:595b:2580 with SMTP id c2-20020a170903234200b00196595b2580mr6019358plh.0.1675299142047; Wed, 01 Feb 2023 16:52:22 -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 08/14] linux-user/sparc: Handle getcc, setcc, getpsr traps Date: Wed, 1 Feb 2023 14:51:58 -1000 Message-Id: <20230202005204.2055899-9-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1675299259124100011 Content-Type: text/plain; charset="utf-8" These are really only meaningful for sparc32, but they're still present for backward compatibility for sparc64. Signed-off-by: Richard Henderson --- linux-user/sparc/cpu_loop.c | 62 +++++++++++++++++++++++++++++++++++-- 1 file changed, 59 insertions(+), 3 deletions(-) diff --git a/linux-user/sparc/cpu_loop.c b/linux-user/sparc/cpu_loop.c index 398418174f..370eb4e1a1 100644 --- a/linux-user/sparc/cpu_loop.c +++ b/linux-user/sparc/cpu_loop.c @@ -149,6 +149,51 @@ static void flush_windows(CPUSPARCState *env) #endif } =20 +static void next_instruction(CPUSPARCState *env) +{ + env->pc =3D env->npc; + env->npc =3D env->npc + 4; +} + +static uint32_t do_getcc(CPUSPARCState *env) +{ +#ifdef TARGET_SPARC64 + return cpu_get_ccr(env) & 0xf; +#else + return extract32(cpu_get_psr(env), 20, 4); +#endif +} + +static void do_setcc(CPUSPARCState *env, uint32_t icc) +{ +#ifdef TARGET_SPARC64 + cpu_put_ccr(env, (cpu_get_ccr(env) & 0xf0) | (icc & 0xf)); +#else + cpu_put_psr(env, deposit32(cpu_get_psr(env), 20, 4, icc)); +#endif +} + +static uint32_t do_getpsr(CPUSPARCState *env) +{ +#ifdef TARGET_SPARC64 + const uint64_t TSTATE_CWP =3D 0x1f; + const uint64_t TSTATE_ICC =3D 0xfull << 32; + const uint64_t TSTATE_XCC =3D 0xfull << 36; + const uint32_t PSR_S =3D 0x00000080u; + const uint32_t PSR_V8PLUS =3D 0xff000000u; + uint64_t tstate =3D sparc64_tstate(env); + + /* See , tstate_to_psr. */ + return ((tstate & TSTATE_CWP) | + PSR_S | + ((tstate & TSTATE_ICC) >> 12) | + ((tstate & TSTATE_XCC) >> 20) | + PSR_V8PLUS); +#else + return (cpu_get_psr(env) & (PSR_ICC | PSR_CWP)) | PSR_S; +#endif +} + /* Avoid ifdefs below for the v9 and pre-v9 hw traps. */ #ifdef TARGET_SPARC64 #define TARGET_TT_SPILL TT_SPILL @@ -222,9 +267,20 @@ void cpu_loop (CPUSPARCState *env) =20 case TT_TRAP + 0x03: /* flush windows */ flush_windows(env); - /* next instruction */ - env->pc =3D env->npc; - env->npc =3D env->npc + 4; + next_instruction(env); + break; + + case TT_TRAP + 0x20: /* getcc */ + env->gregs[1] =3D do_getcc(env); + next_instruction(env); + break; + case TT_TRAP + 0x21: /* setcc */ + do_setcc(env, env->gregs[1]); + next_instruction(env); + break; + case TT_TRAP + 0x22: /* getpsr */ + env->gregs[1] =3D do_getpsr(env); + next_instruction(env); break; =20 #ifdef TARGET_SPARC64 --=20 2.34.1 From nobody Wed Apr 24 15:56:34 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1675299221; cv=none; d=zohomail.com; s=zohoarc; b=cwpyLJn1kH4SK1ChMDWgjQwmxzrJ74ab6QMBJzwSO51DJhnI6Epud4ZhzWKzUz8eRPUJbHxF5lfONqcbfI0ESrI+hxei5LVjtopOnAJQX9gpSqXgjJhEuUFiJ6x1QSCar/TUj3dHVxstkX0pP5zMqvla2biL+jv+2qczvcNxApQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675299221; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=uGDFqs4b4PgNASJU8FaMgpzRM7ATeSa1LZg6XuMJWq4=; b=bcKPcMYtVmB0zy9OVW58ijtCngWV4R/PGCV3YsfMacoU5jU1nd1i7y2h+QupDOBqnWZFoKFffAcWGB1lYtGWRLBxIu8MMnjOWx6NHroAWZRpI0QnLeRYjBxc9eDkBTyYTNhqLv9DDc1LuKo5KX4N6vE5FyHPG3413JAPcj/ioC8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675299221678988.4550345806591; Wed, 1 Feb 2023 16:53:41 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNNq0-0006BM-Ik; Wed, 01 Feb 2023 19:52:28 -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 1pNNpy-00068l-UG for qemu-devel@nongnu.org; Wed, 01 Feb 2023 19:52:27 -0500 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pNNpx-0000Qm-Af for qemu-devel@nongnu.org; Wed, 01 Feb 2023 19:52:26 -0500 Received: by mail-pj1-x1033.google.com with SMTP id j5so413154pjn.5 for ; Wed, 01 Feb 2023 16:52:24 -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.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Feb 2023 16:52:23 -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=uGDFqs4b4PgNASJU8FaMgpzRM7ATeSa1LZg6XuMJWq4=; b=XgR40jcADklJL6xzlRwWYBJvIOmZY1CAbII19wDLzTILhZ3hqpjXdQs6xVKJRBi1ND DAXt7EeAIbNCOMzcxiLzceRBtFrWxbdUNkcJT9pxerFiqS8E/VmU9V413SJM0bnUhKNf ef2SoD/ciAV7GgBX0a797ExWDB5AD41gkNnPrTtW8v+ti/4TehckS8QpI+5JkG8rS5jk O4TQJLgcnNJhEmdMVQ+8Tz/C9GJ/+BqJz0h/b6uyGl7kyrcVSm1G7fFZ7fVYgx478Uac CL2DvRGN9kHwk/+8QTVkdT+fqagmHmcYxpNCzIvEKA+cTwzkvIw7jE3Xv/so+pI11Tj9 PN8Q== 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=uGDFqs4b4PgNASJU8FaMgpzRM7ATeSa1LZg6XuMJWq4=; b=x6S2MGaCfEMzpB8B4MdHioI8N9kBLrogs6kRdGeoVV/FlvFWS5S+K2so1hwXtOSi9i Fz6MTfidtv4nynju04IjFDaSacG93QH3n1ixdgi1HkSgd61mmA6mXGmnxydcO1zvuYZL e9wVgbj4p9JTEXtm7ghr8qpegNB1iqAWoqmXea6WHQoEmrn2UZy0+d1Et7o9ed676XbA SwPega2v0UxH0C22zGtV29rMidJzfqHpOiALURcW0IGj3jrQaEPArmxO7Psly5Vg5ZGk 1RniIZQhgq5Z33+YqK5LEdR3/6IrEH/U7wdZxSwfev+RLHZygm07swMoob+Z+zI1N34Z Zx0g== X-Gm-Message-State: AO0yUKWlkvpeV9masEt98O+bVTsT6fvPKxHcSe2pdLtjrKnA3y8TWjfN vvMaM+PRsrgpX9gAzu+0/3lEY9d1ZyGQ7pbm X-Google-Smtp-Source: AK7set/JIaFAUWkE+y0y7W9ivXy57uXZqFTeop8BsiWsA5Z37sxrH0/CiEgcW72Dit41fYRuneA9Iw== X-Received: by 2002:a17:902:e5cb:b0:196:86c2:ee60 with SMTP id u11-20020a170902e5cb00b0019686c2ee60mr6283202plf.15.1675299144131; Wed, 01 Feb 2023 16:52:24 -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 09/14] linux-user/sparc: Handle priviledged opcode trap Date: Wed, 1 Feb 2023 14:51:59 -1000 Message-Id: <20230202005204.2055899-10-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::1033; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1033.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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1675299222944100003 Content-Type: text/plain; charset="utf-8" For the most part priviledged opcodes are ifdefed out of the user-only sparc translator, which will then incorrectly produce illegal opcode traps. But there are some code paths that properly raise TT_PRIV_INSN, so we must handle it. Signed-off-by: Richard Henderson --- linux-user/sparc/cpu_loop.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/linux-user/sparc/cpu_loop.c b/linux-user/sparc/cpu_loop.c index 370eb4e1a1..3af791455f 100644 --- a/linux-user/sparc/cpu_loop.c +++ b/linux-user/sparc/cpu_loop.c @@ -307,6 +307,9 @@ void cpu_loop (CPUSPARCState *env) case TT_ILL_INSN: force_sig_fault(TARGET_SIGILL, TARGET_ILL_ILLOPC, env->pc); break; + case TT_PRIV_INSN: + force_sig_fault(TARGET_SIGILL, TARGET_ILL_PRVOPC, env->pc); + break; case EXCP_ATOMIC: cpu_exec_step_atomic(cs); break; --=20 2.34.1 From nobody Wed Apr 24 15:56:34 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1675299207; cv=none; d=zohomail.com; s=zohoarc; b=UHeC+VnuxGW3oDuYtUhmrcK/q/rdD+c0znX+6LWvxxfQnn3381AjpM/45VeQIQEvl5w+3v4tDZgwoyRWO5jnptw5t389NY0fPbIqvAAnzoyvlFywZafJgSImETMxrjwie9ARKIwH8XpJkPfr0LfrEe2mqe+FH6+SM0KijxlqMFM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675299207; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=8D+STpvePJyIt+1ZL+zvip2U4CwOQ4PGaTgGIJkXneY=; b=GsLgxnKYcA3HJ7kTCSE3Vh73/RVXl7RCLMXlTHWBu3wcXCL8D2NAFap48vlHKpW+AN+Zd5VUsBqc79wmOPq0DFk4BKDOcvMN1SuOKccfvCrepvaLIBCHYX7rp3ixBRxUTvnEgK39B2By4HAGKpPg2Khtg/UyypK9dex4Gn8hOhc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675299207633502.9348201671544; Wed, 1 Feb 2023 16:53:27 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNNq2-0006C2-GZ; Wed, 01 Feb 2023 19:52:30 -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 1pNNq0-0006BV-Rh for qemu-devel@nongnu.org; Wed, 01 Feb 2023 19:52:28 -0500 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pNNpz-0000R1-7D for qemu-devel@nongnu.org; Wed, 01 Feb 2023 19:52:28 -0500 Received: by mail-pj1-x1032.google.com with SMTP id rm7-20020a17090b3ec700b0022c05558d22so292057pjb.5 for ; Wed, 01 Feb 2023 16:52:26 -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.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Feb 2023 16:52:25 -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=8D+STpvePJyIt+1ZL+zvip2U4CwOQ4PGaTgGIJkXneY=; b=r2YP/8ODNxT97xGRNbIYK7Ls/PEsQrKjOfKE5wURY26z2rasXld1CTYy9AHHB2cztc yJgb1D6iwd+M+DCYgjGx2KIq7lyGyLXNW8s9hHcyi/nMXOg0Lt2lk8DBYaLTltsMeuu+ rXLk2ufc+LpO9MdP6l1EEKO2rVp0S9JLGWiCfm+0Ys5iuQOAF+K/VzidGW2w6KzfH+6q 5huJ6AqnPHgGogtSFNThe9eyI5SY6kRfwT1nF/M3F/TFxpPPkAGli0ib6FHyzWOj+LSz rjts5IX5T0AEG2gH3hVTIQBxsdp4w9UyUMTJ6Ba5vPZwCIKP9y9pTq8zK2jbfjcni8q5 BvqA== 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=8D+STpvePJyIt+1ZL+zvip2U4CwOQ4PGaTgGIJkXneY=; b=BMfdbSTYihFp7LyVccb5KCQLyNRVaudC1K0BbSdhPjyeGoR3+U9cw2HobckpZ3XlK/ S28RB0cQTJfbXdpoUnBusCfQ41vFhA81RjygRtCvfAgYHkpmce70qwBqUrFHvGvsabJV A6rEza6ENXiSmcPrBN4q7aBox6Ml1l9Ap0IL64RDK4ch2B5vEiSWPUQrE267SYDfKm2E wIdouIJKVnmAwVO+f01OjF3fGKt5xNjJaufYIDeB5r9e5DdqXhV86cECtZ6ksyn6oqcC UaKQeSS3WXSf5njoaDSqLzhXWWoBrNNlZDiK0viVZ64rgxa8VgoaVCPKOKF81hGZMWNV KAHw== X-Gm-Message-State: AO0yUKUGQAezLRgcfZs9obZyxUxBdkPrfhfFzXS4c6+JC1xvePPpebZf h6qNOrbAW5rEEO9s0uF/mMXG5KPIAoPF7rHE X-Google-Smtp-Source: AK7set+KVV+JIunSrry51UE8VBSy/GFL9ytZ3l8AJLjFsl4XK0uCXQ7TMKnQxNSK0kZMDCZZ+JD2KA== X-Received: by 2002:a17:902:d4ce:b0:198:c335:ae95 with SMTP id o14-20020a170902d4ce00b00198c335ae95mr688414plg.0.1675299145934; Wed, 01 Feb 2023 16:52:25 -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 10/14] linux-user/sparc: Handle privilidged action trap Date: Wed, 1 Feb 2023 14:52:00 -1000 Message-Id: <20230202005204.2055899-11-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1032.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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1675299208852100004 Content-Type: text/plain; charset="utf-8" This is raised by using an %asi < 0x80 in user-mode. Signed-off-by: Richard Henderson --- linux-user/sparc/cpu_loop.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/linux-user/sparc/cpu_loop.c b/linux-user/sparc/cpu_loop.c index 3af791455f..42e92ef859 100644 --- a/linux-user/sparc/cpu_loop.c +++ b/linux-user/sparc/cpu_loop.c @@ -310,6 +310,12 @@ void cpu_loop (CPUSPARCState *env) case TT_PRIV_INSN: force_sig_fault(TARGET_SIGILL, TARGET_ILL_PRVOPC, env->pc); break; +#ifdef TARGET_SPARC64 + case TT_PRIV_ACT: + /* Note do_privact defers to do_privop. */ + force_sig_fault(TARGET_SIGILL, TARGET_ILL_PRVOPC, env->pc); + break; +#endif case EXCP_ATOMIC: cpu_exec_step_atomic(cs); break; --=20 2.34.1 From nobody Wed Apr 24 15:56:34 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1675299245; cv=none; d=zohomail.com; s=zohoarc; b=V3dCqxsOL7xBfLxLTDdsSTyX5QkZak26Ws/PwtPW+M9zMenMwUPS9mY8dYzTpzOMd+8aXSX5HxF9D809356dLRQikWHoADA44t0E4e0QDjCR/937M4JdaLEbPfenPO5m2REaKQYEj8B3FRPm2XtudYHoYfj5bc5ToahIYG1mQSE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675299245; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=EFLcl0DGfL7ktN784kj4RpjY2aQN3i68UXxSw9t0+sU=; b=d0X0bV2CsEK/WS2mJe02LiTaOPU6kOD7oVPx5whs3HPQk9iQG4QOOyBAuKKPb2pte/r6pZjw+c7WFnDJEVrJLr8+TJprMddsOFDzHfQBGZTsEEl81pLcF6H23xnizAwyHkfRfScVkkDzPalUjZ/sLEIsDa2Xle2x0zE8axXm4eI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675299245002860.1742035009315; Wed, 1 Feb 2023 16:54:05 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNNq3-0006Cb-GT; Wed, 01 Feb 2023 19:52:31 -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 1pNNq2-0006Bx-BQ for qemu-devel@nongnu.org; Wed, 01 Feb 2023 19:52:30 -0500 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pNNq0-0000RF-Nm for qemu-devel@nongnu.org; Wed, 01 Feb 2023 19:52:30 -0500 Received: by mail-pj1-x1033.google.com with SMTP id on9-20020a17090b1d0900b002300a96b358so322140pjb.1 for ; Wed, 01 Feb 2023 16:52:28 -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.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Feb 2023 16:52:27 -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=EFLcl0DGfL7ktN784kj4RpjY2aQN3i68UXxSw9t0+sU=; b=LTHPaJToAbmJ9qdCP0Z43xztt4mj7zGNbTB1iCGdIq1O6me0v0VATYBvHuwHhSa2S5 vpPhr/4K1t2vwmC1Pp4BtoFtyLzsppxSoLTicAETvLdodIzXllZxRS8/+zw9B31ykV8Y zdSCAvnDDK662tj/Fi7QJoIXWCMtWeHHLief98Gz1JuVtrgb/HMB21ruwibRixsh0Iz/ ERtO06aAGZFL4KcbGLZSrHo8728++a+/gPOZIve5iveHEUuivtne+IFm7y5S8qKqtOJH y/STMkAHOpO9kOG0T5s6vXuw4CqNVZhPkBswDVMWpYW27k9zOYG1xObFkmOAdI+P5u4r QnlA== 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=EFLcl0DGfL7ktN784kj4RpjY2aQN3i68UXxSw9t0+sU=; b=c5MDi5WuiamBp9U/T+tdIq5lmWJvMlvrX6/yDBDemT/i5zA9CrmjcqF6RZWpdVT+Mo 9q6pwkMQBMC78an2oYPIFSe0hrBWPLfFG6ebctPnJwslfn/X04Q1zLTBQXjW1EI5FjQu OWtkLtrVtravYh5yfZXrCIOX8zYZQJKqmjCwbwovzy+0O/OjajntH7JQKZevwyueGffo G0f3qrC4yVggSMnz1wBmpuF3YBt5K/N0Ym4586+tRM+7jLYnADPbIhXLNzy1ESTtwXPP K/R1zKADYJwTX++qApM+DzdAWOU2Hj/BpR4hd8HKWs1fY6hAF5w76JRcioiB7SUvlryB ri6Q== X-Gm-Message-State: AO0yUKV8khNhKACtjjZySUbrf3lGNiG4TTHemJxlKFSedFSkCKzWwUY2 PyRglETWaAWLA+hAahYi2zOcZP+ll0buywsS X-Google-Smtp-Source: AK7set+Mxfwun5e+JPr9x6do4wvyluVkInmlvRx2Tq0sInCb+bTyFAKEOODGTbFCYOe5GLyIrx0Yew== X-Received: by 2002:a17:902:c7d2:b0:196:7669:2585 with SMTP id r18-20020a170902c7d200b0019676692585mr3031232pla.57.1675299147519; Wed, 01 Feb 2023 16:52:27 -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 11/14] linux-user/sparc: Handle coprocessor disabled trap Date: Wed, 1 Feb 2023 14:52:01 -1000 Message-Id: <20230202005204.2055899-12-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::1033; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1033.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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1675299247020100003 Content-Type: text/plain; charset="utf-8" Since qemu does not implement a sparc coprocessor, all such instructions raise this trap. Because of that, we never raise the coprocessor exception trap, which would be vector 0x28. Signed-off-by: Richard Henderson --- linux-user/sparc/cpu_loop.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/linux-user/sparc/cpu_loop.c b/linux-user/sparc/cpu_loop.c index 42e92ef859..8985d10ba1 100644 --- a/linux-user/sparc/cpu_loop.c +++ b/linux-user/sparc/cpu_loop.c @@ -315,6 +315,10 @@ void cpu_loop (CPUSPARCState *env) /* Note do_privact defers to do_privop. */ force_sig_fault(TARGET_SIGILL, TARGET_ILL_PRVOPC, env->pc); break; +#else + case TT_NCP_INSN: + force_sig_fault(TARGET_SIGILL, TARGET_ILL_COPROC, env->pc); + break; #endif case EXCP_ATOMIC: cpu_exec_step_atomic(cs); --=20 2.34.1 From nobody Wed Apr 24 15:56:34 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1675299210; cv=none; d=zohomail.com; s=zohoarc; b=QpGBiI3rQhmuQHDuet/oNDVPJikp7xnDUMD2XpREGHrSnbHo6WAvaZMOXPve/AdsiGcdc9J0TTqdMF4+BkhAWG43BJe7y6xWSYZVH4lsWjXdsNrINeIoNTJe8C3YB3/5jt9rF9szn9Ltfa5PXyZu/hrrwKfD7JhEX4qsx1mNky4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675299210; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=RdzwGHvCCpIE8PYLpMnsIE7Dp6ielJFRJs6AnQClDEk=; b=VyWB8Z3DhuayCoFPyRkGheiZWszk04xNvDsj24vGe0S/GEGb+yTwTpwAm162j8/BaUmebF4d8/A6ByYnlHRuUwTZP5bQbdV8t0cfQAuTBaLWrcrT3DDS9LMvEhl5i9UXDyQ++tujnoXAfsF7LRawMoI3wnN2A7evm3/Qifydt3Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675299210871134.90708471660298; Wed, 1 Feb 2023 16:53:30 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNNq9-0006O7-NY; Wed, 01 Feb 2023 19:52:37 -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 1pNNq7-0006Ig-En for qemu-devel@nongnu.org; Wed, 01 Feb 2023 19:52:35 -0500 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pNNq2-0000RV-CN for qemu-devel@nongnu.org; Wed, 01 Feb 2023 19:52:35 -0500 Received: by mail-pj1-x1033.google.com with SMTP id c10-20020a17090a1d0a00b0022e63a94799so4056274pjd.2 for ; Wed, 01 Feb 2023 16:52:29 -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.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Feb 2023 16:52:28 -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=RdzwGHvCCpIE8PYLpMnsIE7Dp6ielJFRJs6AnQClDEk=; b=RR3MtTnBkWvPMgTo8VIzSjsbqJRy/ANHq5ju2gmCxPxDrTy81/Wh9G1ku3hJdNZl7Q OMKFVO5N7OpIyHrGnLV5ABfcFYBWCTTlVxYrJSVxVrugfyNBpoLjmyjFYZU3HOlil3Rt Jz1A7lViCZNjJXQ06EBSRRwlnAdfxew1dW4uQFcEWiowVSfeddCYUUNfawDTeQtmk41y 1vQ2zsH1WWGFXSEspjwDwqpMQ8AswFKpw0miUYvOaHZcE4nk26T5PrJaUHBvZN2jJ/wg 1KPO3+o217SVd/8U7DTcG+Su3ECRIdsgKGNuiC/PkAppvzcdQoaPJ54KvbHVgckiYM+C 4GHQ== 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=RdzwGHvCCpIE8PYLpMnsIE7Dp6ielJFRJs6AnQClDEk=; b=l616l+Zt6JhP3dzM/ccphTbMK20B8Zmd1E4WPa4xoyG88NZQ2Ao4A3Qz037z2VD9uI nV/6PGwAe506ISqb106BYdAlF6iKKNk2Wf9vq75T2Kbam4wfFzDmcCF6VdK3CxKc//9+ LXGMYwr5DXXdUWcvAEHWHARMrSWvLYdk/v/xAPyHcaMRi/K4XG5zRUn3r/NjPjMPdrOa ssUoUYJSOxLWDWK5KeGG4byAoE+Qbs/WqXbmhxjFzdNpoziWGrOH9rNKOxIOXb/4NJW2 QeWhqB6bdB0PFbY8hn70KOINdzClayAMouoVAu5Km7qmK0yEapDW8Rc/ue75JMDPte8i 4O7A== X-Gm-Message-State: AO0yUKUWBSSwvCsLodC3ur3OpovuF5c/FTeQQRYMNxwJ4Uveu14+4z6+ UHWnH/38KKToIG0oHRfF6MnCEwQEaUyKX0Fn X-Google-Smtp-Source: AK7set/Ker1Op2mWzUGfxNDTosZA1WsXzVN/XSThIZFvZR4AKbNmHgZLuPaFms4/C7r6rcA6jpg5bA== X-Received: by 2002:a17:903:1111:b0:196:6ec4:52db with SMTP id n17-20020a170903111100b001966ec452dbmr5623283plh.51.1675299149049; Wed, 01 Feb 2023 16:52:29 -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 12/14] linux-user/sparc: Handle unimplemented flush trap Date: Wed, 1 Feb 2023 14:52:02 -1000 Message-Id: <20230202005204.2055899-13-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::1033; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1033.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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1675299212865100003 Content-Type: text/plain; charset="utf-8" For sparc64, TT_UNIMP_FLUSH =3D=3D TT_ILL_INSN, so this is already handled. For sparc32, the kernel uses SKIP_TRAP. Signed-off-by: Richard Henderson --- linux-user/sparc/cpu_loop.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/linux-user/sparc/cpu_loop.c b/linux-user/sparc/cpu_loop.c index 8985d10ba1..7ba543983a 100644 --- a/linux-user/sparc/cpu_loop.c +++ b/linux-user/sparc/cpu_loop.c @@ -319,6 +319,9 @@ void cpu_loop (CPUSPARCState *env) case TT_NCP_INSN: force_sig_fault(TARGET_SIGILL, TARGET_ILL_COPROC, env->pc); break; + case TT_UNIMP_FLUSH: + next_instruction(env); + break; #endif case EXCP_ATOMIC: cpu_exec_step_atomic(cs); --=20 2.34.1 From nobody Wed Apr 24 15:56:34 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1675299261; cv=none; d=zohomail.com; s=zohoarc; b=BiqxXmoV2wW2I/VTMZ5J21qHJrS3pt3elo8QazN6pLD96WC2OHF7lKbxxKeb5ZjDrFy2uMmapn4mYlD7IgikZt5tcMPEfu5jnthEOV9rfldrQLTNqa+VsepC4mjL7c1Bc/s/g1GVRnUHKEWvPCbvCbY63mWVvZ4AKULlmiRzyBU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675299261; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=99mKRPmhuKoadjBj2q33vILsr06N7+B7c/sSXSWRdhI=; b=i94ck9cwGi/nCxrVDKlMaghNVozfgRp1WtfWuLz6Hs+faQbz+G0lXK6JlhETPdhg4byK0qNDydihC7MPpScI3OaCUfAljkfyhrCrmuD00ZljsyUs6DtDg9Q1H0HLQa1Uhtl7cQrglQXieIA0b9tx1D7PFin5mPAyzocOOp4PTLM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675299261329558.5819060105638; Wed, 1 Feb 2023 16:54:21 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNNq7-0006I4-4G; Wed, 01 Feb 2023 19:52:35 -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 1pNNq5-0006DC-Km for qemu-devel@nongnu.org; Wed, 01 Feb 2023 19:52:33 -0500 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pNNq4-0000Rw-2p for qemu-devel@nongnu.org; Wed, 01 Feb 2023 19:52:33 -0500 Received: by mail-pj1-x1029.google.com with SMTP id c10-20020a17090a1d0a00b0022e63a94799so4056324pjd.2 for ; Wed, 01 Feb 2023 16:52:31 -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.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Feb 2023 16:52:30 -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=99mKRPmhuKoadjBj2q33vILsr06N7+B7c/sSXSWRdhI=; b=HY/n1Ql+PQ8SLcDNHlfymT7uyflmPdTfAGyScmHtSw3qJJ7acvSgFVg2gf8Efigz1T txyzOd8pTBFqH+Wx+yKjWY6/1gBKMBMvsRn8b066RPYInL/GYd/Ah8KtagPGmMgz8SSo q4GDLEU2m2PumgpIPWl9SaUIwvz+1M+khEVq8QmSl15SLmPww3a7wzZbLUV3s2UEnTzU cBbdf5IsURiVnNNux6ODmujduW7AvlklVUXomBuo0xQhB9YdcsiHyOmxNveRw5FdFbgi QZnnGq3FdeVkyQScbaUHgFxsP6UHXzuOW7RYFAPr8Do0zdJipZ4txaL3SYNk1nKGEAb2 PYgQ== 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=99mKRPmhuKoadjBj2q33vILsr06N7+B7c/sSXSWRdhI=; b=iOOW5miHY4Hc33jZjJh28+ojkGpoY04LWZ3n2xXcHeEirfK/Kw7beguGHjqT/5s7aX rmJ1U6Phlufy3x0DJyyPDs4ZEqoKlUAYZHOL415ZjVOz3Q/5BC86RDP8v/Kc+iuVHHik PGJRMFTDLiYMbvtrQ/OBXvS5pyBkgyUMmRP4MB+alVT8rXqYcofz8k3rB8g+E+K2KDft xdqVmDnixYjzR9UHQZTPIpcu5i1csA6qvywtEGJGJLEv050Qsx0dz2jr2d7Z2OTQdC/1 e1FAzE6w82yuzN2t6QC+ttT0kd8VQAgWRWu09dbp+AlqCTuvz8D+//NfIIVPwrpkWe1l hqOQ== X-Gm-Message-State: AO0yUKUPIjDbeAXXGYq/GpA6GCvHLyvUxqAd2CMnXzGMx0c/WdMIxe2s O5lmTmXhaY5u/uUH1EHGeUzrt25hhWs/uY3b X-Google-Smtp-Source: AK7set9VYH1chNoSU7Om8bJqxK/JEZEa7QV714yhJ2vcWqwFOaZyBYcK3XQLEBDFlhU3JgrrBJAqkA== X-Received: by 2002:a17:902:db0a:b0:196:11b1:101d with SMTP id m10-20020a170902db0a00b0019611b1101dmr6291152plx.28.1675299150748; Wed, 01 Feb 2023 16:52:30 -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 13/14] linux-user/sparc: Handle floating-point exceptions Date: Wed, 1 Feb 2023 14:52:03 -1000 Message-Id: <20230202005204.2055899-14-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::1029; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1029.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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1675299263062100019 Content-Type: text/plain; charset="utf-8" Raise SIGFPE for ieee exceptions. The other types, such as FSR_FTT_UNIMPFPOP, should not appear, because we enable normal emulation of missing insns at the start of sparc_cpu_realizefn(). Signed-off-by: Richard Henderson --- target/sparc/cpu.h | 3 +-- linux-user/sparc/cpu_loop.c | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/target/sparc/cpu.h b/target/sparc/cpu.h index e478c5eb16..ae8de606d5 100644 --- a/target/sparc/cpu.h +++ b/target/sparc/cpu.h @@ -197,8 +197,7 @@ enum { #define FSR_FTT2 (1ULL << 16) #define FSR_FTT1 (1ULL << 15) #define FSR_FTT0 (1ULL << 14) -//gcc warns about constant overflow for ~FSR_FTT_MASK -//#define FSR_FTT_MASK (FSR_FTT2 | FSR_FTT1 | FSR_FTT0) +#define FSR_FTT_MASK (FSR_FTT2 | FSR_FTT1 | FSR_FTT0) #ifdef TARGET_SPARC64 #define FSR_FTT_NMASK 0xfffffffffffe3fffULL #define FSR_FTT_CEXC_NMASK 0xfffffffffffe3fe0ULL diff --git a/linux-user/sparc/cpu_loop.c b/linux-user/sparc/cpu_loop.c index 7ba543983a..18109f545d 100644 --- a/linux-user/sparc/cpu_loop.c +++ b/linux-user/sparc/cpu_loop.c @@ -301,6 +301,28 @@ void cpu_loop (CPUSPARCState *env) restore_window(env); break; =20 + case TT_FP_EXCP: + { + int code =3D TARGET_FPE_FLTUNK; + target_ulong fsr =3D env->fsr; + + if ((fsr & FSR_FTT_MASK) =3D=3D FSR_FTT_IEEE_EXCP) { + if (fsr & FSR_NVC) { + code =3D TARGET_FPE_FLTINV; + } else if (fsr & FSR_OFC) { + code =3D TARGET_FPE_FLTOVF; + } else if (fsr & FSR_UFC) { + code =3D TARGET_FPE_FLTUND; + } else if (fsr & FSR_DZC) { + code =3D TARGET_FPE_FLTDIV; + } else if (fsr & FSR_NXC) { + code =3D TARGET_FPE_FLTRES; + } + } + force_sig_fault(TARGET_SIGFPE, code, env->pc); + } + break; + case EXCP_INTERRUPT: /* just indicate that signals should be handled asap */ break; --=20 2.34.1 From nobody Wed Apr 24 15:56:34 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1675299256; cv=none; d=zohomail.com; s=zohoarc; b=YPwgeapYbHyRHmpxvmuRaOY+JymV6ZFj29pC3PEkWEDWilRMBRzPAoiWl7CUWPwx0dxxckqKOB0XvQ3ga+zoPsq6AnKiQ0Y4vU/1icm/+NeHreEXAjEagyFP9Mhb5XkFIoe4gKkWBc03GPuepT9aeWVgVyMThaih4r4sTiIcUC0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675299256; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=gcAn+/dc308N0zwxzCUYCpv71yRhEWzbzgA9/jFvtIs=; b=V/DhytR5G372T1kicalP0BEEmlwo6fxC7V5FF6oB9mxtzaDAkFFeInezRmL4jE8dC2phqYXnG6hu5nuOXOHRgVIhB2jYTKoa4atXHQdgtGiqf1aEaJuWXKscniSVubtm8hUGjWavvIkeeYVeP9DT52lbxlNTuwgKKtbd7wnxUaA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675299256180290.43380412931594; Wed, 1 Feb 2023 16:54:16 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNNq8-0006Jv-3D; Wed, 01 Feb 2023 19:52:36 -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 1pNNq6-0006Hu-Rh for qemu-devel@nongnu.org; Wed, 01 Feb 2023 19:52:34 -0500 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pNNq5-0000RF-14 for qemu-devel@nongnu.org; Wed, 01 Feb 2023 19:52:34 -0500 Received: by mail-pj1-x1033.google.com with SMTP id on9-20020a17090b1d0900b002300a96b358so322284pjb.1 for ; Wed, 01 Feb 2023 16:52:32 -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.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Feb 2023 16:52:31 -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=gcAn+/dc308N0zwxzCUYCpv71yRhEWzbzgA9/jFvtIs=; b=MxSDyZLRWVcCa+F5RrmWPgD4dEzSpMnCRLBUcSqdvjE357NSl6yi5ar+w7g44ReWiK y+WNGc/Ttkjfqf10/8kAfrAmzgbcERJfJgQ+0TayC+G9uMPz1YDQ7gBEYuVcpipO9qKD xI+xjDiJuxCl6PTeObAzyo4ECz6M1OipohfumGu97ErQuS3a3tBlZef4weGCnlMhBcfW COAEKgT/uLq3oLKxrwGl+A19IXhDbdHzHgDz4u1j2NDCl4OtqDs3fnPmviuTuffZeasV 1+1nJVduAfob/AAIJJUEPrrKW/mXuEhqAXzeTAxXKkZk5pf+sW3KlVmc/+itLVOywXp0 zSWQ== 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=gcAn+/dc308N0zwxzCUYCpv71yRhEWzbzgA9/jFvtIs=; b=zQKVxSbyk2M7JrlSikOqHOzntveoJ7R9rwfLCvtJFRJKmpOSLBercg0Q+cHJffgUh3 Eo07HjY00BeOPPDVZRYvjFh/IjKpSoeLAJqg0tFEPBGa1Co8Lqi8/X/QHWtAaBJ3axUB RZfa1OBfvJQJzoyCNszS3C2o+LmmdK6Yglvok1dGcYgytFPiwoHumBAxdM6Hsrvb/xyY 36N1nBonm5hJVdf2a77ohrF3qButapW374T9314TUOX+zM6WjaXMgVnUCW4bCUgNCsbT TlYp4pVX3L/UszAII1UUXZMR/bWnwNZeAV2mKHri+xToYXyCavCWsX0FF4R1HIo1g9tW k0Gg== X-Gm-Message-State: AO0yUKWY3U4W7WmKs720HkNY95L5X+CoH0c+mqYOxQZ9qSmkUfyXfBTh Pwz2B6EBeOGCD99J96kYgcMbeGNvjiU8jGzU X-Google-Smtp-Source: AK7set/xrW93zY4+oOtSRwQHJnacgxcLkKssCCL9H2Y1ENRVKGfRyjQdDwN69Ef7aLxrmkbgAxRGPw== X-Received: by 2002:a17:903:120b:b0:196:89bc:7100 with SMTP id l11-20020a170903120b00b0019689bc7100mr5822839plh.16.1675299152345; Wed, 01 Feb 2023 16:52:32 -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 14/14] linux-user/sparc: Handle tag overflow traps Date: Wed, 1 Feb 2023 14:52:04 -1000 Message-Id: <20230202005204.2055899-15-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::1033; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1033.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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1675299257032100005 Content-Type: text/plain; charset="utf-8" This trap is raised by taddcctv and tsubcctv insns. Signed-off-by: Richard Henderson --- linux-user/sparc/target_signal.h | 2 +- linux-user/syscall_defs.h | 5 +++++ linux-user/sparc/cpu_loop.c | 3 +++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/linux-user/sparc/target_signal.h b/linux-user/sparc/target_sig= nal.h index 87757f0c4e..f223eb4af6 100644 --- a/linux-user/sparc/target_signal.h +++ b/linux-user/sparc/target_signal.h @@ -8,7 +8,7 @@ #define TARGET_SIGTRAP 5 #define TARGET_SIGABRT 6 #define TARGET_SIGIOT 6 -#define TARGET_SIGSTKFLT 7 /* actually EMT */ +#define TARGET_SIGEMT 7 #define TARGET_SIGFPE 8 #define TARGET_SIGKILL 9 #define TARGET_SIGBUS 10 diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 77864de57f..614a1cbc8e 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -717,6 +717,11 @@ typedef struct target_siginfo { #define TARGET_TRAP_HWBKPT (4) /* hardware breakpoint/watchpoint = */ #define TARGET_TRAP_UNK (5) /* undiagnosed trap */ =20 +/* + * SIGEMT si_codes + */ +#define TARGET_EMT_TAGOVF 1 /* tag overflow */ + #include "target_resource.h" =20 struct target_pollfd { diff --git a/linux-user/sparc/cpu_loop.c b/linux-user/sparc/cpu_loop.c index 18109f545d..0b19f47876 100644 --- a/linux-user/sparc/cpu_loop.c +++ b/linux-user/sparc/cpu_loop.c @@ -332,6 +332,9 @@ void cpu_loop (CPUSPARCState *env) case TT_PRIV_INSN: force_sig_fault(TARGET_SIGILL, TARGET_ILL_PRVOPC, env->pc); break; + case TT_TOVF: + force_sig_fault(TARGET_SIGEMT, TARGET_EMT_TAGOVF, env->pc); + break; #ifdef TARGET_SPARC64 case TT_PRIV_ACT: /* Note do_privact defers to do_privop. */ --=20 2.34.1