From 40ce7374d3d6c495834b41f0a98f0bd6cb620dc4 Mon Sep 17 00:00:00 2001 From: Matthias Welwarsky Date: Mon, 26 Sep 2016 11:08:11 +0200 Subject: [PATCH] aarch64: remove bogus os_border calculation The artificial "os_border" doesn't exist in aarch64 state and is wrong for aarch32 state as well. Remove it. Change-Id: I7c673a1404b03aa78dbd505e115fa3a93f7ca05f Signed-off-by: Matthias Welwarsky --- src/target/armv8.c | 40 +++++----------------------------------- src/target/armv8.h | 1 - 2 files changed, 5 insertions(+), 36 deletions(-) diff --git a/src/target/armv8.c b/src/target/armv8.c index 467c7716..d644963b 100644 --- a/src/target/armv8.c +++ b/src/target/armv8.c @@ -441,7 +441,7 @@ done: return retval; } -static int armv8_read_ttbcr(struct target *target) +static __unused int armv8_read_ttbcr(struct target *target) { struct armv8_common *armv8 = target_to_armv8(target); struct arm_dpm *dpm = armv8->arm.dpm; @@ -511,48 +511,18 @@ static int armv8_read_ttbcr(struct target *target) if (retval != ERROR_OK) goto done; -#if 0 - LOG_INFO("ttb1 %s ,ttb0_mask %llx", - armv8->armv8_mmu.ttbr1_used ? "used" : "not used", - armv8->armv8_mmu.ttbr0_mask); -#endif - if (armv8->armv8_mmu.ttbr1_used == 1) { - LOG_INFO("TTBR0 access above %" PRIx64, - (uint64_t)(armv8->armv8_mmu.ttbr0_mask)); - armv8->armv8_mmu.os_border = armv8->armv8_mmu.ttbr0_mask; - } else { - /* fix me , default is hard coded LINUX border */ - armv8->armv8_mmu.os_border = 0xc0000000; - } + if (armv8->armv8_mmu.ttbr1_used == 1) + LOG_INFO("TTBR0 access above %" PRIx64, (uint64_t)(armv8->armv8_mmu.ttbr0_mask)); + done: dpm->finish(dpm); return retval; } -static int armv8_4K_translate(struct target *target, target_addr_t va, target_addr_t *val) -{ - LOG_ERROR("4K page Address translation need to add"); - return ERROR_FAIL; -} - - /* method adapted to cortex A : reused arm v4 v5 method*/ int armv8_mmu_translate_va(struct target *target, target_addr_t va, target_addr_t *val) { - int retval = ERROR_FAIL; - struct armv8_common *armv8 = target_to_armv8(target); - struct arm_dpm *dpm = armv8->arm.dpm; - - retval = dpm->prepare(dpm); - retval += armv8_read_ttbcr(target); - if (retval != ERROR_OK) - goto done; - if (armv8->page_size == 0) - return armv8_4K_translate(target, va, val); - -done: - dpm->finish(dpm); - return ERROR_FAIL; + return ERROR_OK; } /* V8 method VA TO PA */ diff --git a/src/target/armv8.h b/src/target/armv8.h index 2862ebd8..07e3b419 100644 --- a/src/target/armv8.h +++ b/src/target/armv8.h @@ -124,7 +124,6 @@ struct armv8_mmu_common { /* following field mmu working way */ int32_t ttbr1_used; /* -1 not initialized, 0 no ttbr1 1 ttbr1 used and */ uint64_t ttbr0_mask;/* masked to be used */ - uint32_t os_border; uint32_t ttbcr; /* cache for ttbcr register */ uint32_t ttbr_mask[2]; -- 2.39.5