qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/3] Add gdbstub support to HVF
@ 2023-01-14 16:12 francesco.cagnin
  2023-01-14 16:13 ` [PATCH v3 1/3] arm: move KVM breakpoints helpers francesco.cagnin
                   ` (3 more replies)
  0 siblings, 4 replies; 16+ messages in thread
From: francesco.cagnin @ 2023-01-14 16:12 UTC (permalink / raw)
  To: qemu-devel
  Cc: mads, dirty, peter.maydell, qemu-arm, agraf, pbonzini,
	alex.bennee, Francesco Cagnin

From: Francesco Cagnin <fcagnin@quarkslab.com>

This patch series aims to add gdbstub support to HVF (the 'QEMU
accelerator on macOS that employs Hypervisor.framework') on Apple
Silicon hosts.

The proposed implementation, structured like the KVM counterpart,
handles single-stepping, software breakpoints, hardware breakpoints and
hardware watchpoints.

The patch has been most recently tested working on macOS Ventura 13.1
hosts and Linux kernel 5.19 guests with the test script
'tests/guest-debug/test-gdbstub.py' (slightly updated to make it work
with Linux kernels compiled on macOS).

v3:
* Keep separate views of DBG*_EL1 registers while guest debugging is
  enabled  
  NOTE: Should be implemented as Peter and Alex suggested, and works as
  intended in my (limited) tests. Any other register to handle beside
  DBG*_EL1?
* Handle singlestepping over instructions triggering a VM exit
  NOTE: I'm not aware of unwanted side effects, please double-check the
  fix is adequate.
* Merge patches 2 and 3 from previous patch series

v2:
* Move debug helpers to 'target/arm/hyp_gdbstub.c'
* Add support for SSTEP_NOIRQ and multi-core (thanks Mads Ynddal)
* Move calls to 'hv_vcpu_set_trap_debug_exceptions()' to
  'hvf_arch_update_guest_debug()'
* Use 'arm_num_brps()' and 'arm_num_wrps()' to compute the number of
  breakpoints and watchpoints available (thanks Peter Maydell)

Francesco Cagnin (3):
  arm: move KVM breakpoints helpers
  hvf: implement guest debugging on Apple Silicon hosts
  hvf: handle singlestepping over instructions which trigger a VM exit

 accel/hvf/hvf-accel-ops.c | 123 ++++++++
 accel/hvf/hvf-all.c       |  24 ++
 cpu.c                     |   3 +
 include/sysemu/hvf.h      |  29 ++
 include/sysemu/hvf_int.h  |   1 +
 target/arm/hvf/hvf.c      | 635 +++++++++++++++++++++++++++++++++++++-
 target/arm/hyp_gdbstub.c  | 242 +++++++++++++++
 target/arm/internals.h    |  50 +++
 target/arm/kvm64.c        | 276 -----------------
 target/arm/meson.build    |   3 +-
 10 files changed, 1107 insertions(+), 279 deletions(-)
 create mode 100644 target/arm/hyp_gdbstub.c

-- 
2.39.0



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

end of thread, other threads:[~2023-02-13 16:36 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-14 16:12 [PATCH v3 0/3] Add gdbstub support to HVF francesco.cagnin
2023-01-14 16:13 ` [PATCH v3 1/3] arm: move KVM breakpoints helpers francesco.cagnin
2023-01-15 22:50   ` Alex Bennée
2023-02-10 16:41   ` Peter Maydell
2023-02-13 16:28     ` Francesco Cagnin
2023-02-13 16:35       ` Peter Maydell
2023-01-14 16:13 ` [PATCH v3 2/3] hvf: implement guest debugging on Apple Silicon hosts francesco.cagnin
2023-01-18 11:19   ` Mads Ynddal
2023-01-19  9:49     ` Mads Ynddal
2023-01-23 19:32       ` Francesco Cagnin
2023-02-02 10:03         ` Mads Ynddal
2023-02-13 11:52   ` Peter Maydell
2023-01-14 16:13 ` [PATCH v3 3/3] hvf: handle singlestepping over instructions which trigger a VM exit francesco.cagnin
2023-02-13 11:53   ` Peter Maydell
2023-02-10 17:04 ` [PATCH v3 0/3] Add gdbstub support to HVF Philippe Mathieu-Daudé
2023-02-13 15:28   ` Francesco Cagnin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).