Skip to contentSkip to conversation

x86/S3: don't lose previously collected CPU data

PATCH In review Jan Beulich 2 participants 2 messages Jul 17, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/S3: don't lose previously collected CPU data

smp_store_cpu_info() doesn't call identify_cpu() again during S3 resume, hence it is wrong to overwrite APs' data using boot_cpu_data. With 7126b7f806d54 ("x86/CPU: re-work populating of cpu_data[]") this now results in a crash, as the cpu_to_socket() use in smp_store_cpu_info() then obtains a bad socket number, much like was already observed in [1].

[1] https://lists.xen.org/archives/html/xen-devel/2025-06/msg01879.html

Fixes bb502a8ca5925 ("x86: check feature flags after resume")
xen/arch/x86/smpboot.c +3 -1
@@ -370,7 +370,9 @@ void asmlinkage start_secondary(void)
 
     cpu_init();
 
-    initialize_cpu_data(cpu);
+    /* During resume, must not clear previously collected data. */
+    if ( system_state != SYS_STATE_resume )
+        initialize_cpu_data(cpu);
 
     microcode_update_one();
 
Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines · Jan Beulich

smp_store_cpu_info() doesn't call identify_cpu() again during S3 resume, hence it is wrong to overwrite APs' data using boot_cpu_data. With 7126b7f806d54 ("x86/CPU: re-work populating of cpu_data[]") this now results in a crash, as the cpu_to_socket() use in smp_store_cpu_info() then obtains a bad socket number, much like was already observed in [1].

[1] https://lists.xen.org/archives/html/xen-devel/2025-06/msg01879.html

Fixes bb502a8ca5925 ("x86: check feature flags after resume")

Thanks, Roger.