All of lore.kernel.org
 help / color / mirror / Atom feed
From: vladimir.murzin@arm.com (Vladimir Murzin)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/3] ARM: nommu: change memory reserve for the vectors
Date: Fri, 22 Apr 2016 12:43:35 +0100	[thread overview]
Message-ID: <1461325416-29570-3-git-send-email-vladimir.murzin@arm.com> (raw)
In-Reply-To: <1461325416-29570-1-git-send-email-vladimir.murzin@arm.com>

From: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>

Commit 19accfd3 (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.

Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
[changed the MPU side too]
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
---
 arch/arm/kernel/head-nommu.S |    2 +-
 arch/arm/mm/nommu.c          |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/kernel/head-nommu.S b/arch/arm/kernel/head-nommu.S
index 9b8c5a1..fb1a69e 100644
--- a/arch/arm/kernel/head-nommu.S
+++ b/arch/arm/kernel/head-nommu.S
@@ -236,7 +236,7 @@ ENTRY(__setup_mpu)
 	mov	r0, #CONFIG_VECTORS_BASE	@ Cover from VECTORS_BASE
 	ldr	r5,=(MPU_AP_PL1RW_PL0NA | MPU_RGN_NORMAL)
 	/* Writing N to bits 5:1 (RSR_SZ) --> region size 2^N+1 */
-	mov	r6, #(((PAGE_SHIFT - 1) << MPU_RSR_SZ) | 1 << MPU_RSR_EN)
+	mov	r6, #(((2 * PAGE_SHIFT - 1) << MPU_RSR_SZ) | 1 << MPU_RSR_EN)
 
 	setup_region r0, r5, r6, MPU_DATA_SIDE	@ VECTORS_BASE, PL0 NA, enabled
 	beq	3f				@ Memory-map not unified
diff --git a/arch/arm/mm/nommu.c b/arch/arm/mm/nommu.c
index 4d113fc..d5805e4 100644
--- a/arch/arm/mm/nommu.c
+++ b/arch/arm/mm/nommu.c
@@ -286,7 +286,7 @@ void __init arm_mm_memblock_reserve(void)
 	 * some architectures which the DRAM is the exception vector to trap,
 	 * alloc_page breaks with error, although it is not NULL, but "0."
 	 */
-	memblock_reserve(CONFIG_VECTORS_BASE, PAGE_SIZE);
+	memblock_reserve(CONFIG_VECTORS_BASE, 2 * PAGE_SIZE);
 #else /* ifndef CONFIG_CPU_V7M */
 	/*
 	 * There is no dedicated vector page on V7-M. So nothing needs to be
-- 
1.7.9.5

  parent reply	other threads:[~2016-04-22 11:43 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-22 11:43 [PATCH 0/3] ARM: nommu: R-class fixes Vladimir Murzin
2016-04-22 11:43 ` [PATCH 1/3] ARM: nommu: fix PMSAv7 setup Vladimir Murzin
2016-04-22 11:43 ` Vladimir Murzin [this message]
2016-04-22 11:43 ` [PATCH 3/3] ARM: domain: move {set,get}_domain under config guard Vladimir Murzin
2016-04-27 10:49   ` [PATCH 3/3] ARM: domain: move {set, get}_domain " Russell King - ARM Linux
2016-04-27 12:16     ` Vladimir Murzin
2016-04-28 13:50       ` Russell King - ARM Linux
2016-04-28 14:44         ` Vladimir Murzin
2016-04-28 14:59           ` Russell King - ARM Linux
2016-04-28 15:06             ` Vladimir Murzin
2016-04-23  6:54 ` [PATCH 0/3] ARM: nommu: R-class fixes Afzal Mohammed
2016-04-25  7:55   ` Vladimir Murzin
2016-04-25 12:59     ` Arnd Bergmann
2016-04-25 13:30       ` Afzal Mohammed
2016-04-26  8:17         ` Vladimir Murzin
2016-04-26  8:17       ` Vladimir Murzin
2016-04-26  9:10         ` Arnd Bergmann
2016-04-26 10:57           ` Vladimir Murzin
2016-04-26 11:59             ` Arnd Bergmann
2016-04-26 12:24               ` Vladimir Murzin
2016-04-26 18:12                 ` Arnd Bergmann
2016-04-27  9:10                   ` Vladimir Murzin
2016-04-27  9:50                     ` Arnd Bergmann
2016-04-27 10:55                       ` Vladimir Murzin
2016-04-27 11:18                         ` Arnd Bergmann
2016-04-26 15:23               ` Afzal Mohammed
2016-04-28  9:41                 ` Maxime Coquelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1461325416-29570-3-git-send-email-vladimir.murzin@arm.com \
    --to=vladimir.murzin@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.