From patchwork Mon Jan 22 14:55:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 764643 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:10c4:b0:337:62d3:c6d5 with SMTP id b4csp1140382wrx; Mon, 22 Jan 2024 06:57:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IHEDvN6/rFNH8GM0IIYFSqlj8Tkos8wWykm3VBtFBkzopBBFYA0gTDUd2XoeJwL6wqApe19 X-Received: by 2002:a05:6102:214e:b0:469:a5a6:6cf4 with SMTP id h14-20020a056102214e00b00469a5a66cf4mr1859339vsg.3.1705935429127; Mon, 22 Jan 2024 06:57:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705935429; cv=none; d=google.com; s=arc-20160816; b=UQ55RBXAN8YCVRZ5puYUGQU9TPdn38tIZmnzvASMxcrNxJ3DcVCWXNTESsmx3rV/2i Vcb44zP/tEntrm4oeVJ7dpw1zM042t0hq8leGYvoVQ57f/jmisyMLfqkY2JhqPOWbPbV GkpcOlzkeIJuZF4kqQkybNNmhdt7A3Bw/JVRElKFS+/GPI0G/S7dIiNOZ5F4krUco5U+ VXswaK/3hxLQSMl6Bar6E8Dy6x+gGs1lqqGVgUXUEqpSUcvcF7DFvnEQjCRcsN7AOgDH QHJWwwYe8KESnTNPMcYg3Su8t1rHumXNajr7CQtiFTJr7eO5C+NsJXNvHI+dE/arPIPg oLQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=IRv4SBF4SdvyJZdy4aQdPUfxtEWcXSgRKnlpZ6CRBD8=; fh=mGQIuaf4A7RZOxcauYqguCwKMqzWt70hd4nAkQm0M6A=; b=Mo+ZzvTk/w0O1rg6uThMFbdGra2duVT+H7BpjZxTySQTXhC5ubzymT1mtEsKAaLfBZ E4CpPaJwAlP848jDHbIyW3lwzhp4REhYEqfgrMcKEvQiTgfd+2jlzV/MzQ4KSy4/jl6R C+NZHuAuPxzFwaEUsAzP2LBBfj3JfKSmDgjSq6gudrLHJZ8o8rKcjHckJK89nV3DJtxf YkAUYNC4gTBV98BcnAJZs6h81Ba8OyK/ARSVqSyCTTON8buj8OUVtURujQJeCq9viFuz ScKM2e4DL5QEOgZYWPLnnYBvMKDOUgYzU4LrqPpjANJwWzgyo7H3nODWbP7mwwrV24A6 +ECg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VCffJuHq; 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=pass (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 z4-20020a0cf244000000b0068442885f2dsi5807764qvl.323.2024.01.22.06.57.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Jan 2024 06:57:09 -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=pass header.i=@linaro.org header.s=google header.b=VCffJuHq; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rRvin-0006z3-TW; Mon, 22 Jan 2024 09:56:22 -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 1rRvim-0006xd-Im for qemu-devel@nongnu.org; Mon, 22 Jan 2024 09:56:20 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rRvig-0008Fx-8L for qemu-devel@nongnu.org; Mon, 22 Jan 2024 09:56:20 -0500 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-40e9101b5f9so37283355e9.3 for ; Mon, 22 Jan 2024 06:56:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705935371; x=1706540171; 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=IRv4SBF4SdvyJZdy4aQdPUfxtEWcXSgRKnlpZ6CRBD8=; b=VCffJuHqxJmMC8VR5DqKbw9DuwX7LJ41QRywkRqf4N1fBi8RMieJH9JrBOFxEiqPQw zzTkD372cTW2KtRj5P1Wzp/mC4oKVuZo7nhEzDUcJzIFNiDT11qKfJKNTQVveYPqyVFh MkepSMKJwKzFA9jglU3Vv6vicfy+QO7IrYL8Dl7Sotw50Di5Lbc7lws+wxFIpy/x1wqi OMnvjRZzUmt2c8kaQa9kxwr4uQ4w8axQMjQCt2lWpkfKgsB11PTLYjYjZNq5tZEjVqps YTKC6CJvVkcyiXOt7VErtTaFhTpNqdFv7XWN9rLambva5OQ4Fqsx1mCskt8+xB9dSyE1 6/gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705935371; x=1706540171; 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=IRv4SBF4SdvyJZdy4aQdPUfxtEWcXSgRKnlpZ6CRBD8=; b=S6HSu/D7f3lhnKKPgrNGI3DC4Mk6/VXCObunDCXRRA4g01eK/MmKn1pbxJpd+fZpyU IEQ9vkRmNv8DVMAWNw6Xf6nV5FkLlFriGwawU/k3WgGNkIWRHxyxT799qgKnHBrYLmIa 7zUD1ExDlWTuzJYGyW3Jh6X9abhEoQB6s/wH0iqgnKcf3Y5m+rZeuWwFWb/xH6R0Y+JM HUW9qjext1rSJV83y5Q7l9InScTQ7C/ygqhs0o3kTyexSl8KD2+73/DbGppE+mtcodEy oBTENeCDjkCs0T9a1525CbAOG88SkFgEt7ilcJg9R0fo0s36wjlm2ZydKVvIqrddmaRw kH+w== X-Gm-Message-State: AOJu0YzNRKUkN2pQhFGTFQ9/FYwp82M7kE3Iqgc63p2Cfl9BX3YWGU59 aw5jShMMpdYq9VB2VXUNEs1AQmHtRukBZ5duNAG9+Q2fpiSpFiDRibOhusQPiv4= X-Received: by 2002:a7b:ce8f:0:b0:40e:4db4:9c4a with SMTP id q15-20020a7bce8f000000b0040e4db49c4amr2500364wmj.50.1705935371725; Mon, 22 Jan 2024 06:56:11 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id r7-20020a05600c35c700b0040d1bd0e716sm39720140wmq.9.2024.01.22.06.56.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 06:56:11 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id F37E45F8F7; Mon, 22 Jan 2024 14:56:10 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Marcel Apfelbaum , "Edgar E. Iglesias" , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Michael Rolnik , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Laurent Vivier , kvm@vger.kernel.org, Yoshinori Sato , Pierrick Bouvier , Palmer Dabbelt , Liu Zhiwei , Laurent Vivier , Yanan Wang , qemu-ppc@nongnu.org, Weiwei Li , qemu-s390x@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?C=C3=A9dri?= =?utf-8?q?c_Le_Goater?= , Peter Maydell , Alexandre Iooss , John Snow , Mahmoud Mandour , Wainer dos Santos Moschetta , Richard Henderson , Ilya Leoshkevich , Alistair Francis , David Woodhouse , Cleber Rosa , Beraldo Leal , Bin Meng , Nicholas Piggin , Aurelien Jarno , Daniel Henrique Barboza , Daniel Henrique Barboza , Thomas Huth , David Hildenbrand , qemu-riscv@nongnu.org, qemu-arm@nongnu.org, Paolo Bonzini , Song Gao , Eduardo Habkost , Brian Cain , Paul Durrant , Akihiko Odaki Subject: [PATCH v3 02/21] target/riscv: Remove misa_mxl validation Date: Mon, 22 Jan 2024 14:55:51 +0000 Message-Id: <20240122145610.413836-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240122145610.413836-1-alex.bennee@linaro.org> References: <20240122145610.413836-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32a.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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: <20240103173349.398526-24-alex.bennee@linaro.org> Message-Id: <20231213-riscv-v7-2-a760156a337f@daynix.com> Signed-off-by: Alex Bennée --- 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 994ca1cdf9f..635b5fae576 100644 --- a/target/riscv/tcg/tcg-cpu.c +++ b/target/riscv/tcg/tcg-cpu.c @@ -268,7 +268,7 @@ static void riscv_cpu_validate_misa_priv(CPURISCVState *env, Error **errp) } } -static void riscv_cpu_validate_misa_mxl(RISCVCPU *cpu, Error **errp) +static void riscv_cpu_validate_misa_mxl(RISCVCPU *cpu) { RISCVCPUClass *mcc = RISCV_CPU_GET_CLASS(cpu); CPUClass *cc = CPU_CLASS(mcc); @@ -288,11 +288,6 @@ static void riscv_cpu_validate_misa_mxl(RISCVCPU *cpu, Error **errp) default: g_assert_not_reached(); } - - if (env->misa_mxl_max != env->misa_mxl) { - error_setg(errp, "misa_mxl_max must be equal to misa_mxl"); - return; - } } static void riscv_cpu_validate_priv_spec(RISCVCPU *cpu, Error **errp) @@ -932,7 +927,6 @@ static bool riscv_cpu_is_vendor(Object *cpu_obj) static bool riscv_tcg_cpu_realize(CPUState *cs, Error **errp) { RISCVCPU *cpu = RISCV_CPU(cs); - Error *local_err = NULL; if (!riscv_cpu_tcg_compatible(cpu)) { g_autofree char *name = riscv_cpu_get_name(cpu); @@ -941,14 +935,11 @@ static bool riscv_tcg_cpu_realize(CPUState *cs, Error **errp) return false; } - riscv_cpu_validate_misa_mxl(cpu, &local_err); - if (local_err != NULL) { - error_propagate(errp, local_err); - return false; - } + riscv_cpu_validate_misa_mxl(cpu); #ifndef CONFIG_USER_ONLY CPURISCVState *env = &cpu->env; + Error *local_err = NULL; CPU(cs)->tcg_cflags |= CF_PCREL;