diff options
author | Bibo Mao <maobibo@loongson.cn> | 2024-05-06 17:00:47 +0300 |
---|---|---|
committer | Huacai Chen <chenhuacai@loongson.cn> | 2024-05-06 17:00:47 +0300 |
commit | 163e9fc6957fc24d1d6c0a30a3febfd2ecade039 (patch) | |
tree | 00967c144a87dd2512a823725a2c60be600695e1 /drivers/hid | |
parent | 74c16b2e2b0c3b193324f47300fd30cf03a606b7 (diff) | |
download | linux-163e9fc6957fc24d1d6c0a30a3febfd2ecade039.tar.xz |
LoongArch: KVM: Add software breakpoint support
When VM runs in kvm mode, system will not exit to host mode when
executing a general software breakpoint instruction such as INSN_BREAK,
trap exception happens in guest mode rather than host mode. In order to
debug guest kernel on host side, one mechanism should be used to let VM
exit to host mode.
Here a hypercall instruction with a special code is used for software
breakpoint usage. VM exits to host mode and kvm hypervisor identifies
the special hypercall code and sets exit_reason with KVM_EXIT_DEBUG. And
then let qemu handle it.
Idea comes from ppc kvm, one api KVM_REG_LOONGARCH_DEBUG_INST is added
to get the hypercall code. VMM needs get sw breakpoint instruction with
this api and set the corresponding sw break point for guest kernel.
Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Diffstat (limited to 'drivers/hid')
0 files changed, 0 insertions, 0 deletions