1
0
Fork 0

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>
hifive-unleashed-5.1
Radim Krčmář 2017-11-29 22:23:41 +01:00 committed by Paolo Bonzini
parent 0d37d26f11
commit 2a140f3b6e
1 changed files with 3 additions and 0 deletions

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