Skip to content

Commit e400ad8

Browse files
davehansenintelhansendc
authored andcommitted
ACPI: processor idle: Practically limit "Dummy wait" workaround to old Intel systems
Old, circa 2002 chipsets have a bug: they don't go idle when they are supposed to. So, a workaround was added to slow the CPU down and ensure that the CPU waits a bit for the chipset to actually go idle. This workaround is ancient and has been in place in some form since the original kernel ACPI implementation. But, this workaround is very painful on modern systems. The "inl()" can take thousands of cycles (see Link: for some more detailed numbers and some fun kernel archaeology). First and foremost, modern systems should not be using this code. Typical Intel systems have not used it in over a decade because it is horribly inferior to MWAIT-based idle. Despite this, people do seem to be tripping over this workaround on AMD system today. Limit the "dummy wait" workaround to Intel systems. Keep Modern AMD systems from tripping over the workaround. Remotely modern Intel systems use intel_idle instead of this code and will, in practice, remain unaffected by the dummy wait. Reported-by: K Prateek Nayak <[email protected]> Suggested-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Dave Hansen <[email protected]> Reviewed-by: Mario Limonciello <[email protected]> Tested-by: K Prateek Nayak <[email protected]> Link: https://lore.kernel.org/all/[email protected]/ Link: https://lkml.kernel.org/r/[email protected]
1 parent 81fa6fd commit e400ad8

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

drivers/acpi/processor_idle.c

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -531,10 +531,27 @@ static void wait_for_freeze(void)
531531
/* No delay is needed if we are in guest */
532532
if (boot_cpu_has(X86_FEATURE_HYPERVISOR))
533533
return;
534+
/*
535+
* Modern (>=Nehalem) Intel systems use ACPI via intel_idle,
536+
* not this code. Assume that any Intel systems using this
537+
* are ancient and may need the dummy wait. This also assumes
538+
* that the motivating chipset issue was Intel-only.
539+
*/
540+
if (boot_cpu_data.x86_vendor != X86_VENDOR_INTEL)
541+
return;
534542
#endif
535-
/* Dummy wait op - must do something useless after P_LVL2 read
536-
because chipsets cannot guarantee that STPCLK# signal
537-
gets asserted in time to freeze execution properly. */
543+
/*
544+
* Dummy wait op - must do something useless after P_LVL2 read
545+
* because chipsets cannot guarantee that STPCLK# signal gets
546+
* asserted in time to freeze execution properly
547+
*
548+
* This workaround has been in place since the original ACPI
549+
* implementation was merged, circa 2002.
550+
*
551+
* If a profile is pointing to this instruction, please first
552+
* consider moving your system to a more modern idle
553+
* mechanism.
554+
*/
538555
inl(acpi_gbl_FADT.xpm_timer_block.address);
539556
}
540557

0 commit comments

Comments
 (0)