Message ID | 20250115134957.2179085-5-dbarboza@ventanamicro.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | target/riscv: RVA23 profile support | expand |
On Wed, Jan 15, 2025 at 10:49:55AM -0300, Daniel Henrique Barboza wrote: > 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 <dbarboza@ventanamicro.com> > --- > 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 > > if (profile->priv_spec != RISCV_PROFILE_ATTR_UNUSED && > - profile->priv_spec != env->priv_ver) { > + profile->priv_spec > env->priv_ver) { > profile_impl = false; > > if (send_warn) { > -- > 2.47.1 > Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
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 if (profile->priv_spec != RISCV_PROFILE_ATTR_UNUSED && - profile->priv_spec != env->priv_ver) { + profile->priv_spec > env->priv_ver) { profile_impl = false; if (send_warn) {
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 <dbarboza@ventanamicro.com> --- target/riscv/tcg/tcg-cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)