Skip to contentSkip to conversation

x86/cache: Restore AP cache state while bringing CPUs online on resume

PATCH New Andre Eikmeyer 1 participant 1 message Nov 11 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/cache: Restore AP cache state while bringing CPUs online on resume

Some platform firmware, including that of Intel Macs, leaves the APs with an invalid MTRR state after resume. x86 delays the AP cache initialization until all APs are online, so an affected AP runs uncached through its bring-up. On a Core i9 MacBook Pro a resume can take up to a minute.

Drop the x86 thaw hooks so that cache_ap_online() restores the MTRR and PAT state of each AP as it comes online, as on CPU hotplug. The APs then come online right away. Boot keeps the delayed initialization.

Tested on a MacBookAir9,1, MacBookPro15,1 and MacBookPro16,1.

---
 arch/x86/kernel/smpboot.c | 10 ----------
 1 file changed, 10 deletions(-)
arch/x86/kernel/smpboot.c +0 -10
index dcbaf3f27..bb3fc9a7c 100644
@@ -1251,16 +1251,6 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus)
 	snp_set_wakeup_secondary_cpu();
 }
 
-void arch_thaw_secondary_cpus_begin(void)
-{
-	set_cache_aps_delayed_init(true);
-}
-
-void arch_thaw_secondary_cpus_end(void)
-{
-	cache_aps_init();
-}
-
 /*
  * Early setup to make printk work.
  */

base-commit: c6279551a44c06f4cb1f7b1df2fb8e0d6d6e54cd