freebsd-dev/sys/amd64/vmm
John Baldwin cbd03a9df2 Support software breakpoints in the debug server on Intel CPUs.
- Allow the userland hypervisor to intercept breakpoint exceptions
  (BP#) in the guest.  A new capability (VM_CAP_BPT_EXIT) is used to
  enable this feature.  These exceptions are reported to userland via
  a new VM_EXITCODE_BPT that includes the length of the original
  breakpoint instruction.  If userland wishes to pass the exception
  through to the guest, it must be explicitly re-injected via
  vm_inject_exception().

- Export VMCS_ENTRY_INST_LENGTH as a VM_REG_GUEST_ENTRY_INST_LENGTH
  pseudo-register.  Injecting a BP# on Intel requires setting this to
  the length of the breakpoint instruction.  AMD SVM currently ignores
  writes to this register (but reports success) and fails to read it.

- Rework the per-vCPU state tracked by the debug server.  Rather than
  a single 'stepping_vcpu' global, add a structure for each vCPU that
  tracks state about that vCPU ('stepping', 'stepped', and
  'hit_swbreak').  A global 'stopped_vcpu' tracks which vCPU is
  currently reporting an event.  Event handlers for MTRAP and
  breakpoint exits loop until the associated event is reported to the
  debugger.

  Breakpoint events are discarded if the breakpoint is not present
  when a vCPU resumes in the breakpoint handler to retry submitting
  the breakpoint event.

- Maintain a linked-list of active breakpoints in response to the GDB
  'Z0' and 'z0' packets.

Reviewed by:	markj (earlier version)
MFC after:	2 months
Differential Revision:	https://reviews.freebsd.org/D20309
2019-12-13 19:21:58 +00:00
..
amd Support software breakpoints in the debug server on Intel CPUs. 2019-12-13 19:21:58 +00:00
intel Support software breakpoints in the debug server on Intel CPUs. 2019-12-13 19:21:58 +00:00
io Simplify bhyve vlapic ESR logic. 2019-08-29 18:23:38 +00:00
vmm_dev.c
vmm_host.c
vmm_host.h amd64: move GDT into PCPU area. 2019-11-12 15:51:47 +00:00
vmm_instruction_emul.c
vmm_ioport.c
vmm_ioport.h
vmm_ktr.h
vmm_lapic.c vmx: use C99 bool, not boolean_t 2019-08-01 02:16:48 +00:00
vmm_lapic.h vmx: use C99 bool, not boolean_t 2019-08-01 02:16:48 +00:00
vmm_mem.c
vmm_mem.h
vmm_stat.c
vmm_stat.h
vmm_util.c vmx: use C99 bool, not boolean_t 2019-08-01 02:16:48 +00:00
vmm_util.h vmx: use C99 bool, not boolean_t 2019-08-01 02:16:48 +00:00
vmm.c vmm: remove a wmb() call 2019-10-19 07:10:15 +00:00
x86.c
x86.h