Skip to content

Commit 5c8beb4

Browse files
ouptonbonzini
authored andcommitted
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: 5ef8acb ("KVM: nVMX: Emulate MTF when performing instruction emulation") Signed-off-by: Oliver Upton <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent da7e423 commit 5c8beb4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

arch/x86/kvm/vmx/nested.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3645,7 +3645,8 @@ static int vmx_check_nested_events(struct kvm_vcpu *vcpu)
36453645
* Clear the MTF state. If a higher priority VM-exit is delivered first,
36463646
* this state is discarded.
36473647
*/
3648-
vmx->nested.mtf_pending = false;
3648+
if (!block_nested_events)
3649+
vmx->nested.mtf_pending = false;
36493650

36503651
if (lapic_in_kernel(vcpu) &&
36513652
test_bit(KVM_APIC_INIT, &apic->pending_events)) {

0 commit comments

Comments
 (0)