KVM: nVMX: don't clear mtf_pending when nested events are blocked

If nested events are blocked, don't clear the mtf_pending flag to avoid
missing later delivery of the MTF VM-exit.

Fixes: 5ef8acbdd6 ("KVM: nVMX: Emulate MTF when performing instruction emulation")
Signed-off-by: Oliver Upton <oupton@google.com>
Message-Id: <20200406201237.178725-1-oupton@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Oliver Upton 2020-04-06 20:12:37 +00:00 committed by Paolo Bonzini
parent da7e423209
commit 5c8beb4746
1 changed files with 2 additions and 1 deletions

View File

@ -3645,6 +3645,7 @@ static int vmx_check_nested_events(struct kvm_vcpu *vcpu)
* Clear the MTF state. If a higher priority VM-exit is delivered first, * Clear the MTF state. If a higher priority VM-exit is delivered first,
* this state is discarded. * this state is discarded.
*/ */
if (!block_nested_events)
vmx->nested.mtf_pending = false; vmx->nested.mtf_pending = false;
if (lapic_in_kernel(vcpu) && if (lapic_in_kernel(vcpu) &&