diff options
author | GUO Zihua <guozihua@huawei.com> | 2024-01-13 08:05:09 +0000 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2024-05-07 23:23:35 +1000 |
commit | 473e2311f31fdcae8e3f4410d119dbfece656edc (patch) | |
tree | 734f5adbebe0e3eb2463302874a1a8778dab472f /arch/powerpc | |
parent | acb354fe97e5aa6d9534b601ce18ef7866f25c4d (diff) |
powerpc: Fix preserved memory size for int-vectors
The first 32k of memory is reserved for interrupt vectors, however for
powerpc64 this might not be enough. Fix this by reserving the maximum
size between 32k and the real size of interrupt vectors.
Signed-off-by: GUO Zihua <guozihua@huawei.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20240113080509.1598290-1-guozihua@huawei.com
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/kernel/prom.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c index b8f764453eaa..eb140ea6b6ff 100644 --- a/arch/powerpc/kernel/prom.c +++ b/arch/powerpc/kernel/prom.c @@ -779,6 +779,7 @@ static inline void save_fscr_to_task(void) {} void __init early_init_devtree(void *params) { + phys_addr_t int_vector_size; DBG(" -> early_init_devtree(%px)\n", params); @@ -831,9 +832,16 @@ void __init early_init_devtree(void *params) setup_initial_memory_limit(memstart_addr, first_memblock_size); /* Reserve MEMBLOCK regions used by kernel, initrd, dt, etc... */ memblock_reserve(PHYSICAL_START, __pa(_end) - PHYSICAL_START); +#ifdef CONFIG_PPC64 + /* If relocatable, reserve at least 32k for interrupt vectors etc. */ + int_vector_size = __end_interrupts - _stext; + int_vector_size = max_t(phys_addr_t, SZ_32K, int_vector_size); +#else /* If relocatable, reserve first 32k for interrupt vectors etc. */ + int_vector_size = SZ_32K; +#endif if (PHYSICAL_START > MEMORY_START) - memblock_reserve(MEMORY_START, 0x8000); + memblock_reserve(MEMORY_START, int_vector_size); reserve_kdump_trampoline(); #if defined(CONFIG_FA_DUMP) || defined(CONFIG_PRESERVE_FA_DUMP) /* |