From nobody Tue Nov 26 22:36:41 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=1704303480; cv=none; d=zohomail.com; s=zohoarc; b=foNYs+tz4x0nJ3K+9H4AC7J2MK8+mmJblIJd6AMzl2JKlg9EAtyHo5zIaFfsuF0oUicSabpR9J9XUd9WAyjJrpRWb74GMmrXPjZcBGfmgpiP+vqVtLSk2ZI9hPJ2YOgDOFN+T17nmK7RPO1925lOn6e2A0qcZe97PX988qObf8k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704303480; 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=ihmv1UQSyeXF+edhnBktcuDDRsnmAMKk57cn58MDsTSMvbvfrk9pmDebV0kiaM9tA/EiZzlvd0cbxu//zlEz/MWOHkAHBrRhXI6sQEOGqnHPTTroKB5rA4Yzo5PNNjTMinGGUMarM+le7jlKCtvSvF5OBHqo+c3DQnAiKFyTeHg= 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 1704303480647878.7160829761738; Wed, 3 Jan 2024 09:38:00 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rL58o-0004RY-1U; Wed, 03 Jan 2024 12:34:54 -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 1rL58Y-00047h-UL for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:34:42 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rL585-0002Yr-Rj for qemu-devel@nongnu.org; Wed, 03 Jan 2024 12:34:38 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-40d5d898162so51172705e9.3 for ; Wed, 03 Jan 2024 09:34:08 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id o21-20020a05600c511500b0040d86e89abfsm2917164wms.43.2024.01.03.09.33.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 09:34:02 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 6E5185F955; Wed, 3 Jan 2024 17:33:51 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704303247; x=1704908047; 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=wCnmPOkEij82oE867mhfPAatD41ENl0pBqdBOX8u+4Uq+iuTOI05ZOv2zaGkm1rnbm AYNMOlZZo+gJdTJE3p5xzw3SNHKmGuqgGi+PskUf8uYAnB6Qv1Vdrky03Xoy+LPGPlfK Op4lKZoWyt6ffEvhqqV5uf773bNYVTWc5HGeAUiQ3s81dkz0ZT0hesICvJsu35GQma2K 2O36bXJl5WdYqYmBGjEniFh367yX68aIGkVjEF+17aXcjgChOn61lbo1ioR1FwuPnCGe FHcD+I+0YjgY8kZPHcXEZw+JgxuekA5+8sbrXy+xHsVyAKRH0wKa1ICJlvvnoc2L58/u gPzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704303247; x=1704908047; 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=oU9OVK1Aj3q6QPc/+jxmkpw9lwywetf9/VZvf/19dSXmwNzdnmR7d145jBYY3+QWlU +2mXN6nFxMFyTAYjXtNpJXX//ZeHWOUKe8pGVcPMeSbDLAGjWUU/+JTyXTh0z69SgDdl 0cD1Evjjvr/QdkNCu1mrZAkz+0SiqQ8dIBDsCCHHNw7W1FgDsFnjzGyE4EWhMmLLXSqM Tq1T3Bj+ycXupCHWbT3fXBBsP3d7Mn0EZvynZYrx3VFaDH0pyw5sOmr1KIX0QL96rtg3 k95e2EoZY3Rxl+VrEKP1UQdr88nWFlC+qw/iwIimJdoCvbsIbz2A4WqwbzGTKFNs0zZg wGQw== X-Gm-Message-State: AOJu0Ywb+rGjDfwBwBGq3U6WKDvMHGHj9PZJqeci02dyUYhKPYz7xwpd Y7PerremX+E3CFDcMuDunzBUa0HQJfGRFA== X-Google-Smtp-Source: AGHT+IEiNtW/AYEnFWgw1kuSIysK4yf5Kl2eOUr965I4B/3sWjOv3kPWjVHIGoC5zO/lkGW9NHvGjQ== X-Received: by 2002:a05:600c:3c88:b0:40d:6582:e552 with SMTP id bg8-20020a05600c3c8800b0040d6582e552mr6943624wmb.9.1704303247501; Wed, 03 Jan 2024 09:34:07 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, Richard Henderson , Song Gao , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , David Hildenbrand , Aurelien Jarno , Yoshinori Sato , Yanan Wang , Bin Meng , Laurent Vivier , Michael Rolnik , Alexandre Iooss , David Woodhouse , Laurent Vivier , Paolo Bonzini , Brian Cain , Daniel Henrique Barboza , Beraldo Leal , Paul Durrant , Mahmoud Mandour , Thomas Huth , Liu Zhiwei , Cleber Rosa , kvm@vger.kernel.org, Peter Maydell , Wainer dos Santos Moschetta , =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-arm@nongnu.org, Weiwei Li , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , John Snow , Daniel Henrique Barboza , Nicholas Piggin , Palmer Dabbelt , Marcel Apfelbaum , Ilya Leoshkevich , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , "Edgar E. Iglesias" , Eduardo Habkost , Pierrick Bouvier , qemu-riscv@nongnu.org, Alistair Francis , Akihiko Odaki Subject: [PATCH v2 23/43] target/riscv: Remove misa_mxl validation Date: Wed, 3 Jan 2024 17:33:29 +0000 Message-Id: <20240103173349.398526-24-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240103173349.398526-1-alex.bennee@linaro.org> References: <20240103173349.398526-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::333; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x333.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: 1704303482398100003 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