2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2025-01-15 00:54:03 +08:00

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.

Reviewed-by: Alexander Graf <agraf@suse.de>
Acked-by: Borislav Petkov <bp@suse.de>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Radim Krčmář 2017-11-29 22:23:41 +01:00 committed by Paolo Bonzini
parent 0d37d26f11
commit 2a140f3b6e

View File

@ -281,6 +281,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