freebsd-dev/sys/amd64/include
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
..
pc sys/amd64: further adoption of SPDX licensing ID tags. 2017-11-27 15:03:07 +00:00
xen
_align.h
_bus.h Regularize my copyright notice 2019-12-04 16:56:11 +00:00
_inttypes.h
_limits.h
_stdint.h
_types.h
acpica_machdep.h
apm_bios.h
asm.h amd64: Add CFI directives for libc syscall stubs 2019-10-23 19:03:03 +00:00
asmacros.h amd64: prevents speculations over swapgs reload of %gs base. 2019-08-06 16:53:25 +00:00
atomic.h Port the NetBSD KCSAN runtime to FreeBSD. 2019-11-21 11:22:08 +00:00
bus_dma.h sys/amd64: further adoption of SPDX licensing ID tags. 2017-11-27 15:03:07 +00:00
bus.h
clock.h re-synchronize TSC-s on SMP systems after resume, if necessary 2018-05-25 07:33:20 +00:00
counter.h amd64: assert that EARLY_COUNTER does not corrupt memory. 2019-11-24 19:02:13 +00:00
cpu.h Add a custom implementation of cpu_lock_delay() for x86. 2018-11-05 22:54:03 +00:00
cpufunc.h amd64: plug spurious cld instructions 2019-10-08 21:14:11 +00:00
cputypes.h Remove 'cpu' and 'cpu_class' on amd64. 2016-09-15 17:05:54 +00:00
csan.h Add kcsan_md_unsupported from NetBSD. 2019-11-21 13:22:23 +00:00
db_machdep.h Cleanups related to debug exceptions on x86. 2018-05-22 00:45:00 +00:00
dump.h
efi.h amd64 ef_rt_arch_call: Preserve %rflags around call into EFI RT service. 2019-06-03 15:32:42 +00:00
elf.h
endian.h
exec.h sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
fdt.h
float.h
floatingpoint.h spdx: initial adoption of licensing ID tags. 2017-11-18 14:26:50 +00:00
fpu.h Remove unused error return from API that cannot fail 2018-02-23 20:15:19 +00:00
frame.h PTI for amd64. 2018-01-17 11:44:21 +00:00
gdb_machdep.h gdb(4):amd64: Bump MI GDB_BUFSZ for more efficient transfers 2019-08-22 00:35:17 +00:00
ieeefp.h Resolve conflicts between macros in fenv.h and ieeefp.h 2018-05-31 20:22:47 +00:00
in_cksum.h sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
intr_machdep.h Drop "All rights reserved" from my copyright statements. 2019-03-06 22:11:45 +00:00
iodev.h sys/amd64: further adoption of SPDX licensing ID tags. 2017-11-27 15:03:07 +00:00
kdb.h sys/amd64: further adoption of SPDX licensing ID tags. 2017-11-27 15:03:07 +00:00
limits.h sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
md_var.h amd64: move pcb out of kstack to struct thread. 2019-10-25 20:09:42 +00:00
memdev.h sys/amd64: further adoption of SPDX licensing ID tags. 2017-11-27 15:03:07 +00:00
metadata.h
minidump.h sys/amd64: further adoption of SPDX licensing ID tags. 2017-11-27 15:03:07 +00:00
mp_watchdog.h sys/amd64: further adoption of SPDX licensing ID tags. 2017-11-27 15:03:07 +00:00
nexusvar.h
npx.h
ofw_machdep.h
param.h spdx: initial adoption of licensing ID tags. 2017-11-18 14:26:50 +00:00
pcb.h Provide dummy definition of the amd64 struct pcb for -m32 compilation. 2019-10-26 18:22:52 +00:00
pci_cfgreg.h
pcpu_aux.h amd64: move pcb out of kstack to struct thread. 2019-10-25 20:09:42 +00:00
pcpu.h amd64: move GDT into PCPU area. 2019-11-12 15:51:47 +00:00
pmap.h Introduce vm_page_astate. 2019-12-10 18:14:50 +00:00
pmc_mdep.h hwpmc: ABI fixes 2018-06-04 02:05:48 +00:00
ppireg.h sys/amd64: further adoption of SPDX licensing ID tags. 2017-11-27 15:03:07 +00:00
proc.h amd64: move pcb out of kstack to struct thread. 2019-10-25 20:09:42 +00:00
procctl.h amd64 KPTI: add control from procctl(2). 2019-03-16 11:44:33 +00:00
profile.h Fix high resolution kernel profiling just enough to not crash at boot 2018-06-02 05:48:44 +00:00
psl.h
ptrace.h
pvclock.h
reg.h
reloc.h sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
resource.h
runq.h sys/amd64: further adoption of SPDX licensing ID tags. 2017-11-27 15:03:07 +00:00
segments.h amd64: move GDT into PCPU area. 2019-11-12 15:51:47 +00:00
setjmp.h
sf_buf.h sys/amd64: further adoption of SPDX licensing ID tags. 2017-11-27 15:03:07 +00:00
sgx.h Add support for Intel Software Guard Extensions (Intel SGX). 2017-08-16 10:38:06 +00:00
sgxreg.h Add support for Intel Software Guard Extensions (Intel SGX). 2017-08-16 10:38:06 +00:00
sigframe.h
signal.h
smp.h x86: improve reservation of AP trampoline memory 2018-04-05 14:39:51 +00:00
specialreg.h
stack.h
stdarg.h
sysarch.h
timerreg.h sys/amd64: further adoption of SPDX licensing ID tags. 2017-11-27 15:03:07 +00:00
trap.h
tss.h amd64: move common_tss into pcpu. 2019-11-10 09:28:18 +00:00
ucontext.h
vdso.h
vm.h sys/amd64: further adoption of SPDX licensing ID tags. 2017-11-27 15:03:07 +00:00
vmm_dev.h Tie the name limit of a VM to SPECNAMELEN from devfs instead of a 2019-07-12 18:37:56 +00:00
vmm_instruction_emul.h Add a new variant of the GLA2GPA ioctl for use by the debug server. 2018-02-26 19:19:05 +00:00
vmm.h Support software breakpoints in the debug server on Intel CPUs. 2019-12-13 19:21:58 +00:00
vmparam.h Fix some nits in pmap_page_array_startup(). 2019-09-03 22:26:01 +00:00