From nobody Mon Feb 9 15:29:22 2026 Delivered-To: importer@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+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=inria.fr ARC-Seal: i=1; a=rsa-sha256; t=1769448479; cv=none; d=zohomail.com; s=zohoarc; b=diz1l1LY2WuldOdtLIUbdMFYbzhBXOA5ESS/bKT7BXDF0X+5ViPengIYpKzjRgX3kbb6WGA3yKyHtOvdx5NtwuH9MCqs+/4vy6zo/lSw4HDHLwI2bxxcN5m88mI7UnRAJR7KDdCn3Z3te5l91tPLXX7ahK/8iKDog7qSATfVDsg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769448479; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ki0i6t7nCm9HJS33C3Z36EibUGoPhmW+oPHODjguov4=; b=DeH6jccVrAJCxvw6+njn7SNpFJVfFMbTbdSIIbLvhGhMD288n0aXtVeAPtyhCz/fltEIuNYBdYSlOdKreAKmmmT5rj3Sy4witu4jmGXvsZdWJFNhAjiOyE1pzI6iMwNaMSdXu2KivYCChNqzJ/K2P3/1gIG76yxGxiCE18MmpGI= 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+importer=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 17694484788331005.3286004487888; Mon, 26 Jan 2026 09:27:58 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vkQNE-0006sU-2B; Mon, 26 Jan 2026 12:27:39 -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 1vkQIK-0003Vj-H5; Mon, 26 Jan 2026 12:22:32 -0500 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vkQIH-0003dC-TC; Mon, 26 Jan 2026 12:22:32 -0500 Received: from ptb-03250204.irisa.fr ([131.254.16.132]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jan 2026 18:22:25 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=ki0i6t7nCm9HJS33C3Z36EibUGoPhmW+oPHODjguov4=; b=MdbF5eGRmQs8Xw+aOubYevoSvKw1RjyPjzUNP61z/9/M/M+cRLaJFrG+ t8IN2ru5q56aKFN1ktAms4pXHa9A2q0IZ+x755YSsQi5h1dssVW1mX5HA BAN4A+bJDquzrDbmZQa3MTSxecFxfL7vKQP/kt2Cmimz4oJ2PyjgrP2TZ 8=; X-CSE-ConnectionGUID: eolSgfkIQ1ielJlpgzLetA== X-CSE-MsgGUID: mGs3SV4aQlmP0ZY34cUaZA== Authentication-Results: mail2-relais-roc.national.inria.fr; dkim=none (message not signed) header.i=none; spf=SoftFail smtp.mailfrom=sebastien.michelland@inria.fr; dmarc=fail (p=none dis=none) d=inria.fr X-IronPort-AV: E=Sophos;i="6.21,255,1763420400"; d="scan'208";a="260417077" From: =?UTF-8?q?S=C3=A9bastien=20Michelland?= To: qemu-devel@nongnu.org Cc: Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , qemu-riscv@nongnu.org, Jean-Michel Gorius , =?UTF-8?q?S=C3=A9bastien=20Michelland?= Subject: [PATCH] target/riscv: fix vs*r.v missing SIGILL check Date: Mon, 26 Jan 2026 18:21:37 +0100 Message-ID: <20260126172246.2521444-1-sebastien.michelland@inria.fr> X-Mailer: git-send-email 2.52.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=192.134.164.83; envelope-from=sebastien.michelland@inria.fr; helo=mail2-relais-roc.national.inria.fr X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Mon, 26 Jan 2026 12:27:27 -0500 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @inria.fr) X-ZM-MESSAGEID: 1769448482216158500 GEN_LDST_WHOLE_TRANS checks for require_rvv but it's always true, even with e.g. -cpu=3Drv32,v=3Dfalse. Instead the illegal signal for all vector instr= uctions (except vset{i}vl{i}) is generated by vext_check_isa_ill, which checks the context-dependent DisasContext->vill that conditionally makes vector instructions illegal depending on the state of vl. Currently, vs*r.v runs even when RVV is disabled or when vl has not been se= t. Adding the missing vext_check_isa_ill brings it in line with all other vect= or instructions, raising SIGILL in these situations. Signed-off-by: S=C3=A9bastien Michelland Reviewed-by: Daniel Henrique Barboza --- v[zs]ext_vf[248] is also suspiciously missing the check, but doesn't fail in such an obvious manner. If it's also a bug then it might be worth fixing at the same time. target/riscv/insn_trans/trans_rvv.c.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/target/riscv/insn_trans/trans_rvv.c.inc b/target/riscv/insn_tr= ans/trans_rvv.c.inc index 4df9a40b44..1e99c35988 100644 --- a/target/riscv/insn_trans/trans_rvv.c.inc +++ b/target/riscv/insn_trans/trans_rvv.c.inc @@ -1235,6 +1235,7 @@ static bool ldst_whole_trans(uint32_t vd, uint32_t rs= 1, uint32_t nf, static bool trans_##NAME(DisasContext *s, arg_##NAME * a) = \ { = \ if (require_rvv(s) && = \ + vext_check_isa_ill(s) && = \ QEMU_IS_ALIGNED(a->rd, ARG_NF)) { = \ return ldst_whole_trans(a->rd, a->rs1, ARG_NF, ctzl(sizeof(ETYPE))= , \ gen_helper_##NAME, s, IS_LOAD); = \ --=20 2.52.0