[PATCH v2 9/9] x86: Add cleanup_before_linux()

Simon Glass sjg at chromium.org
Tue Feb 24 15:25:51 CET 2026


This function is not present on x86, but there is an x86-specific
version which is never called. This is a bug, meaning that APs are not
parked before booting.

The original weak function was added in 2012 by:
commit f30fc4de4160 ("x86: Add a default implementation for cleanup_before_linux()")

At later change made use of the weak function but was actually dead
code. The Fixes tag reflects that.

Add cleanup_before_linux(), making it call x86_cleanup_before_linux()

Fixes: 99a573fb326f ("x86: mp: Park CPUs before running the OS")
Signed-off-by: Simon Glass <simon.glass at canonical.com>
---

(no changes since v1)

 arch/x86/cpu/cpu.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/x86/cpu/cpu.c b/arch/x86/cpu/cpu.c
index c373b14df30..f756a9ebf09 100644
--- a/arch/x86/cpu/cpu.c
+++ b/arch/x86/cpu/cpu.c
@@ -80,6 +80,11 @@ int __weak x86_cleanup_before_linux(void)
 	return 0;
 }
 
+int cleanup_before_linux(void)
+{
+	return x86_cleanup_before_linux();
+}
+
 int x86_init_cache(void)
 {
 	enable_caches();
-- 
2.43.0



More information about the U-Boot mailing list