From nobody Wed Nov 27 13:39:04 2024 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 ARC-Seal: i=1; a=rsa-sha256; t=1698645014; cv=none; d=zohomail.com; s=zohoarc; b=c0V6V34sNgZ1dUPt8pHG+M0ZL7fV6lWyIIQzXFzkMCFT5CPhqxSYd0InSdcBGmIYfqaro0JrQICSh6awHdXLuSwnTUrKBPvD07vNNVOmE0I9JnaZFplvmwA0p1KlK6OB7+NFm8D4qCaCmHPF/QWdoy6206nT3/9Fg78uqWVeS04= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698645014; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:Message-Id:Reply-To:To; bh=WVW58tyZ2tLjevyOdJr7NfNjanDDydhO/lJcVmLZzKs=; b=QbDDnr06KOUcBW1PeWWAtTyI+TLKsv9HJGCXH+5QDvrs9qcgqciJ+caJ/GX+M7wogOhO8c194ArJUQisyW6KnYRqq1znPIPmlfi5o721lztxU13jn42VV6piTGKrr6fynwBIPGwA7j0EhZj/SFk4IXVD0nTzF0v6M9Hq/xdXDdg= 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1698645014382320.7996767188872; Sun, 29 Oct 2023 22:50:14 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qxL9M-0002gE-QL; Mon, 30 Oct 2023 01:49:20 -0400 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 1qxL93-0002cn-K5 for qemu-devel@nongnu.org; Mon, 30 Oct 2023 01:49:05 -0400 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qxL90-0006wc-PG for qemu-devel@nongnu.org; Mon, 30 Oct 2023 01:49:00 -0400 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-6b77ab73c6fso2825205b3a.1 for ; Sun, 29 Oct 2023 22:48:58 -0700 (PDT) Received: from localhost ([2400:4050:a840:1e00:78d2:b862:10a7:d486]) by smtp.gmail.com with UTF8SMTPSA id fh14-20020a056a00390e00b00689f5940061sm5260241pfb.17.2023.10.29.22.48.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 29 Oct 2023 22:48:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1698644937; x=1699249737; darn=nongnu.org; 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=WVW58tyZ2tLjevyOdJr7NfNjanDDydhO/lJcVmLZzKs=; b=3dSRi8bd2RYVNfrNC42Ck8nt/w4g0AkNEtV9GYbVH3JKdYXGjhzPIGKP5AyDW510+L OPbYDaLVjhuH+GDLtcAd+ZtEfFfacO4LWNsqvZxVWKXaC53gegtmfgo7FFanJf5GYfxQ NBk1bIsHPdJaK+97Oy+2e2SFqcJPSN1Gf0ugnYRVSMNCSLCLXUks+CLvQUITAEQVIx60 Ct2maaas8p2Hhj958XrL1eDAR//kikIRSIHHHOh1QAmIEZpuRDUNy7a7P2pIAWkb0x4J mHQAtR7N2oME3FFcmdOaR1WZ9h3tuAOSRFEwqZCIi2rJujl6+3SPZGDl7nhJWwkl7zGd bzvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698644937; x=1699249737; 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=WVW58tyZ2tLjevyOdJr7NfNjanDDydhO/lJcVmLZzKs=; b=PTi37yb3zjkP+FQGnZOYgy4jXCIGQG3aVG9F022abYEl34sROmnn00rL3oZbrfIBmC IfNxd7UMn9io6kC9SJgMkog0J5ZclDSL8PZudPE3uS0D9Fn2chjKFnDcSLJGAJ84OD8n SBa9AO8/9vrb+RNxjdFUQe4HWFpDzXrpC/44n1esDzHX09PtUEOLfYVrxY8r5/tfDBZH Y096pcqTd3iqWWmGsEvErXFKqY/cUaYjuFR4miOM9LR8E03Rf48QRIU4/ekUa7yEOc9A n1NNvUJ7y6b5TihCc1Rz5JS8fv2Y6pavwTG9ykVjs7+SXPUhC5I6LZc3+UAbgW8NQppt Z+Vg== X-Gm-Message-State: AOJu0YzI8H/3yQF5O2Xr4uZk2nf5x92+3jKvONunHaAxtwItcBKHcfOv 0HVBs57IP8G8Pgn+EM/dTGJpxA== X-Google-Smtp-Source: AGHT+IF36QFnG1ViRJhTkwpt7pjXxr5aHdeVd3h7FdPjGheua9KlOYC9h6PfPvd/vGeU13shWMl7mg== X-Received: by 2002:a05:6a00:3244:b0:691:27b:15b4 with SMTP id bn4-20020a056a00324400b00691027b15b4mr13661138pfb.5.1698644937207; Sun, 29 Oct 2023 22:48:57 -0700 (PDT) From: Akihiko Odaki To: Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Mikhail Tyutin , Aleksandr Anenkov , qemu-devel@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Fabiano Rosas , Akihiko Odaki , LIU Zhiwei , Daniel Henrique Barboza , Palmer Dabbelt , Alistair Francis , Bin Meng , Weiwei Li , qemu-riscv@nongnu.org Subject: [PATCH v6 2/5] target/riscv: Remove misa_mxl validation Date: Mon, 30 Oct 2023 14:46:36 +0900 Message-ID: <20231030054834.39145-3-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231030054834.39145-1-akihiko.odaki@daynix.com> References: <20231030054834.39145-1-akihiko.odaki@daynix.com> 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+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::431; envelope-from=akihiko.odaki@daynix.com; helo=mail-pf1-x431.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20230601.gappssmtp.com) X-ZM-MESSAGEID: 1698645016847100002 Content-Type: text/plain; charset="utf-8" It is initialized with a simple assignment and there is little room for error. In fact, the validation is even more complex. Signed-off-by: Akihiko Odaki Acked-by: LIU Zhiwei Reviewed-by: Daniel Henrique Barboza Acked-by: Alistair Francis --- target/riscv/tcg/tcg-cpu.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/target/riscv/tcg/tcg-cpu.c b/target/riscv/tcg/tcg-cpu.c index a28918ab30..7f45e42000 100644 --- a/target/riscv/tcg/tcg-cpu.c +++ b/target/riscv/tcg/tcg-cpu.c @@ -148,7 +148,7 @@ static void riscv_cpu_validate_misa_priv(CPURISCVState = *env, Error **errp) } } =20 -static void riscv_cpu_validate_misa_mxl(RISCVCPU *cpu, Error **errp) +static void riscv_cpu_validate_misa_mxl(RISCVCPU *cpu) { RISCVCPUClass *mcc =3D RISCV_CPU_GET_CLASS(cpu); CPUClass *cc =3D CPU_CLASS(mcc); @@ -168,11 +168,6 @@ static void riscv_cpu_validate_misa_mxl(RISCVCPU *cpu,= Error **errp) default: g_assert_not_reached(); } - - if (env->misa_mxl_max !=3D env->misa_mxl) { - error_setg(errp, "misa_mxl_max must be equal to misa_mxl"); - return; - } } =20 static void riscv_cpu_validate_priv_spec(RISCVCPU *cpu, Error **errp) @@ -573,11 +568,7 @@ static bool tcg_cpu_realize(CPUState *cs, Error **errp) return false; } =20 - riscv_cpu_validate_misa_mxl(cpu, &local_err); - if (local_err !=3D NULL) { - error_propagate(errp, local_err); - return false; - } + riscv_cpu_validate_misa_mxl(cpu); =20 riscv_cpu_validate_priv_spec(cpu, &local_err); if (local_err !=3D NULL) { --=20 2.42.0