Skip to content

Commit 5b526bd

Browse files
Jean-Philippe BruckerRussell King
authored andcommitted
ARM: 8572/1: nommu: change memory reserve for the vectors
Commit 19accfd (ARM: move vector stubs) moved the vector stubs in an additional page above the base vector one. This change wasn't taken into account by the nommu memreserve. This patch ensures that the kernel won't overwrite any vector stub on nommu. [changed the MPU side too] Signed-off-by: Jean-Philippe Brucker <[email protected]> Signed-off-by: Vladimir Murzin <[email protected]> Signed-off-by: Russell King <[email protected]>
1 parent 695665b commit 5b526bd

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

arch/arm/kernel/head-nommu.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ ENTRY(__setup_mpu)
236236
mov r0, #CONFIG_VECTORS_BASE @ Cover from VECTORS_BASE
237237
ldr r5,=(MPU_AP_PL1RW_PL0NA | MPU_RGN_NORMAL)
238238
/* Writing N to bits 5:1 (RSR_SZ) --> region size 2^N+1 */
239-
mov r6, #(((PAGE_SHIFT - 1) << MPU_RSR_SZ) | 1 << MPU_RSR_EN)
239+
mov r6, #(((2 * PAGE_SHIFT - 1) << MPU_RSR_SZ) | 1 << MPU_RSR_EN)
240240

241241
setup_region r0, r5, r6, MPU_DATA_SIDE @ VECTORS_BASE, PL0 NA, enabled
242242
beq 3f @ Memory-map not unified

arch/arm/mm/nommu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ void __init arm_mm_memblock_reserve(void)
286286
* some architectures which the DRAM is the exception vector to trap,
287287
* alloc_page breaks with error, although it is not NULL, but "0."
288288
*/
289-
memblock_reserve(CONFIG_VECTORS_BASE, PAGE_SIZE);
289+
memblock_reserve(CONFIG_VECTORS_BASE, 2 * PAGE_SIZE);
290290
#else /* ifndef CONFIG_CPU_V7M */
291291
/*
292292
* There is no dedicated vector page on V7-M. So nothing needs to be

0 commit comments

Comments
 (0)