----- Original Message -----
For virtual address with idmap, we just use VTOP to
do the translate. So we should not use one way for
arm and LPAE enabled arm.
This bugs occurs when the phys_base exceeds 4G. So
we could not meet this bugs at most case. But for
keystone platfrom, whose codes has been upstreamed
recently. It boots on 2G-4G physical maps, then
rebuilds its pagetables on 16G-18G. So, its phys_base
is 16G.
Signed-off-by: Liu Hua <sdu.liu(a)huawei.com>
Queued for crash-7.1.0:
https://github.com/crash-utility/crash/commit/da668253994d8230d3a77bc4f64...
Thanks,
Dave
---
arm.c | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)
diff --git a/arm.c b/arm.c
index 23d9b51..43e3aab 100644
--- a/arm.c
+++ b/arm.c
@@ -1095,6 +1095,18 @@ arm_lpae_vtop(ulong vaddr, ulong *pgd, physaddr_t
*paddr, int verbose)
pmd_t pmd_pte;
pte_t pte;
+ if (!vt->vmalloc_start) {
+ *paddr = LPAE_VTOP(vaddr);
+ return TRUE;
+ }
+
+ if (!IS_VMALLOC_ADDR(vaddr)) {
+ *paddr = LPAE_VTOP(vaddr);
+ if (!verbose)
+ return TRUE;
+ }
+
+
if (verbose)
fprintf(fp, "PAGE DIRECTORY: %lx\n", (ulong)pgd);
@@ -1231,6 +1243,11 @@ arm_kvtop(struct task_context *tc, ulong kvaddr,
physaddr_t *paddr, int verbose)
if (!IS_KVADDR(kvaddr))
return FALSE;
+ if (machdep->flags & PAE)
+ return arm_lpae_vtop(kvaddr, (ulong *)vt->kernel_pgd[0],
+ paddr, verbose);
+
+
if (!vt->vmalloc_start) {
*paddr = VTOP(kvaddr);
return TRUE;
@@ -1242,9 +1259,6 @@ arm_kvtop(struct task_context *tc, ulong kvaddr,
physaddr_t *paddr, int verbose)
return TRUE;
}
- if (machdep->flags & PAE)
- return arm_lpae_vtop(kvaddr, (ulong *)vt->kernel_pgd[0],
- paddr, verbose);
return arm_vtop(kvaddr, (ulong *)vt->kernel_pgd[0], paddr, verbose);
}
--
1.9.0