Skip to content

Commit 1df1fb5

Browse files
Du-Chaoavpatel
authored andcommitted
RISC-V: KVM: Handle breakpoint exits for VCPU
Exit to userspace for breakpoint traps. Set the exit_reason as KVM_EXIT_DEBUG before exit. Signed-off-by: Chao Du <duchao@eswincomputing.com> Reviewed-by: Anup Patel <anup@brainfault.org> Link: https://lore.kernel.org/r/20240402062628.5425-3-duchao@eswincomputing.com Signed-off-by: Anup Patel <anup@brainfault.org>
1 parent edcbe90 commit 1df1fb5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

arch/riscv/kvm/vcpu_exit.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,10 @@ int kvm_riscv_vcpu_exit(struct kvm_vcpu *vcpu, struct kvm_run *run,
204204
if (vcpu->arch.guest_context.hstatus & HSTATUS_SPV)
205205
ret = kvm_riscv_vcpu_sbi_ecall(vcpu, run);
206206
break;
207+
case EXC_BREAKPOINT:
208+
run->exit_reason = KVM_EXIT_DEBUG;
209+
ret = 0;
210+
break;
207211
default:
208212
break;
209213
}

0 commit comments

Comments
 (0)