Re: [PATCH 1/2] KVM: VMX: avoid running vmx_handle_exit_irqoff in case of emulation
From: Paolo Bonzini
Date: Mon Sep 06 2021 - 06:09:32 EST
On 26/08/21 18:01, Sean Christopherson wrote:
+ if (vmx->emulation_required)
Rather than play whack-a-mole with flows consuming stale state, I'd much prefer
to synthesize a VM-Exit(INVALID_GUEST_STATE). Alternatively, just skip ->run()
entirely by adding hooks in vcpu_enter_guest(), but that's a much larger change
and probably not worth the risk at this juncture.
I'm going with Maxim's patch for now (and for stable kernels especially)
but I like the
+ if (unlikely(static_call(kvm_x86_emulation_required)(vcpu)))
+ return static_call(kvm_x86_emulate_invalid_guest_state)(vcpu);
idea. I'll put a Fixes for 95b5a48c4f2b ("KVM: VMX: Handle NMIs, #MCs and
async #PFs in common irqs-disabled fn", Linux 5.3).