public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/3] RISC-V: KVM: Guest Debug Support - Software Breakpoint Part
@ 2024-02-06  7:49 Chao Du
  2024-02-06  7:49 ` [PATCH v1 1/3] RISC-V: KVM: Implement kvm_arch_vcpu_ioctl_set_guest_debug() Chao Du
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Chao Du @ 2024-02-06  7:49 UTC (permalink / raw)
  To: kvm, kvm-riscv, anup, atishp, pbonzini, shuah, dbarboza,
	paul.walmsley, palmer, aou, duchao713

This series implements the “KVM Guset Debug” feature on RISC-V. This is
an existing feature which is already supported by some other arches.
It allows us to debug a RISC-V KVM guest from GDB in host side.

As the first stage, the software breakpoints (ebreak instruction) is
implemented. HW breakpoints support will come later after a synthetically
consideration with the SBI debug trigger extension.

A selftest case was added in this series. Manual test was done on QEMU
RISC-V hypervisor emulator. (add '-s' to enable the gdbserver in QEMU)

This series is based on Linux 6.8-rc2 and also available at:
https://github.com/Du-Chao/kvm-riscv/tree/guest_debug_sw

The matched QEMU is available at:
https://github.com/Du-Chao/qemu/tree/riscv_gd_sw

Changes from RFC->v1:
- Rebased on Linux 6.8-rc2.
- Merge PATCH1 and PATCH2 into one patch. (If Paolo's change
  https://lore.kernel.org/kvm/20240131233056.10845-8-pbonzini@redhat.com/
  is adopted, then we can keep 'arch/riscv/include/uapi/asm/kvm.h'
  untouched)
- kselftest case added.

RFC link:
https://lore.kernel.org/kvm/20231221095002.7404-1-duchao@eswincomputing.com

Chao Du (3):
  RISC-V: KVM: Implement kvm_arch_vcpu_ioctl_set_guest_debug()
  RISC-V: KVM: Handle breakpoint exits for VCPU
  RISC-V: KVM: selftests: Add breakpoints test support

 arch/riscv/include/uapi/asm/kvm.h             |  1 +
 arch/riscv/kvm/vcpu.c                         | 15 +++++-
 arch/riscv/kvm/vcpu_exit.c                    |  4 ++
 arch/riscv/kvm/vm.c                           |  1 +
 tools/testing/selftests/kvm/Makefile          |  1 +
 .../testing/selftests/kvm/riscv/breakpoints.c | 49 +++++++++++++++++++
 6 files changed, 69 insertions(+), 2 deletions(-)
 create mode 100644 tools/testing/selftests/kvm/riscv/breakpoints.c

--
2.17.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2024-02-21  5:55 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-06  7:49 [PATCH v1 0/3] RISC-V: KVM: Guest Debug Support - Software Breakpoint Part Chao Du
2024-02-06  7:49 ` [PATCH v1 1/3] RISC-V: KVM: Implement kvm_arch_vcpu_ioctl_set_guest_debug() Chao Du
2024-02-14 12:49   ` Anup Patel
2024-02-20  2:58     ` Chao Du
2024-02-20  4:24       ` Anup Patel
2024-02-21  1:54         ` Chao Du
2024-02-21  3:49           ` Anup Patel
2024-02-21  5:49             ` Chao Du
2024-02-06  7:49 ` [PATCH v1 2/3] RISC-V: KVM: Handle breakpoint exits for VCPU Chao Du
2024-02-14 12:51   ` Anup Patel
2024-02-06  7:49 ` [PATCH v1 3/3] RISC-V: KVM: selftests: Add breakpoints test support Chao Du

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox