mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-07 09:55:19 +02:00
powerpc/8xx: Fix initial memory mapping
[ Upstream commitf9f2bff64c
] Commitcf209951fa
("powerpc/8xx: Map linear memory with huge pages") introduced an initial mapping of kernel TEXT using PAGE_KERNEL_TEXT, but the pages that contain kernel TEXT may also contain kernel RODATA, and depending on selected debug options PAGE_KERNEL_TEXT may be either RWX or ROX. RODATA must be writable during init because it also contains ro_after_init data. So use PAGE_KERNEL_X instead to be sure it is RWX. Fixes:cf209951fa
("powerpc/8xx: Map linear memory with huge pages") Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/dac7a828d8497c4548c91840575a706657baa4f1.1724173828.git.christophe.leroy@csgroup.eu Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
415a2c2183
commit
6b7a006ab0
|
@ -149,11 +149,11 @@ unsigned long __init mmu_mapin_ram(unsigned long base, unsigned long top)
|
|||
|
||||
mmu_mapin_immr();
|
||||
|
||||
mmu_mapin_ram_chunk(0, boundary, PAGE_KERNEL_TEXT, true);
|
||||
mmu_mapin_ram_chunk(0, boundary, PAGE_KERNEL_X, true);
|
||||
if (debug_pagealloc_enabled_or_kfence()) {
|
||||
top = boundary;
|
||||
} else {
|
||||
mmu_mapin_ram_chunk(boundary, einittext8, PAGE_KERNEL_TEXT, true);
|
||||
mmu_mapin_ram_chunk(boundary, einittext8, PAGE_KERNEL_X, true);
|
||||
mmu_mapin_ram_chunk(einittext8, top, PAGE_KERNEL, true);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user