freebsd-dev/sys/amd64/include
Bojan Novković fefac54359
bhyve: fix vCPU single-stepping on VMX
This patch fixes virtual machine single stepping on VMX hosts.

Currently, when using bhyve's gdb stub, each attempt at single-stepping
a vCPU lands in a timer interrupt. The current single-stepping mechanism
uses the Monitor Trap Flag feature to cause VMEXIT after a single
instruction is executed. Unfortunately, the SDM states that MTF causes
VMEXITs for the next instruction that gets executed, which is often not
what the person using the debugger expects. [1]

This patch adds a new VM capability that masks interrupts on a vCPU by
blocking interrupt injection and modifies the gdb stub to use the newly
added capability while single-stepping a vCPU.

[1] Intel SDM 26.5.2 Vol. 3C

Reviewed by:		corvink, jbh
MFC after:		1 week
Differential Revision:	https://reviews.freebsd.org/D39949
2023-05-09 10:04:55 +02:00
..
pc
xen xen/intr: introduce dev/xen/bus/intr-internal.h 2023-04-14 15:58:53 +02:00
_align.h
_bus.h
_inttypes.h
_limits.h
_pmap.h amd64: move definition of the struct pmap_pcids into _pmap.h 2023-05-02 14:32:20 +03:00
_stdint.h
_types.h
acpica_machdep.h
apm_bios.h
asan.h kasan: Create a shadow for the bootstack prior to hammer_time() 2022-06-15 11:39:10 -04:00
asm.h amd64: -m32 support for machine/asm(macros).h 2022-06-13 18:35:39 +01:00
asmacros.h elfnote: place note in a PT_NOTE program header 2022-06-28 09:51:57 +02:00
atomic.h amd64: -m32 support for machine/atomic.h 2022-06-13 18:35:39 +01:00
bus_dma.h
bus.h
clock.h x86: Deduplicate clock.h 2021-12-06 10:39:08 -05:00
counter.h amd64: -m32 support for machine/counter.h 2022-06-13 18:35:40 +01:00
cpu.h Simplify swi for bus_dma. 2021-12-28 13:51:25 -08:00
cpufunc.h amd64: -m32 support for machine/cpufunc.h 2022-06-13 18:35:38 +01:00
cputypes.h
csan.h
db_machdep.h
dump.h
efi.h
elf.h
endian.h
exec.h
fdt.h
float.h
floatingpoint.h
fpu.h
frame.h
gdb_machdep.h
ieeefp.h Remove checks for __GNUCLIKE_ASM assuming it is always true. 2022-04-12 10:05:45 -07:00
in_cksum.h machine/in_cksum.h: don't include sys/cdefs.h 2022-04-18 21:02:19 +01:00
intr_machdep.h
iodev.h
iommu.h
kdb.h
limits.h Remove checks for __CC_SUPPORTS_WARNING assuming it is always true. 2022-04-12 10:06:13 -07:00
md_var.h amd64: be more precise when enabling the AlderLake small core PCID workaround 2023-01-06 01:30:29 +02:00
memdev.h
metadata.h
minidump.h
msan.h
nexusvar.h
npx.h
ofw_machdep.h
param.h
pcb.h
pci_cfgreg.h
pcpu_aux.h amd64: -m32 support for machine/pcpu_aux.h 2022-06-13 18:35:40 +01:00
pcpu.h amd64: store pcids pmap data in pcpu zone 2023-05-02 14:32:47 +03:00
pmap.h pmap_{un}map_io_transient: Use bool instead of boolean_t. 2023-05-04 12:29:48 -07:00
pmc_mdep.h hwpmc: use kstack_contains() 2023-05-06 14:49:19 -03:00
proc.h Move kstack_contains() and GET_STACK_USAGE() to MD machine/stack.h 2023-02-02 00:59:26 +02:00
procctl.h
profile.h amd64: -m32 support for machine/profile.h 2022-06-13 18:35:39 +01:00
psl.h
ptrace.h
pvclock.h
reg.h
reloc.h
resource.h
runq.h
segments.h amd64: -m32 support for machine/segments.h 2022-06-13 18:35:39 +01:00
setjmp.h
sf_buf.h amd64: -m32 support for machine/sb_buf.h 2022-06-13 18:35:39 +01:00
sgx.h
sgxreg.h
sigframe.h
signal.h
smp.h
specialreg.h
stack.h Move kstack_contains() and GET_STACK_USAGE() to MD machine/stack.h 2023-02-02 00:59:26 +02:00
stdarg.h
sysarch.h
tls.h Add <machine/tls.h> header to hold MD constants and helpers for TLS. 2021-12-09 13:17:13 -08:00
trap.h
tss.h
ucontext.h
vdso.h
vm.h
vmm_dev.h vmm: Don't lock a vCPU for VM_PPTDEV_MSI[X]. 2022-12-09 10:26:23 -08:00
vmm_instruction_emul.h libvmmapi: Add a struct vcpu and use it in most APIs. 2023-03-24 11:49:06 -07:00
vmm_snapshot.h bhyve: Remove vmctx member from struct vm_snapshot_meta. 2023-03-24 11:49:06 -07:00
vmm.h bhyve: fix vCPU single-stepping on VMX 2023-05-09 10:04:55 +02:00
vmparam.h vm: centralize VM_BATCHQUEUE_SIZE definition 2023-01-21 14:30:00 -05:00