]> git.baikalelectronics.ru Git - kernel.git/commit
X86/KVM: Do not allow DISABLE_EXITS_MWAIT when LAPIC ARAT is not available
authorKarimAllah Ahmed <karahmed@amazon.de>
Wed, 11 Apr 2018 09:16:03 +0000 (11:16 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 11 Apr 2018 09:34:16 +0000 (11:34 +0200)
commita39d6e3379ee15555d56beaa1e5a51925980dc78
tree3f7a1e1c57a191b14931f93459eaf2763b8df457
parentad054630e431bdc78ecedd292a89259cee776e69
X86/KVM: Do not allow DISABLE_EXITS_MWAIT when LAPIC ARAT is not available

If the processor does not have an "Always Running APIC Timer" (aka ARAT),
we should not give guests direct access to MWAIT. The LAPIC timer would
stop ticking in deep C-states, so any host deadlines would not wakeup the
host kernel.

The host kernel intel_idle driver handles this by switching to broadcast
mode when ARAT is not available and MWAIT is issued with a deep C-state
that would stop the LAPIC timer. When MWAIT is passed through, we can not
tell when MWAIT is issued.

So just disable this capability when LAPIC ARAT is not available. I am not
even sure if there are any CPUs with VMX support but no LAPIC ARAT or not.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Radim Krčmář <rkrcmar@redhat.com>
Reported-by: Wanpeng Li <kernellwp@gmail.com>
Signed-off-by: KarimAllah Ahmed <karahmed@amazon.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/x86.c