diff options
author | Chao Du <duchao@eswincomputing.com> | 2024-04-02 09:26:26 +0300 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2024-04-08 11:36:27 +0300 |
commit | edcbe90f128922830228b9a5656c944a5d7ac306 (patch) | |
tree | 84f82f5284512e4762e7d3c4bc5b21e28476c42b /arch/riscv/kvm/vm.c | |
parent | fec50db7033ea478773b159e0e2efb135270e3b7 (diff) | |
download | linux-edcbe90f128922830228b9a5656c944a5d7ac306.tar.xz |
RISC-V: KVM: Implement kvm_arch_vcpu_ioctl_set_guest_debug()
kvm_vm_ioctl_check_extension(): Return 1 if KVM_CAP_SET_GUEST_DEBUG is
been checked.
kvm_arch_vcpu_ioctl_set_guest_debug(): Update the guest_debug flags
from userspace accordingly. Route the breakpoint exceptions to HS mode
if the VCPU is being debugged by userspace, by clearing the
corresponding bit in hedeleg.
Initialize the hedeleg configuration in kvm_riscv_vcpu_setup_config().
Write the actual CSR in kvm_arch_vcpu_load().
Signed-off-by: Chao Du <duchao@eswincomputing.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Link: https://lore.kernel.org/r/20240402062628.5425-2-duchao@eswincomputing.com
Signed-off-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'arch/riscv/kvm/vm.c')
-rw-r--r-- | arch/riscv/kvm/vm.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/riscv/kvm/vm.c b/arch/riscv/kvm/vm.c index ce58bc48e5b8..7396b8654f45 100644 --- a/arch/riscv/kvm/vm.c +++ b/arch/riscv/kvm/vm.c @@ -186,6 +186,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) case KVM_CAP_READONLY_MEM: case KVM_CAP_MP_STATE: case KVM_CAP_IMMEDIATE_EXIT: + case KVM_CAP_SET_GUEST_DEBUG: r = 1; break; case KVM_CAP_NR_VCPUS: |