diff mbox series

[kvmtool,v3,3/4] riscv: Set SBI_SUCCESS on successful DBCN call

Message ID 20240821142610.3297483-4-apatel@ventanamicro.com (mailing list archive)
State New, archived
Headers show
Series Add RISC-V ISA extensions based on Linux-6.10 | expand

Commit Message

Anup Patel Aug. 21, 2024, 2:26 p.m. UTC
From: Andrew Jones <ajones@ventanamicro.com>

Ensure we explicitly set SBI_SUCCESS on a successful SBI calls
since KVM will not initialize it to zero for us. Only DBCN was
neglecting to do so.

Fixes: 4ddaa4249e0c ("riscv: Handle SBI DBCN calls from Guest/VM")
Signed-off-by: Andrew Jones <ajones@ventanamicro.com>
Signed-off-by: Anup Patel <apatel@ventanamicro.com>
---
 riscv/kvm-cpu.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/riscv/kvm-cpu.c b/riscv/kvm-cpu.c
index ae87848..0c171da 100644
--- a/riscv/kvm-cpu.c
+++ b/riscv/kvm-cpu.c
@@ -162,6 +162,7 @@  static bool kvm_cpu_riscv_sbi(struct kvm_cpu *vcpu)
 		switch (vcpu->kvm_run->riscv_sbi.function_id) {
 		case SBI_EXT_DBCN_CONSOLE_WRITE:
 		case SBI_EXT_DBCN_CONSOLE_READ:
+			vcpu->kvm_run->riscv_sbi.ret[0] = SBI_SUCCESS;
 			addr = vcpu->kvm_run->riscv_sbi.args[1];
 #if __riscv_xlen == 32
 			addr |= (u64)vcpu->kvm_run->riscv_sbi.args[2] << 32;