From: Andrey Smirnov <andrew.smirnov@gmail.com>
To: barebox@lists.infradead.org
Cc: Andrey Smirnov <andrew.smirnov@gmail.com>
Subject: [PATCH 2/3] ARM: mmu: Add VBAR setup
Date: Sun, 10 Jan 2016 16:58:11 -0800 [thread overview]
Message-ID: <1452473892-19791-2-git-send-email-andrew.smirnov@gmail.com> (raw)
In-Reply-To: <1452473892-19791-1-git-send-email-andrew.smirnov@gmail.com>
Add code to make sure that normal vector exception table, when it is
used due to unavailability of the high vector table, was not re-mapped
from 0x0 via VBAR by someone else before us.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
Changes since v1 (http://lists.infradead.org/pipermail/barebox/2015-December/025685.html):
- Check CPU architecture at runtime
---
arch/arm/cpu/mmu.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/arch/arm/cpu/mmu.c b/arch/arm/cpu/mmu.c
index 784221c..bc5325f 100644
--- a/arch/arm/cpu/mmu.c
+++ b/arch/arm/cpu/mmu.c
@@ -302,6 +302,16 @@ static void vectors_init(void)
* live without being able to catch NULL pointer dereferences
*/
exc = arm_create_pte(0x0);
+
+ if (cpu_architecture() >= CPU_ARCH_ARMv7) {
+ /*
+ * ARMv7 CPUs allow to remap low vectors from
+ * 0x0 to an arbitrary address using VBAR
+ * register, so let's make sure we have it
+ * pointing to the correct address
+ */
+ set_vbar(0x0);
+ }
}
arm_fixup_vectors();
--
2.5.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2016-01-11 0:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-11 0:58 [PATCH v2 1/3] ARM: asm: Add convenience fucntions to access VBAR Andrey Smirnov
2016-01-11 0:58 ` Andrey Smirnov [this message]
2016-01-11 0:58 ` [PATCH 3/3] ARM: Fix exception table setup in MMU-less mode Andrey Smirnov
2016-01-11 10:49 ` [PATCH v2 1/3] ARM: asm: Add convenience fucntions to access VBAR Sascha Hauer
2016-01-11 23:58 ` Andrey Smirnov
2016-01-12 8:45 ` Sascha Hauer
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=1452473892-19791-2-git-send-email-andrew.smirnov@gmail.com \
--to=andrew.smirnov@gmail.com \
--cc=barebox@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox