From patchwork Thu Mar 10 11:27:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 550133 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:6713:0:0:0:0 with SMTP id u19csp945572mag; Thu, 10 Mar 2022 04:29:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJzZ/mmR9Sb/uVY5iTHPyjcjD+k8F3MwfOWfOb1PpjF8TayhnKFcZc0pe9SFCFn01bA69+ob X-Received: by 2002:a25:dc51:0:b0:628:8cbe:b1bc with SMTP id y78-20020a25dc51000000b006288cbeb1bcmr3754140ybe.582.1646915381913; Thu, 10 Mar 2022 04:29:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646915381; cv=none; d=google.com; s=arc-20160816; b=n1ckA/oAn+tmsmHJFQExbYTHehiohuSBeFS6/wVD0LkVNdbYVRm/B4yVZ0jwIsxZpZ CCaHDHKpZDpwr78cXXHrCDhO2XmKtiX5jTkPoQFn+Y5yKq+ypsv8uCursixov6EQwVek HB7uqLbtRzLU5ir9hPbPbGsThlha/1sqNDxct1wCUJO4cN6HYiAmyWw5AKMVEcvA32+c Fmyr/KZJQUOM7LINbu2m0QGjSDNKqoHfDN18CU5G1zQx/kdXQnZuFV7O2fyHVeIoHaN/ 7hd23jyyeK9kUKHOOjPvclBY46PvorJCTEg2+XZqrmn8kA8SCmgV/Vj5cmM0n0XHAUoN AXzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=aUIv8mPilapal9RFUm8fJDHj8xhqXeKP3105ESvQPFk=; b=z1E1oz4eyIsnBDdYSFwTsG5BKruToAv7gbRJMzBXg08oCls4Yrw3XAyaNJWHUD7Jzb 71InImrVsbu93nycku7n9wtccBJ1voIHI7DvsKNL2F3VmVBXF48U/QoQAnK/BI+0t3z/ TdR5wkaz8WdZWq1saoTUmAQ6cpp4ATve9Zj1/GbmMHLpeHcqIe8ulTELOoXjsl4i9qXA yvE8Pers4T81nJ2DEU5b4zRVaeUYMDEpr3D1duGm/V6LrtlYwmm9GdTVJ7AQx90ybCKr EUyeRJ0YPZbY9vZVaTxDH8NHzm3J2qRXyGmxIB41mLlZJWiPdtlJjrLN3apJK8OrABKF Ri6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=rJQWPPJX; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id a70-20020a25ca49000000b0062f86158b01si4409ybg.648.2022.03.10.04.29.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 10 Mar 2022 04:29:41 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=rJQWPPJX; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:46736 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nSHvJ-0003aA-D4 for patch@linaro.org; Thu, 10 Mar 2022 07:29:41 -0500 Received: from eggs.gnu.org ([209.51.188.92]:51740) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nSH0m-0002Vt-OI for qemu-devel@nongnu.org; Thu, 10 Mar 2022 06:31:17 -0500 Received: from [2607:f8b0:4864:20::1029] (port=34518 helo=mail-pj1-x1029.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nSH0l-0008Sq-8Y for qemu-devel@nongnu.org; Thu, 10 Mar 2022 06:31:16 -0500 Received: by mail-pj1-x1029.google.com with SMTP id k5-20020a17090a3cc500b001befa0d3102so6097687pjd.1 for ; Thu, 10 Mar 2022 03:31:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=aUIv8mPilapal9RFUm8fJDHj8xhqXeKP3105ESvQPFk=; b=rJQWPPJXwXzp9TRp24MRTjirq45N7llzkfCJ+J7PrKc0wAgDdUm7iJ36QOEAz91ed5 qy9CySuBpZJKUVt0T5ho7SdjC/7o5cdka+t/ZAzGP29Q1OxVvAORXGVe1mZ5RKvP8s2k F7+A7m0Sri8sCUWRoNlK7/+j8y+dlZzykRZA/EnPa47Lr73L/5N1XyKhE0MzKGpPj41B z6nwkYeDiRwdgROUOOuCHPd+GTu5SZAkfBkOyI/k8vDNl62UVaN14TGPuZO2QEJOEvdI FdTLYyPKcGLYTsyM4ByASPZQTW/4ZRORHKZL6v9E8VxhAbR6swi2VCq7ntiTqEZ4l54f YOEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=aUIv8mPilapal9RFUm8fJDHj8xhqXeKP3105ESvQPFk=; b=eZ49sl2iTPp6bQZtJRQWvYyUc8f0FlEKpCw0LsqrG+SZ5+NCIGYympcDs/YlSWRAu/ YdXHAj5xLZectueDAHlzX3EjqNMtM6AtjuUWrkniJM0IRKcHxGDrGqPaoEktZbQdzQfi SvRB9GLkOdN388NALnBJ8p/gUQDTLXEmijHJXvvxqIIqzjR7blp/8mlJmNNtT3mQj/Rh rGVhCItq98JYHI/4R3BEM/YpKtOUn8EZMBgQrZhjYFm/479q8vdyIR5XDCJJieaDNmbJ 4PnDneJcyu9n1dW5OGLiMymr3Sj7Gvwl0kpjw6o0tWQ1J4Sdbm+83CiOrEn6uNxHpb0g wgcw== X-Gm-Message-State: AOAM530FfE6WvjJnIS8ZRmgi6iOMmWXjxTX29PJZuQVgl74jJ7aq7UkM KpJaIk+fpmj5Nz8KF/gqgGunmfSzQRcwzQ== X-Received: by 2002:a17:90a:9ac:b0:1bf:a3e2:3f5c with SMTP id 41-20020a17090a09ac00b001bfa3e23f5cmr4506913pjo.105.1646911872818; Thu, 10 Mar 2022 03:31:12 -0800 (PST) Received: from localhost.localdomain (174-21-142-130.tukw.qwest.net. [174.21.142.130]) by smtp.gmail.com with ESMTPSA id e14-20020a056a001a8e00b004f75cf1ab6csm6011246pfv.206.2022.03.10.03.31.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Mar 2022 03:31:12 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v5 40/48] linux-user/nios2: Handle various SIGILL exceptions Date: Thu, 10 Mar 2022 03:27:17 -0800 Message-Id: <20220310112725.570053-41-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220310112725.570053-1-richard.henderson@linaro.org> References: <20220310112725.570053-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::1029 (failed) 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: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: marex@denx.de, peter.maydell@linaro.org, amir.gonnen@neuroblade.ai Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We missed out on a couple of exception types that may legitimately be raised by a userland program. Signed-off-by: Richard Henderson --- linux-user/nios2/cpu_loop.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/linux-user/nios2/cpu_loop.c b/linux-user/nios2/cpu_loop.c index 67220128aa..f223238275 100644 --- a/linux-user/nios2/cpu_loop.c +++ b/linux-user/nios2/cpu_loop.c @@ -49,6 +49,14 @@ void cpu_loop(CPUNios2State *env) env->ctrl[CR_BADADDR]); break; + case EXCP_ILLEGAL: + case EXCP_UNIMPL: + force_sig_fault(TARGET_SIGILL, TARGET_ILL_ILLOPC, env->pc); + break; + case EXCP_SUPERI: + force_sig_fault(TARGET_SIGILL, TARGET_ILL_PRVOPC, env->pc); + break; + case EXCP_TRAP: switch (env->error_code) { case 0: