From c76926739507a0d20d3dde65192154c8982e4b90 Mon Sep 17 00:00:00 2001 From: Furquan Shaikh Date: Tue, 31 Mar 2015 22:15:07 -0700 Subject: [PATCH] libpayload: Correct shareability mmu configuration on ARM64 BUG=chrome-os-partner:38222 BRANCH=None TEST=Compiles successfully and boots kernel Change-Id: I6e1e841d84d1a73e5c726143aeba76af933e81a1 Signed-off-by: Patrick Georgi Original-Commit-Id: 59861a2700407b9e6a6209fbc45543c127b50b4b Original-Change-Id: I256d07a41bec83037f2b61a9350f903119d8c101 Original-Signed-off-by: Furquan Shaikh Original-Reviewed-on: https://chromium-review.googlesource.com/263325 Original-Reviewed-by: Aaron Durbin Original-Commit-Queue: Furquan Shaikh Original-Trybot-Ready: Furquan Shaikh Original-Tested-by: Furquan Shaikh Reviewed-on: http://review.coreboot.org/9902 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer --- payloads/libpayload/arch/arm64/mmu.c | 1 + payloads/libpayload/include/arm64/arch/mmu.h | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/payloads/libpayload/arch/arm64/mmu.c b/payloads/libpayload/arch/arm64/mmu.c index adbee0f4b8..204412efd5 100644 --- a/payloads/libpayload/arch/arm64/mmu.c +++ b/payloads/libpayload/arch/arm64/mmu.c @@ -93,6 +93,7 @@ static uint64_t get_block_attr(unsigned long tag) switch (tag) { case TYPE_NORMAL_MEM: + attr |= BLOCK_SH_INNER_SHAREABLE; attr |= (BLOCK_INDEX_MEM_NORMAL << BLOCK_INDEX_SHIFT); break; case TYPE_DEV_MEM: diff --git a/payloads/libpayload/include/arm64/arch/mmu.h b/payloads/libpayload/include/arm64/arch/mmu.h index 52b538ed67..e241d7593f 100644 --- a/payloads/libpayload/include/arm64/arch/mmu.h +++ b/payloads/libpayload/include/arm64/arch/mmu.h @@ -80,6 +80,12 @@ extern char _start[], _end[]; #define BLOCK_ACCESS (1 << 10) +#define BLOCK_SH_SHIFT (8) +#define BLOCK_SH_NON_SHAREABLE (0 << BLOCK_SH_SHIFT) +#define BLOCK_SH_UNPREDICTABLE (1 << BLOCK_SH_SHIFT) +#define BLOCK_SH_OUTER_SHAREABLE (2 << BLOCK_SH_SHIFT) +#define BLOCK_SH_INNER_SHAREABLE (3 << BLOCK_SH_SHIFT) + /* XLAT Table Init Attributes */ #define VA_START 0x0