From nobody Mon Apr 7 02:37:09 2025 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=1736949140; cv=none; d=zohomail.com; s=zohoarc; b=NU+XvoYeZ/c5r3mVtSACitXX95oUDFVil+CJecDbRGcPoWJ1Sr34pvp+zRUiAcq13TXCwody9iWwzuhbv6ddtDlTGqp7t3swZoZX2rWNE3d0wj5Usnu+hW2tOtWujNgoxCVWfnN0K2ohynLGeZjbOYTRWyw0Bo2oj/wCq52Q9vs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1736949139; 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:To:To:Message-Id:Reply-To; bh=BEOF8Hfu+NnUUzyEQczw68/6HXLCAqPr9fHHglkR6Aw=; b=GH4NuOINsKH+ZEW1tpSWJB5qP+wt8kYFdcSm/98HCaHhTJc1ltrJGWTEQ7PxWE4EZ09aA2mYb1KJYz5Uv2ISItog4Ghl/UDZ7u1T52dENNGwKguvT2FIwy2ugbm1BEc1VRaKI5fygXOadrKvThCmiJ7bVASYAc+qBWm2RCR63Ug= 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 1736949139886820.4083617160687; Wed, 15 Jan 2025 05:52:19 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tY3mx-0005y5-F0; Wed, 15 Jan 2025 08:50:31 -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 1tY3mv-0005xO-Kh for qemu-devel@nongnu.org; Wed, 15 Jan 2025 08:50:29 -0500 Received: from mail-oi1-x233.google.com ([2607:f8b0:4864:20::233]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tY3ms-0007sR-Tt for qemu-devel@nongnu.org; Wed, 15 Jan 2025 08:50:28 -0500 Received: by mail-oi1-x233.google.com with SMTP id 5614622812f47-3eb98ad8caaso2808959b6e.0 for ; Wed, 15 Jan 2025 05:50:25 -0800 (PST) Received: from grind.. ([191.202.238.10]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3f0379eff69sm4952177b6e.41.2025.01.15.05.50.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jan 2025 05:50:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1736949024; x=1737553824; 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=BEOF8Hfu+NnUUzyEQczw68/6HXLCAqPr9fHHglkR6Aw=; b=Cowd9JK/aMAyWwNGAGj28b5wjuAPRNbn7ccc/87ydS5h+3WROLnfghTjLhhSfYBb9S F6AQ5oOv9Mfj3IFsVzTuag9Az5zx3Ua067rZ+4fyFj3aRMfBY4tGEF837USHIKAlpOWq +bX73BwI2C2bAgh89bgDNu4zs0Il+2CBhLcREy64I/tCHopWpEri5V8nPaRcJWpQMtpJ jr6IcmrVvKgvMU198I8qIem2IPNTRAknfai3TzzZLhqTMRMNUc9QQdzx9DJ5TNODIhTl 48tQ6s5c5BwEeZQK/9YMnrbMQe7kFKbwzuzZmZjuM3hQdJL8WZahRIN+Qe0OG9eYyu6n py1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736949024; x=1737553824; 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=BEOF8Hfu+NnUUzyEQczw68/6HXLCAqPr9fHHglkR6Aw=; b=emfrpmS/qGkf60HWIG24CAJ6QbC9Mfz/uhZjXkTd0akEbe9aKbN0nt75iCDx2g962z vsJcCyKeKYixTtoGpM3FrR646/bjPu8HSn66T5ymO/fQaP8NPuEB/qTwGxid0cm/CU3l bpEica7kXMOEYdY9F/dVxllyMD9GLa7aug84gTNGhzAYCbsM/qnZdjrDgp8EaZMCP0k0 h0dyCOJGL4K9Qtz/28RXDe98qAPMGa2tkIiRIxmJa4VsHMoQKtC0ETJfqUNxct+46hJP 9Z6QHrms0FdXe9q1qZ8cjOpnsjnJPrtNCM3iYCEDsfqAau6QKMHrKPl2QjgSjP2BBQmo 7PsA== X-Gm-Message-State: AOJu0YwUFSRspnU3MgU62j/IOK1NXOpkmimIwHeM45g7G1MT8ydSyf1v 34W+q6rSufAOWDKuhbrtY5hq19o1xGRoGqnQDdEfeFpQ7/Mzyt5yP/S40DD3Nx3HY5MTLF4E/jN MOIE= X-Gm-Gg: ASbGncs9RUZ6ozDFkzWiYxaFTPKEbF976vO0VjLjeHLp2A0lfZ5gjBTm3dSvuBLHcac gnraw7TUZ7J8vyIt58iKta0wZqG7owefjvQ3cHXW2lD+HaK+BRVeumBkYUcLiYtbWmWWypUVQsQ iw5pJL5RKQapoMvTE2UCsdZk4wHGxQWH/8QiZfkHLR0QatxOxQC/jPfDfOyprNUhHiqr3AfWZRX 2YFsMrS5RAGrxIZ3T0V9SXGcNXTAMog31jjRjvqRV5d7xztFWS2JMUooSo= X-Google-Smtp-Source: AGHT+IHGnp4QoqyWzWFIsKooHgPEVd5Z8XHv37n2e5llQsX1WXszVttQpcrzeDXTjV+74n9FzM+5Ug== X-Received: by 2002:a05:6808:4491:b0:3eb:47f9:a803 with SMTP id 5614622812f47-3ef2ec23f39mr17833303b6e.18.1736949024697; Wed, 15 Jan 2025 05:50:24 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, alistair.francis@wdc.com, bmeng@tinylab.org, liwei1518@gmail.com, zhiwei_liu@linux.alibaba.com, palmer@rivosinc.com, ajones@ventanamicro.com, Daniel Henrique Barboza Subject: [PATCH v3 4/6] target/riscv: change priv_ver check in validate_profile() Date: Wed, 15 Jan 2025 10:49:55 -0300 Message-ID: <20250115134957.2179085-5-dbarboza@ventanamicro.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250115134957.2179085-1-dbarboza@ventanamicro.com> References: <20250115134957.2179085-1-dbarboza@ventanamicro.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: pass client-ip=2607:f8b0:4864:20::233; envelope-from=dbarboza@ventanamicro.com; helo=mail-oi1-x233.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 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 @ventanamicro.com) X-ZM-MESSAGEID: 1736949140925019000 Content-Type: text/plain; charset="utf-8" The S profiles do a priv_ver check during validation to see if the running priv_ver is compatible with it. This check is done by comparing if the running priv_ver is equal to the priv_ver the profile specifies. There is an universe where we added RVA23S64 support based on both RVA23U64 and RVA22S64 and this error is being thrown: qemu-system-riscv64: warning: Profile rva22s64 requires priv spec v1.12.0, but priv ver v1.13.0 was set We're enabling RVA22S64 (priv_ver 1.12) as a dependency of RVA23S64 (priv_ver 1.13) and complaining to users about what we did ourselves. There's no drawback in allowing a profile to run in an env that has a priv_ver newer than it's required by it. So, like Hiro Nakamura saves the future by changing the past, change the priv_ver check now to allow profiles to run in a newer priv_ver. This universe will have one less warning to deal with. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Andrew Jones --- target/riscv/tcg/tcg-cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/riscv/tcg/tcg-cpu.c b/target/riscv/tcg/tcg-cpu.c index c9e5a3b580..f5338f43cb 100644 --- a/target/riscv/tcg/tcg-cpu.c +++ b/target/riscv/tcg/tcg-cpu.c @@ -746,7 +746,7 @@ static void riscv_cpu_validate_profile(RISCVCPU *cpu, #endif =20 if (profile->priv_spec !=3D RISCV_PROFILE_ATTR_UNUSED && - profile->priv_spec !=3D env->priv_ver) { + profile->priv_spec > env->priv_ver) { profile_impl =3D false; =20 if (send_warn) { --=20 2.47.1