mirror of
https://github.com/AsahiLinux/m1n1
synced 2024-11-21 22:23:05 +00:00
smp: Write _vectors_start into boot CPU rvbar where possible
On A7-A11 we have a ROM exploit and we can keep CPU0 RVBAR unlocked. Signed-off-by: Nick Chan <towinchenmi@gmail.com>
This commit is contained in:
parent
3b7fd2ce5e
commit
dadc48ed10
1 changed files with 12 additions and 3 deletions
15
src/smp.c
15
src/smp.c
|
@ -319,9 +319,6 @@ void smp_start_secondaries(void)
|
|||
}
|
||||
|
||||
for (int i = 0; i < MAX_CPUS; i++) {
|
||||
|
||||
if (i == boot_cpu_idx)
|
||||
continue;
|
||||
int cpu_node = cpu_nodes[i];
|
||||
|
||||
if (!cpu_node)
|
||||
|
@ -342,6 +339,18 @@ void smp_start_secondaries(void)
|
|||
memcpy(cpu_impl_reg, ®s[index], 16);
|
||||
}
|
||||
|
||||
if (i == boot_cpu_idx) {
|
||||
// Check if already locked
|
||||
if (read64(cpu_impl_reg[0]) & 1)
|
||||
continue;
|
||||
|
||||
// Unlocked, write _vectors_start into boot CPU's rvbar
|
||||
write64(cpu_impl_reg[0], (u64)_vectors_start);
|
||||
sysop("dmb sy");
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
u8 core = FIELD_GET(CPU_REG_CORE, reg);
|
||||
u8 cluster = FIELD_GET(CPU_REG_CLUSTER, reg);
|
||||
u8 die = FIELD_GET(CPU_REG_DIE, reg);
|
||||
|
|
Loading…
Reference in a new issue