xen/22416-acpi-check-mwait.patch

22 lines
803 B
Diff
Raw Normal View History

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1290453180 0
# Node ID 0cc4ed1ce1f34ce442ed4da106e555931c895395
# Parent 899131a8f9d2b99acc4bbe18593952d30446e71b
x86: Check for MWAIT in CPUID before using it in ACPI idle code.
Signed-off-by: Keir Fraser <keir@xen.org>
--- a/xen/arch/x86/acpi/cpu_idle.c
+++ b/xen/arch/x86/acpi/cpu_idle.c
@@ -717,7 +717,8 @@ static void set_cx(
{
case ACPI_ADR_SPACE_FIXED_HARDWARE:
if ( xen_cx->reg.bit_width == VENDOR_INTEL &&
- xen_cx->reg.bit_offset == NATIVE_CSTATE_BEYOND_HALT )
+ xen_cx->reg.bit_offset == NATIVE_CSTATE_BEYOND_HALT &&
+ boot_cpu_has(X86_FEATURE_MWAIT) )
cx->entry_method = ACPI_CSTATE_EM_FFH;
else
cx->entry_method = ACPI_CSTATE_EM_HALT;