Skip to content
Snippets Groups Projects
Commit 9bb367a5 authored by Alexander Graf's avatar Alexander Graf Committed by Tom Rini
Browse files

arm64: Disable TTBR1 maps in EL1


When running in EL1, AArch64 knows two page table maps. One with addresses
that start with all zeros (TTBR0) and one with addresses that start with all
ones (TTBR1).

In U-Boot we don't care about the high up maps, so just disable them to ensure
we don't walk an invalid page table by accident.

Reported-by: default avatarMark Rutland <mark.rutland@arm.com>
Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
parent 0691484a
No related branches found
No related tags found
No related merge requests found
...@@ -71,7 +71,7 @@ static u64 get_tcr(int el, u64 *pips, u64 *pva_bits) ...@@ -71,7 +71,7 @@ static u64 get_tcr(int el, u64 *pips, u64 *pva_bits)
} }
if (el == 1) { if (el == 1) {
tcr = TCR_EL1_RSVD | (ips << 32); tcr = TCR_EL1_RSVD | (ips << 32) | TCR_EPD1_DISABLE;
} else if (el == 2) { } else if (el == 2) {
tcr = TCR_EL2_RSVD | (ips << 16); tcr = TCR_EL2_RSVD | (ips << 16);
} else { } else {
......
...@@ -154,6 +154,7 @@ ...@@ -154,6 +154,7 @@
#define TCR_TG0_4K (0 << 14) #define TCR_TG0_4K (0 << 14)
#define TCR_TG0_64K (1 << 14) #define TCR_TG0_64K (1 << 14)
#define TCR_TG0_16K (2 << 14) #define TCR_TG0_16K (2 << 14)
#define TCR_EPD1_DISABLE (1 << 23)
#ifndef CONFIG_SYS_FULL_VA #ifndef CONFIG_SYS_FULL_VA
#define TCR_EL1_IPS_BITS (UL(3) << 32) /* 42 bits physical address */ #define TCR_EL1_IPS_BITS (UL(3) << 32) /* 42 bits physical address */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment