linux-stable/arch/x86/include/uapi/asm
Maxim Levitsky 61e5f69ef0 KVM: x86: implement KVM_GUESTDBG_BLOCKIRQ
KVM_GUESTDBG_BLOCKIRQ will allow KVM to block all interrupts
while running.

This change is mostly intended for more robust single stepping
of the guest and it has the following benefits when enabled:

* Resuming from a breakpoint is much more reliable.
  When resuming execution from a breakpoint, with interrupts enabled,
  more often than not, KVM would inject an interrupt and make the CPU
  jump immediately to the interrupt handler and eventually return to
  the breakpoint, to trigger it again.

  From the user point of view it looks like the CPU never executed a
  single instruction and in some cases that can even prevent forward
  progress, for example, when the breakpoint is placed by an automated
  script (e.g lx-symbols), which does something in response to the
  breakpoint and then continues the guest automatically.
  If the script execution takes enough time for another interrupt to
  arrive, the guest will be stuck on the same breakpoint RIP forever.

* Normal single stepping is much more predictable, since it won't
  land the debugger into an interrupt handler.

* RFLAGS.TF has less chance to be leaked to the guest:

  We set that flag behind the guest's back to do single stepping
  but if single step lands us into an interrupt/exception handler
  it will be leaked to the guest in the form of being pushed
  to the stack.
  This doesn't completely eliminate this problem as exceptions
  can still happen, but at least this reduces the chances
  of this happening.

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
Message-Id: <20210811122927.900604-6-mlevitsk@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-08-20 16:06:37 -04:00
..
a.out.h
auxvec.h x86/elf: Support a new ELF aux vector AT_MINSIGSTKSZ 2021-05-19 12:18:45 +02:00
bitsperlong.h
boot.h
bootparam.h x86: Fix various typos in comments 2021-03-18 15:31:53 +01:00
byteorder.h treewide: add "WITH Linux-syscall-note" to SPDX tag of uapi headers 2019-07-25 11:05:10 +02:00
debugreg.h x86/traps: Handle #DB for bus lock 2021-03-28 22:52:15 +02:00
e820.h
hw_breakpoint.h
hwcap2.h x86/elf: Use _BITUL() macro in UAPI headers 2021-05-21 11:12:52 +02:00
ist.h
Kbuild
kvm.h KVM: x86: implement KVM_GUESTDBG_BLOCKIRQ 2021-08-20 16:06:37 -04:00
kvm_para.h KVM: X86: Introduce KVM_HC_MAP_GPA_RANGE hypercall 2021-06-17 14:25:39 -04:00
kvm_perf.h
ldt.h
mce.h x86/mce: Drop bogus comment about mce.kflags 2020-04-17 11:12:21 +02:00
mman.h
msgbuf.h x86: Fix various typos in comments 2021-03-18 15:31:53 +01:00
msr.h
mtrr.h
perf_regs.h
posix_types.h
posix_types_32.h
posix_types_64.h
posix_types_x32.h
prctl.h
processor-flags.h
ptrace-abi.h
ptrace.h
sembuf.h arch: sembuf.h: make uapi asm/sembuf.h self-contained 2019-12-04 19:44:14 -08:00
setup.h
sgx.h x86: Fix various typos in comments 2021-03-18 15:31:53 +01:00
shmbuf.h x86: Fix various typos in comments 2021-03-18 15:31:53 +01:00
sigcontext.h x86: Fix various typos in comments 2021-03-18 15:31:53 +01:00
sigcontext32.h treewide: add "WITH Linux-syscall-note" to SPDX tag of uapi headers 2019-07-25 11:05:10 +02:00
siginfo.h
signal.h arch: move SA_* definitions to generic headers 2020-11-23 10:31:05 -06:00
stat.h
statfs.h
svm.h KVM: SVM: Software reserved fields 2021-06-17 13:09:37 -04:00
swab.h
ucontext.h
unistd.h x86/syscalls: Revert "x86/syscalls: Make __X32_SYSCALL_BIT be unsigned long" 2020-05-26 16:42:43 +02:00
vm86.h x86/vm86/32: Remove VM86_SCREEN_BITMAP support 2021-01-21 20:08:53 +01:00
vmx.h KVM: VMX: Add basic handling of VM-Exit from SGX enclave 2021-04-20 04:18:54 -04:00
vsyscall.h