]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: Exempt pending triple fault from event injection sanity check
authorSean Christopherson <seanjc@google.com>
Fri, 30 Sep 2022 23:00:08 +0000 (23:00 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 27 Oct 2022 09:22:01 +0000 (05:22 -0400)
commitf3ed411cec400cc5a00b2b5e1042c625d47ba902
treeb0d67b4714edcc8f00a2b0c3ce3632728842beab
parented0ce82a146e641e84cf4782a50ac0774cc6bdb7
KVM: x86: Exempt pending triple fault from event injection sanity check

Exempt pending triple faults, a.k.a. KVM_REQ_TRIPLE_FAULT, when asserting
that KVM didn't attempt to queue a new exception during event injection.
KVM needs to emulate the injection itself when emulating Real Mode due to
lack of unrestricted guest support (VMX) and will queue a triple fault if
that emulation fails.

Ideally the assertion would more precisely filter out the emulated Real
Mode triple fault case, but rmode.vm86_active is buried in vcpu_vmx and
can't be queried without a new kvm_x86_ops.  And unlike "regular"
exceptions, triple fault cannot put the vCPU into an infinite loop; the
triple fault will force either an exit to userspace or a nested VM-Exit,
and triple fault after nested VM-Exit will force an exit to userspace.
I.e. there is no functional issue, so just suppress the warning for
triple faults.

Opportunistically convert the warning to a one-time thing, when it
fires, it fires _a lot_, and is usually user triggerable, i.e. can be
used to spam the kernel log.

Fixes: b620897a5bfd ("KVM: x86: Treat pending TRIPLE_FAULT requests as pending exceptions")
Reported-by: kernel test robot <yujie.liu@intel.com>
Link: https://lore.kernel.org/r/202209301338.aca913c3-yujie.liu@intel.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220930230008.1636044-1-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/x86.c