i386: kvm: extend kvm_{get, put}_vcpu_events to support pending triple fault
commit12f89a39cf3c5760cba82ce68929d748961f62df
authorChenyi Qiang <chenyi.qiang@intel.com>
Thu, 29 Sep 2022 07:20:11 +0000 (29 15:20 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 10 Oct 2022 07:23:16 +0000 (10 09:23 +0200)
tree451486e6c22c4d50f9c2c396df3941200cc7a441
parent298c31de9871b971b86356164633b9a5861af3db
i386: kvm: extend kvm_{get, put}_vcpu_events to support pending triple fault

For the direct triple faults, i.e. hardware detected and KVM morphed
to VM-Exit, KVM will never lose them. But for triple faults sythesized
by KVM, e.g. the RSM path, if KVM exits to userspace before the request
is serviced, userspace could migrate the VM and lose the triple fault.

A new flag KVM_VCPUEVENT_VALID_TRIPLE_FAULT is defined to signal that
the event.triple_fault_pending field contains a valid state if the
KVM_CAP_X86_TRIPLE_FAULT_EVENT capability is enabled.

Acked-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Chenyi Qiang <chenyi.qiang@intel.com>
Message-Id: <20220929072014.20705-2-chenyi.qiang@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
target/i386/cpu.c
target/i386/cpu.h
target/i386/kvm/kvm.c
target/i386/machine.c