diff options
author | Chao Du <duchao@eswincomputing.com> | 2024-04-02 08:26:27 +0200 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2024-04-08 10:36:27 +0200 |
commit | 1df1fb521b9dcf6a2fa8f74f9f39d40e5a6bd233 (patch) | |
tree | f412d4b4bff7ae301eec5d4fb6631887c1255d15 /arch/riscv | |
parent | RISC-V: KVM: Implement kvm_arch_vcpu_ioctl_set_guest_debug() (diff) | |
download | linux-1df1fb521b9dcf6a2fa8f74f9f39d40e5a6bd233.tar.xz linux-1df1fb521b9dcf6a2fa8f74f9f39d40e5a6bd233.zip |
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>
Diffstat (limited to 'arch/riscv')
-rw-r--r-- | arch/riscv/kvm/vcpu_exit.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/riscv/kvm/vcpu_exit.c b/arch/riscv/kvm/vcpu_exit.c index 2415722c01b8..5761f95abb60 100644 --- a/arch/riscv/kvm/vcpu_exit.c +++ b/arch/riscv/kvm/vcpu_exit.c @@ -204,6 +204,10 @@ int kvm_riscv_vcpu_exit(struct kvm_vcpu *vcpu, struct kvm_run *run, if (vcpu->arch.guest_context.hstatus & HSTATUS_SPV) ret = kvm_riscv_vcpu_sbi_ecall(vcpu, run); break; + case EXC_BREAKPOINT: + run->exit_reason = KVM_EXIT_DEBUG; + ret = 0; + break; default: break; } |