summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorHuang Pei <huangpei@loongson.cn>2024-01-23 09:47:57 +0800
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>2024-01-26 10:33:34 +0100
commitabcabb9e30a1f9a69c76776f8abffc31c377b542 (patch)
treee6d713167c96ff9a1a75c302f4e5a0518deb38ca /arch
parentdd3c33ccbb8f0dc6a256dc55e7607569aea69721 (diff)
MIPS: reserve exception vector space ONLY ONCE
"cpu_probe" is called both by BP and APs, but reserving exception vector (like 0x0-0x1000) called by "cpu_probe" need once and calling on APs is too late since memblock is unavailable at that time. So, reserve exception vector ONLY by BP. Suggested-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Signed-off-by: Huang Pei <huangpei@loongson.cn> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/mips/kernel/traps.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index dec6878b35f6..a1c1cb5de913 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -2007,7 +2007,13 @@ unsigned long vi_handlers[64];
void reserve_exception_space(phys_addr_t addr, unsigned long size)
{
- memblock_reserve(addr, size);
+ /*
+ * reserve exception space on CPUs other than CPU0
+ * is too late, since memblock is unavailable when APs
+ * up
+ */
+ if (smp_processor_id() == 0)
+ memblock_reserve(addr, size);
}
void __init *set_except_vector(int n, void *addr)