KVM: x86: Extend KVM_{G,S}ET_VCPU_EVENTS to support pending triple fault
authorChenyi Qiang <chenyi.qiang@intel.com>
Tue, 24 May 2022 13:56:21 +0000 (21:56 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 8 Jun 2022 09:20:53 +0000 (05:20 -0400)
commited2351174e38ad4febbbc0dba802803e6cff8ae0
treedfb064b60615a54bc9cbadd60bffa5c2194a147d
parent7aadaa988c5ea0894b3bbea598e4da56f078a289
KVM: x86: Extend KVM_{G,S}ET_VCPU_EVENTS to support pending triple fault

For the triple fault sythesized by KVM, e.g. the RSM path or
nested_vmx_abort(), if KVM exits to userspace before the request is
serviced, userspace could migrate the VM and lose the triple fault.

Extend KVM_{G,S}ET_VCPU_EVENTS to support pending triple fault with a
new event KVM_VCPUEVENT_VALID_FAULT_FAULT so that userspace can save and
restore the triple fault event. This extension is guarded by a new KVM
capability KVM_CAP_TRIPLE_FAULT_EVENT.

Note that in the set_vcpu_events path, userspace is able to set/clear
the triple fault request through triple_fault.pending field.

Signed-off-by: Chenyi Qiang <chenyi.qiang@intel.com>
Message-Id: <20220524135624.22988-2-chenyi.qiang@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Documentation/virt/kvm/api.rst
arch/x86/include/asm/kvm_host.h
arch/x86/include/uapi/asm/kvm.h
arch/x86/kvm/x86.c
include/uapi/linux/kvm.h