From patchwork Thu Dec 21 10:38:00 2023 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: 757009 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp818193wrw; Thu, 21 Dec 2023 02:49:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IHoH2Xgsv4I+GxO1ittWchDRizMVtMEucCcN6tWY/XrC2wpRWo+XJxL31fJ3FzrTxv31VBw X-Received: by 2002:a05:620a:8112:b0:77f:61d3:734c with SMTP id os18-20020a05620a811200b0077f61d3734cmr21208515qkn.43.1703155764156; Thu, 21 Dec 2023 02:49:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703155764; cv=none; d=google.com; s=arc-20160816; b=lkQFmJI5Y63lAvyQsOFUJBzb/6T4iAT8XMEE3de/z65JgQKAzPJTkWQ+7sIzWoOoTQ SdutSnlwNS1WupC8/FSr3ow/XJuTMwNvghaFMjNjv+M0xH9RSJYrlvS+sL/7dxoOHIWo jNLrdtRCJ8gJVrKxv2OMCVSFUwzGaq1W9L5SvSJTgXTu+a9608JyiGcTayHEnke2pXZU 3u0nYTfRXXb9jiQcbqYdBMOS/y7YZMxWz03nodTfgPouhmRicYxxwDCxKDvU5l6JWrjE dpsDExx+n6abCPoyr/P3hpOQqOcXl7pocv+90axMEJWlaoUlZYBXQWmE2SrCpjmgR0+j /40Q== 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=KAYNxNN/VIwn3brnYwBM4da3zygXAIotsdaTZu8xJew=; fh=h+iJ7wyXFF+2j8Jm0Vjg9zb3yTkBquA+YJjBn+/tlFs=; b=QQnqw7+PGqXPmtxU79BbGOtTtmrmMJlQC32mjmNQMyYgagZ2xjdebiaSa+k1MarG+R ZxK1DKz/SHBRQlFBkEd5UGfz9u/iFMh8noH5frnyS6n349AVvyl7ZCtVwtEIETDgv3cG A+a2xxdIb/KMkxgNA8Cq4rcg2t8mKng58L8K7JTZy2brMvCqIJTMdI7V3iDoAqESwW2R NJ84esyY2oezeh7AHK76ZT4f7xpUBO2rkrjlMWuiFpwHDycCZ0M70xlBWM/iB4sdGEnR hEp42GpIKYFKBvo7e83Ps4E7XXPSF6CmEaWYZgrd4Ju/iM5jeAnQHBAIm4l2UUCVQmAp +x2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GS0lzkMd; 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 t20-20020a05620a451400b007740f66ad68si1995755qkp.314.2023.12.21.02.49.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 Dec 2023 02:49:24 -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=GS0lzkMd; 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 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) 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-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) 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) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: "Edgar E. Iglesias" , John Snow , Aurelien Jarno , =?utf-8?q?Philippe_Mathieu-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_Benn=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-An?= =?utf-8?q?dr=C3=A9_Lureau?= , 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_?= =?utf-8?q?Le_Goater?= , 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 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+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: <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 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) } } -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); @@ -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 != 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) @@ -673,7 +668,6 @@ static bool riscv_cpu_is_generic(Object *cpu_obj) static bool 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); @@ -682,14 +676,11 @@ static bool 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;