[PATCH] x86/kvm: Don't use PVspinlock when mwait is advertised

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Li RongQing <lirongqing@xxxxxxxxx>

MWAIT is advertised in host is not overcommitted scenario, however,
pvspinlock should be enabled in host overcommitted scenario. Let's
add the MWAIT checking when enabling pvspinlock

Signed-off-by: Li RongQing <lirongqing@xxxxxxxxx>
---
 arch/x86/kernel/kvm.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
index 1cceac5..dfa1451 100644
--- a/arch/x86/kernel/kvm.c
+++ b/arch/x86/kernel/kvm.c
@@ -1087,6 +1087,11 @@ void __init kvm_spinlock_init(void)
 		goto out;
 	}
 
+	if (boot_cpu_has(X86_FEATURE_MWAIT)) {
+		pr_info("PV spinlocks disabled with mwait\n");
+		goto out;
+	}
+
 	if (num_possible_cpus() == 1) {
 		pr_info("PV spinlocks disabled, single CPU\n");
 		goto out;
-- 
2.9.4




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux