[coreboot-gerrit] New patch to review for coreboot: 2ae4547 arm64: Reinit free_idx to 1 in mmu_init
Patrick Georgi (pgeorgi@google.com)
gerrit at coreboot.org
Fri Mar 27 09:39:57 CET 2015
Patrick Georgi (pgeorgi at google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/9068
-gerrit
commit 2ae4547427d8d24178ba06b473a320acfbbf0c6e
Author: Furquan Shaikh <furquan at google.com>
Date: Sat Sep 6 18:47:33 2014 -0700
arm64: Reinit free_idx to 1 in mmu_init
If mmu_init is called more than once then, free_idx should be reset to
1. Here, the assumption would be that mmu_init will not be called more than
once. However, this is not necessarily true. Thus, free_idx should be reset to 1
every time we are initializing ttb from scratch.
BUG=None
BRANCH=None
TEST=Compiles sucessfully and boots to kernel
Change-Id: I5ac0af43346a492583380b0f15101390fc98d182
Signed-off-by: Patrick Georgi <pgeorgi at chromium.org>
Original-Commit-Id: 398a68c3b08d82cfa521d235af2c1922629bdf56
Original-Change-Id: Idb7424df7dd577f263f12d1527dbd7fb89216d40
Original-Signed-off-by: Furquan Shaikh <furquan at google.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/216906
Original-Reviewed-by: Aaron Durbin <adurbin at chromium.org>
Original-Tested-by: Furquan Shaikh <furquan at chromium.org>
Original-Commit-Queue: Furquan Shaikh <furquan at chromium.org>
---
src/arch/arm64/armv8/mmu.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/arch/arm64/armv8/mmu.c b/src/arch/arm64/armv8/mmu.c
index 2c1555c..8fde41f 100644
--- a/src/arch/arm64/armv8/mmu.c
+++ b/src/arch/arm64/armv8/mmu.c
@@ -40,6 +40,7 @@
static unsigned int max_tables;
/* Address of ttb buffer */
static uint64_t *xlat_addr;
+static int free_idx;
static const uint64_t level_to_addr_mask[] = {
L1_ADDR_MASK,
@@ -74,7 +75,6 @@ static uint64_t get_block_attr(unsigned long tag)
attr |= BLOCK_INDEX_MEM_DEV_NGNRNE << BLOCK_INDEX_SHIFT;
}
-
return attr;
}
@@ -103,7 +103,6 @@ static uint64_t table_desc_valid(uint64_t desc)
*/
static uint64_t *get_new_table(void)
{
- static int free_idx = 1;
uint64_t *new;
if (free_idx >= max_tables) {
@@ -260,6 +259,7 @@ void mmu_init(struct memranges *mmap_ranges,
memset((void*)ttb_buffer, 0, GRANULE_SIZE);
max_tables = (ttb_size >> GRANULE_SIZE_SHIFT);
xlat_addr = ttb_buffer;
+ free_idx = 1;
memranges_each_entry(mmap_entry, mmap_ranges) {
init_mmap_entry(mmap_entry);
More information about the coreboot-gerrit
mailing list