History

kvm: x86: Introduce KVM_CAP_EXCEPTION_PAYLOAD

This is a per-VM capability which can be enabled by userspace so that the faulting linear address will be included with the information about a pending #PF in L2, and the "new DR6 bits" will be included with the information about a pending #DB in L2. With this capability enabled, the L1 hypervisor can now intercept #PF before CR2 is modified. Under VMX, the L1 hypervisor can now intercept #DB before DR6 and DR7 are modified. When userspace has enabled KVM_CAP_EXCEPTION_PAYLOAD, it should generally provide an appropriate payload when injecting a #PF or #DB exception via KVM_SET_VCPU_EVENTS. However, to support restoring old checkpoints, this payload is not required. Note that bit 16 of the "new DR6 bits" is set to indicate that a debug exception (#DB) or a breakpoint exception (#BP) occurred inside an RTM region while advanced debugging of RTM transactional regions was enabled. This is the reverse of DR6.RTM, which is cleared in this scenario. This capability also enables exception.pending in struct kvm_vcpu_events, which allows userspace to distinguish between pending and injected exceptions.

Jim Mattson committed 8 years ago

Commit c4f55191 parent f10c7293 files · +32 −1Browse files

Showing the changes to include/uapi/linux (1 of 3 files). Show all

Unified · Split

include/uapi/linux/kvm.h+1−0
@@ -964,6 +964,7 @@ struct kvm_ppc_resize_hpt { · 963 unmodified lines
964964 #define KVM_CAP_HYPERV_SEND_IPI 161
965965 #define KVM_CAP_COALESCED_PIO 162
966966 #define KVM_CAP_HYPERV_ENLIGHTENED_VMCS 163
967+#define KVM_CAP_EXCEPTION_PAYLOAD 164
967968
968969 #ifdef KVM_CAP_IRQ_ROUTING
969970