Skip to content

Commit 04a40ba

Browse files
kylee0215akpm00
authored andcommitted
scripts/gdb: set vabits_actual based on TCR_EL1
We encounter the following issue after commit 9cce9c6 ("arm64: mm: Handle LVA support as a CPU feature"). (gdb) lx-slabinfo Python Exception <class 'gdb.error'>: No symbol "vabits_actual" in current context. Error occurred in Python: No symbol "vabits_actual" in current context. We set vabits_actual based on TCR_EL1 value when VA_BITS is bigger than 48. Link: https://lkml.kernel.org/r/[email protected] Fixes: 9cce9c6 ("arm64: mm: Handle LVA support as a CPU feature") Signed-off-by: Kuan-Ying Lee <[email protected]> Cc: Jan Kiszka <[email protected]> Cc: Kieran Bingham <[email protected]> Cc: Kirill A. Shutemov <[email protected]> Cc: Michael Ellerman <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 3c0e9a2 commit 04a40ba

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

scripts/gdb/linux/mm.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ def __init__(self):
4848
self.VA_BITS = constants.LX_CONFIG_ARM64_VA_BITS
4949
if self.VA_BITS > 48:
5050
self.VA_BITS_MIN = 48
51-
self.vabits_actual = gdb.parse_and_eval('vabits_actual')
51+
tcr_el1 = gdb.execute("info registers $TCR_EL1", to_string=True)
52+
tcr_el1 = int(tcr_el1.split()[1], 16)
53+
self.vabits_actual = 64 - ((tcr_el1 >> 16) & 63)
5254
else:
5355
self.VA_BITS_MIN = self.VA_BITS
5456
self.vabits_actual = self.VA_BITS

0 commit comments

Comments
 (0)