Skip to content

Commit 40cd58d

Browse files
Wanpeng Libonzini
authored andcommitted
x86/kvm: Don't use PV TLB/yield when mwait is advertised
MWAIT is advertised in host is not overcommitted scenario, however, PV TLB/sched yield should be enabled in host overcommitted scenario. Let's add the MWAIT checking when enabling PV TLB/sched yield. Signed-off-by: Wanpeng Li <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent ece32a7 commit 40cd58d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

arch/x86/kernel/kvm.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,7 @@ static bool pv_tlb_flush_supported(void)
463463
return (kvm_para_has_feature(KVM_FEATURE_PV_TLB_FLUSH) &&
464464
!kvm_para_has_hint(KVM_HINTS_REALTIME) &&
465465
kvm_para_has_feature(KVM_FEATURE_STEAL_TIME) &&
466+
!boot_cpu_has(X86_FEATURE_MWAIT) &&
466467
(num_possible_cpus() != 1));
467468
}
468469

@@ -477,6 +478,7 @@ static bool pv_sched_yield_supported(void)
477478
return (kvm_para_has_feature(KVM_FEATURE_PV_SCHED_YIELD) &&
478479
!kvm_para_has_hint(KVM_HINTS_REALTIME) &&
479480
kvm_para_has_feature(KVM_FEATURE_STEAL_TIME) &&
481+
!boot_cpu_has(X86_FEATURE_MWAIT) &&
480482
(num_possible_cpus() != 1));
481483
}
482484

0 commit comments

Comments
 (0)