mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 22:02:02 +00:00
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 <wanpengli@tencent.com> Message-Id: <1645777780-2581-1-git-send-email-wanpengli@tencent.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
ece32a75f0
commit
40cd58dbf1
1 changed files with 2 additions and 0 deletions
|
@ -463,6 +463,7 @@ static bool pv_tlb_flush_supported(void)
|
|||
return (kvm_para_has_feature(KVM_FEATURE_PV_TLB_FLUSH) &&
|
||||
!kvm_para_has_hint(KVM_HINTS_REALTIME) &&
|
||||
kvm_para_has_feature(KVM_FEATURE_STEAL_TIME) &&
|
||||
!boot_cpu_has(X86_FEATURE_MWAIT) &&
|
||||
(num_possible_cpus() != 1));
|
||||
}
|
||||
|
||||
|
@ -477,6 +478,7 @@ static bool pv_sched_yield_supported(void)
|
|||
return (kvm_para_has_feature(KVM_FEATURE_PV_SCHED_YIELD) &&
|
||||
!kvm_para_has_hint(KVM_HINTS_REALTIME) &&
|
||||
kvm_para_has_feature(KVM_FEATURE_STEAL_TIME) &&
|
||||
!boot_cpu_has(X86_FEATURE_MWAIT) &&
|
||||
(num_possible_cpus() != 1));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue