target/riscv/kvm: Use riscv_cpu_is_32bit() when handling SBI_DBCN reg
PATCH 1/1 target/riscv/kvm: Use riscv_cpu_is_32bit() when handling SBI_DBCN reg
Use the existing riscv_cpu_is_32bit() helper to check for 32-bit CPU.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>
--- target/riscv/kvm/kvm-cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
target/riscv/kvm/kvm-cpu.c +1 -1
@@ -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 ; }
Signature · 1 line
2.51.0
Quoted 24 lines · Philippe Mathieu-Daudé
Use the existing
riscv_cpu_is_32bit()helper to check for 32-bit CPU.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/riscv/kvm/kvm-cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)target/riscv/kvm/kvm-cpu.c +1
-1@@ -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 ; }Signature · 1 line
2.51.0
Reviewed-by Andrew Jones <[email protected]>
Quoted 4 lines · Philippe Mathieu-Daudé
Use the existing
riscv_cpu_is_32bit()helper to check for 32-bit CPU.Signed-off-by Philippe Mathieu-Daudé <[email protected]>
Reviewed-by Alistair Francis <[email protected]>
Alistair
Quoted 21 lines
--- target/riscv/kvm/kvm-cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)target/riscv/kvm/kvm-cpu.c +1
-2@@ -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
Alistair Francis
AppliedQuoted 4 lines · Philippe Mathieu-Daudé
Use the existing
riscv_cpu_is_32bit()helper to check for 32-bit CPU.Signed-off-by Philippe Mathieu-Daudé <[email protected]>
Thanks!
Applied to riscv-to-apply.next
Alistair
Quoted 21 lines
--- target/riscv/kvm/kvm-cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)target/riscv/kvm/kvm-cpu.c +1
-2@@ -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