target/riscv/kvm/kvm-cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Use the existing riscv_cpu_is_32bit() helper to check for 32-bit CPU.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
target/riscv/kvm/kvm-cpu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/target/riscv/kvm/kvm-cpu.c b/target/riscv/kvm/kvm-cpu.c
index 5c19062c19b..187c2c9501e 100644
--- a/target/riscv/kvm/kvm-cpu.c
+++ b/target/riscv/kvm/kvm-cpu.c
@@ -1588,7 +1588,7 @@ static void kvm_riscv_handle_sbi_dbcn(CPUState *cs, struct kvm_run *run)
* Handle the case where a 32 bit CPU is running in a
* 64 bit addressing env.
*/
- if (riscv_cpu_mxl(&cpu->env) == MXL_RV32) {
+ if (riscv_cpu_is_32bit(cpu)) {
addr |= (uint64_t)run->riscv_sbi.args[2] << 32;
}
--
2.51.0
On Thu, Sep 25, 2025 at 2:47 AM Philippe Mathieu-Daudé
<philmd@linaro.org> wrote:
>
> Use the existing riscv_cpu_is_32bit() helper to check for 32-bit CPU.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Thanks!
Applied to riscv-to-apply.next
Alistair
> ---
> target/riscv/kvm/kvm-cpu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/target/riscv/kvm/kvm-cpu.c b/target/riscv/kvm/kvm-cpu.c
> index 5c19062c19b..187c2c9501e 100644
> --- a/target/riscv/kvm/kvm-cpu.c
> +++ b/target/riscv/kvm/kvm-cpu.c
> @@ -1588,7 +1588,7 @@ static void kvm_riscv_handle_sbi_dbcn(CPUState *cs, struct kvm_run *run)
> * Handle the case where a 32 bit CPU is running in a
> * 64 bit addressing env.
> */
> - if (riscv_cpu_mxl(&cpu->env) == MXL_RV32) {
> + if (riscv_cpu_is_32bit(cpu)) {
> addr |= (uint64_t)run->riscv_sbi.args[2] << 32;
> }
>
> --
> 2.51.0
>
>
On Thu, Sep 25, 2025 at 2:47 AM Philippe Mathieu-Daudé
<philmd@linaro.org> wrote:
>
> Use the existing riscv_cpu_is_32bit() helper to check for 32-bit CPU.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Alistair
> ---
> target/riscv/kvm/kvm-cpu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/target/riscv/kvm/kvm-cpu.c b/target/riscv/kvm/kvm-cpu.c
> index 5c19062c19b..187c2c9501e 100644
> --- a/target/riscv/kvm/kvm-cpu.c
> +++ b/target/riscv/kvm/kvm-cpu.c
> @@ -1588,7 +1588,7 @@ static void kvm_riscv_handle_sbi_dbcn(CPUState *cs, struct kvm_run *run)
> * Handle the case where a 32 bit CPU is running in a
> * 64 bit addressing env.
> */
> - if (riscv_cpu_mxl(&cpu->env) == MXL_RV32) {
> + if (riscv_cpu_is_32bit(cpu)) {
> addr |= (uint64_t)run->riscv_sbi.args[2] << 32;
> }
>
> --
> 2.51.0
>
>
On Wed, Sep 24, 2025 at 06:45:15PM +0200, Philippe Mathieu-Daudé wrote:
> Use the existing riscv_cpu_is_32bit() helper to check for 32-bit CPU.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> target/riscv/kvm/kvm-cpu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/target/riscv/kvm/kvm-cpu.c b/target/riscv/kvm/kvm-cpu.c
> index 5c19062c19b..187c2c9501e 100644
> --- a/target/riscv/kvm/kvm-cpu.c
> +++ b/target/riscv/kvm/kvm-cpu.c
> @@ -1588,7 +1588,7 @@ static void kvm_riscv_handle_sbi_dbcn(CPUState *cs, struct kvm_run *run)
> * Handle the case where a 32 bit CPU is running in a
> * 64 bit addressing env.
> */
> - if (riscv_cpu_mxl(&cpu->env) == MXL_RV32) {
> + if (riscv_cpu_is_32bit(cpu)) {
> addr |= (uint64_t)run->riscv_sbi.args[2] << 32;
> }
>
> --
> 2.51.0
>
>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
© 2016 - 2026 Red Hat, Inc.