-
Notifications
You must be signed in to change notification settings - Fork 47
Closed
Labels
Description
Description
On AArch64, the CPU ID retrieved during early boot is corrupted in non-debug (optimized) builds. The corruption occurs before SMP bring-up, indicating that the issue originates in the early boot path rather than later runtime logic.
Root Cause
At address 0x40400050, x17 is used as a loop variable after compiler optimization. In earlier (non-optimized or debug) builds, this register was not used for this purpose.
However:
x17is a caller-saved register per the AArch64 ABI- Its value is assumed to remain intact across calls during early boot
- This assumption is invalid under optimization
As a result, x17—which temporarily holds the CPU ID—is overwritten during boot_pt_init, leading to corrupted CPU identification.
Resolution
The issue is resolved by:
- Replacing the use of
x17withx19, which is callee-saved according to the AArch64 calling convention