
Hi.
I assume the following code in arch/arm/cpu/armv8/start.S is for spin-table.
#ifdef CONFIG_ARMV8_MULTIENTRY branch_if_master x0, x1, master_cpu
/* * Slave CPUs */ slave_cpu: wfe ldr x1, =CPU_RELEASE_ADDR ldr x0, [x1] cbz x0, slave_cpu br x0 /* branch to the given address */ master_cpu: /* On the master CPU */ #endif /* CONFIG_ARMV8_MULTIENTRY */
As Documentation/arm64/booting.txt of Linux says, slave CPUs should spin outside of the kernel in a reserved area of memory.
U-Boot generally works on DRAM, so the code for spin-table should be reserved in Device Tree.
Otherwise, the code above and the variable "CPU_RELEASE_ADDR" has been destroyed by the kernel by the time slave CPUs are kicked.
Now, I locally work-around this problem by pre-fetching necessary code to the I-cache, but this solution is unstable.
My question is, is there a solution to protect spin-table code already? (or on-going work to solve the problem?)
One problem specific for U-Boot is that, U-Boot relocates itself to the tail of DRAM. So, it is difficult to reserve the code statically at the compile time of DT.
Thought?