mirror of
https://github.com/crash-utility/crash
synced 2025-02-21 16:06:49 +00:00
arm64: use dedicated bits to record the VA space layout changes
arm64 memory layout experiences big changes due to the following kernel commits in date descending order: 5. 7bc1a0f9e176 arm64: mm: use single quantity to represent the PA to VA translation 4. b6d00d47e81a arm64: mm: Introduce 52-bit Kernel VAs 3. 5383cc6efed1 arm64: mm: Introduce vabits_actual 2. 14c127c957c1 arm64: mm: Flip kernel VA space 1. f80fb3a3d508 arm64: add support for kernel ASLR For 1, crash has already used NEW_VMEMMAP to trace it. For 2, crash lacks a flag to tag it and handle it differently. For 3, two important kernel variables vabits_actual and physvirt_offset are introduced. For 4, since it comes immediately after 3, crash-utility does not need to distinguish it. For 5, kernel variable phyvirt_offset is removed These changes have effects on PTOV()/VTOP() formula. So introducing two bits HAS_PHYSVIRT_OFFSET and FLIPPED_VM as hint to apply different formula. Signed-off-by: Pingfan Liu <piliu@redhat.com>
This commit is contained in:
parent
167d37e347
commit
bf1379a8b6
10
arm64.c
10
arm64.c
@ -563,6 +563,10 @@ arm64_dump_machdep_table(ulong arg)
|
||||
fprintf(fp, "%sMACHDEP_BT_TEXT", others++ ? "|" : "");
|
||||
if (machdep->flags & NEW_VMEMMAP)
|
||||
fprintf(fp, "%sNEW_VMEMMAP", others++ ? "|" : "");
|
||||
if (machdep->flags & FLIPPED_VM)
|
||||
fprintf(fp, "%sFLIPPED_VM", others++ ? "|" : "");
|
||||
if (machdep->flags & HAS_PHYSVIRT_OFFSET)
|
||||
fprintf(fp, "%sHAS_PHYSVIRT_OFFSET", others++ ? "|" : "");
|
||||
fprintf(fp, ")\n");
|
||||
|
||||
fprintf(fp, " kvbase: %lx\n", machdep->kvbase);
|
||||
@ -997,6 +1001,7 @@ arm64_calc_physvirt_offset(void)
|
||||
if (READMEM(pc->mfd, &physvirt_offset, sizeof(physvirt_offset),
|
||||
sp->value, sp->value -
|
||||
machdep->machspec->kimage_voffset) > 0) {
|
||||
machdep->flags |= HAS_PHYSVIRT_OFFSET;
|
||||
ms->physvirt_offset = physvirt_offset;
|
||||
}
|
||||
}
|
||||
@ -3963,6 +3968,11 @@ arm64_calc_VA_BITS(void)
|
||||
error(FATAL, "cannot determine VA_BITS_ACTUAL\n");
|
||||
}
|
||||
|
||||
/*
|
||||
* The mm flip commit is introduced before 52-bits VA, which is before the
|
||||
* commit to export NUMBER(TCR_EL1_T1SZ)
|
||||
*/
|
||||
machdep->flags |= FLIPPED_VM;
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user