[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170503193733.13409-3-rkrcmar@redhat.com>
Date: Wed, 3 May 2017 21:37:31 +0200
From: Radim Krčmář <rkrcmar@...hat.com>
To: linux-kernel@...r.kernel.org, kvm@...r.kernel.org
Cc: Paolo Bonzini <pbonzini@...hat.com>,
Alexander Graf <agraf@...e.de>,
"Michael S. Tsirkin" <mst@...hat.com>,
"Gabriel L. Somlo" <gsomlo@...il.com>
Subject: [PATCH 2/4] KVM: x86: prevent MWAIT in guest with buggy MONITOR
The bug prevents MWAIT from waking up after a write to the monitored
cache line.
KVM might emulate a CPU model that shouldn't have the bug, so the guest
would not employ a workaround and possibly miss wakeups.
Better to avoid the situation.
Signed-off-by: Radim Krčmář <rkrcmar@...hat.com>
---
arch/x86/kvm/x86.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/x86/kvm/x86.h b/arch/x86/kvm/x86.h
index 3ed7dd8737ab..63d5fb65ea30 100644
--- a/arch/x86/kvm/x86.h
+++ b/arch/x86/kvm/x86.h
@@ -231,6 +231,9 @@ static inline bool kvm_mwait_in_guest(void)
return false;
}
+ if (boot_cpu_has_bug(X86_BUG_MONITOR))
+ return false;
+
/*
* Intel CPUs without CPUID5_ECX_INTERRUPT_BREAK are problematic as
* they would allow guest to stop the CPU completely by disabling
--
2.12.2
Powered by blists - more mailing lists