From nobody Wed Nov 27 00:41:40 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; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1703155764; cv=none; d=zohomail.com; s=zohoarc; b=Z+154l16m/PB9KOZKcOStIB6iGyKfsxOfxX6Ea9WmzQWJfwXNP+12o550T0zjeB7aU6igujkgOC2TXyWoiEo0lU6UCrUmM7ovIzEeuMK/ozBqOcdNuzPb91TMP7cR7DuSm6k0hoLs3YrygQt3MuGOWMbgwGFQABAyDT//Hwa5Kc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1703155764; h=Content-Type: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:To:To:Message-Id:Reply-To; bh=KAYNxNN/VIwn3brnYwBM4da3zygXAIotsdaTZu8xJew=; b=YbLIXnziTo5eWIXLDIyFc4dDQKxnwp9EuF9bnW9S1OfbMcMVA7yxLOjN9Rmdn2IU4DBx6bqXn3TgFU6ZT8+kJgPN6CokPmHYbcsGWhHnRKX4udjv6dHerUkb+yQX9xbdV9iZOd/qj0rt337yfAazgSduawgioi3N3A0TpmeXEdA= 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 1703155764431782.1430106003133; Thu, 21 Dec 2023 02:49:24 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rGGab-0004IF-Ut; Thu, 21 Dec 2023 05:47:42 -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 1rGGa5-0003up-2o for qemu-devel@nongnu.org; Thu, 21 Dec 2023 05:47:09 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rGGZx-0007HU-As for qemu-devel@nongnu.org; Thu, 21 Dec 2023 05:47:07 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-40d2764c0f2so7624325e9.2 for ; Thu, 21 Dec 2023 02:47:00 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id v8-20020a05600c444800b0040c2c5f5844sm2812553wmn.21.2023.12.21.02.46.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 02:46:58 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 08EE75F8E7; Thu, 21 Dec 2023 10:38:21 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1703155619; x=1703760419; 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=KAYNxNN/VIwn3brnYwBM4da3zygXAIotsdaTZu8xJew=; b=GS0lzkMddtJ6o1oJtxskzBPsQhU88515kLyevqOurvraQaua4IYHQiYEMXDlcuMiMX 1UsOCEuVlKalFBFo4pg8rNy96yp84GMOHyj6NqibJR4tBkgtaKBWbvHFTTGDK/XjyL6a JCtm8VtTa5SfxkI9fSS4Dp1FPhHeQsV6lIIrDHbFD+gVlPcMaXE7YdD9wtMhADIv5Sdf 5OzH9OUQF9SmlhpvsyaHGsqr+rAJugl699BL9mcIvymP5b2G7FB3kJYup1c8sSBenPT0 qPvDcRmhul03D9tR6gGU4uI7zpmW4BQM93jHmpN1qHyh2z7dkqI4MP33cB+RTi95D9oJ ptoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703155619; x=1703760419; 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=KAYNxNN/VIwn3brnYwBM4da3zygXAIotsdaTZu8xJew=; b=engtln9N5AkcYa4YayINNgCQ2J+LZSSv4y8nznyBFsi9bt1KaLMyUeUQgOtnb13eL8 YDpWfXHm1Z1ykkzLtzdy+MMpE/nHWyBbFtx7sLAyY6DtMuDnlFniVxxgEBSyyVK1nFYk DlXpsvvNNIq9RLQcnBErzHYLqJVSYlu4QyYe+pDCxga0C6jQWTsdxDZFOEAHwo0YL6VA kgHRquGhUc/46r3ptdQSBrJrCuWS0cahB5aXPHi9Z5R2K4eNW6Ko3NLwoq4g2rt97Tw4 Mrtybha+GA+inCUNCiEUw+7nhmaDKG73qMc8ObmkK7zDBLSdswYB30IwQdO3k7Q+OdOq 3NJA== X-Gm-Message-State: AOJu0YwKMP75R8CNi+tOk+UmkuIy8OCS/hSAr7fEYUzlNVySLTEsZyXQ dQpproOvNtjVbuQuX0LqN+FG8A== X-Google-Smtp-Source: AGHT+IH9OAFWeeECYpgrGRXr1vWfi7/IyfaDFSWb/LGJSZEIqxeWujGLCDPafxfshGr52XT8pz8O1g== X-Received: by 2002:a05:600c:4709:b0:409:79cb:1df6 with SMTP id v9-20020a05600c470900b0040979cb1df6mr634090wmo.14.1703155619574; Thu, 21 Dec 2023 02:46:59 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: "Edgar E. Iglesias" , John Snow , Aurelien Jarno , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yanan Wang , Eduardo Habkost , Brian Cain , Laurent Vivier , Palmer Dabbelt , Cleber Rosa , David Hildenbrand , Beraldo Leal , Pierrick Bouvier , Weiwei Li , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Paul Durrant , qemu-s390x@nongnu.org, David Woodhouse , Liu Zhiwei , Ilya Leoshkevich , Wainer dos Santos Moschetta , Michael Rolnik , Alistair Francis , Daniel Henrique Barboza , Laurent Vivier , kvm@vger.kernel.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Alexandre Iooss , Thomas Huth , Peter Maydell , qemu-ppc@nongnu.org, Paolo Bonzini , Marcel Apfelbaum , Nicholas Piggin , qemu-riscv@nongnu.org, qemu-arm@nongnu.org, Song Gao , Yoshinori Sato , Richard Henderson , Daniel Henrique Barboza , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Mahmoud Mandour , Bin Meng , Akihiko Odaki Subject: [PATCH 22/40] target/riscv: Remove misa_mxl validation Date: Thu, 21 Dec 2023 10:38:00 +0000 Message-Id: <20231221103818.1633766-23-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231221103818.1633766-1-alex.bennee@linaro.org> References: <20231221103818.1633766-1-alex.bennee@linaro.org> 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=2a00:1450:4864:20::335; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x335.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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 @linaro.org) X-ZM-MESSAGEID: 1703155764974100001 From: Akihiko Odaki 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 Message-Id: <20231213-riscv-v7-2-a760156a337f@daynix.com> Signed-off-by: Alex Benn=C3=A9e --- target/riscv/tcg/tcg-cpu.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/target/riscv/tcg/tcg-cpu.c b/target/riscv/tcg/tcg-cpu.c index 8a35683a345..ee17f65afb6 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) @@ -673,7 +668,6 @@ static bool riscv_cpu_is_generic(Object *cpu_obj) static bool tcg_cpu_realize(CPUState *cs, Error **errp) { RISCVCPU *cpu =3D RISCV_CPU(cs); - Error *local_err =3D NULL; =20 if (!riscv_cpu_tcg_compatible(cpu)) { g_autofree char *name =3D riscv_cpu_get_name(cpu); @@ -682,14 +676,11 @@ static bool tcg_cpu_realize(CPUState *cs, Error **err= p) 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 #ifndef CONFIG_USER_ONLY CPURISCVState *env =3D &cpu->env; + Error *local_err =3D NULL; =20 CPU(cs)->tcg_cflags |=3D CF_PCREL; =20 --=20 2.39.2