aboutsummaryrefslogtreecommitdiff
path: root/scripts/gdb/vmlinux-gdb.py
diff options
context:
space:
mode:
authorDmitrii Bundin <[email protected]>2023-01-02 20:10:14 +0300
committerAndrew Morton <[email protected]>2023-02-02 22:50:03 -0800
commite36903b0c19fc6e4cfd84a55840ac9559c3f2831 (patch)
tree1fe1fefacb3942e025d9b301632f8bc9c07b8a2e /scripts/gdb/vmlinux-gdb.py
parent9456d539acde9f92a52ffe477b4b86e35d214d1a (diff)
scripts/gdb: add mm introspection utils
This command provides a way to traverse the entire page hierarchy by a given virtual address on x86. In addition to qemu's commands info tlb/info mem it provides the complete information about the paging structure for an arbitrary virtual address. It supports 4KB/2MB/1GB and 5 level paging. Here is an example output for 2MB success translation: (gdb) translate-vm address cr3: cr3 binary data 0x1085be003 next entry physical address 0x1085be000 --- bit 3 page level write through False bit 4 page level cache disabled False level 4: entry address 0xffff8881085be7f8 page entry binary data 0x800000010ac83067 next entry physical address 0x10ac83000 --- bit 0 entry present True bit 1 read/write access allowed True bit 2 user access allowed True bit 3 page level write through False bit 4 page level cache disabled False bit 5 entry has been accessed True bit 7 page size False bit 11 restart to ordinary False bit 63 execute disable True level 3: entry address 0xffff88810ac83a48 page entry binary data 0x101af7067 next entry physical address 0x101af7000 --- bit 0 entry present True bit 1 read/write access allowed True bit 2 user access allowed True bit 3 page level write through False bit 4 page level cache disabled False bit 5 entry has been accessed True bit 7 page size False bit 11 restart to ordinary False bit 63 execute disable False level 2: entry address 0xffff888101af7368 page entry binary data 0x80000001634008e7 page size 2MB page physical address 0x163400000 --- bit 0 entry present True bit 1 read/write access allowed True bit 2 user access allowed True bit 3 page level write through False bit 4 page level cache disabled False bit 5 entry has been accessed True bit 7 page size True bit 6 page dirty True bit 8 global translation False bit 11 restart to ordinary True bit 12 pat False bits (59, 62) protection key 0 bit 63 execute disable True [[email protected]: add SPDX line, other tweaks] Link: https://lkml.kernel.org/r/[email protected] [[email protected]: s/physicall/physical/] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Dmitrii Bundin <[email protected]> Acked by: Mike Rapoport (IBM) <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jan Kiszka <[email protected]> Cc: Kieran Bingham <[email protected]> Cc: Vlastimil Babka <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'scripts/gdb/vmlinux-gdb.py')
-rw-r--r--scripts/gdb/vmlinux-gdb.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/scripts/gdb/vmlinux-gdb.py b/scripts/gdb/vmlinux-gdb.py
index 3e8d3669f0ce..3a5b44cd6bfe 100644
--- a/scripts/gdb/vmlinux-gdb.py
+++ b/scripts/gdb/vmlinux-gdb.py
@@ -37,3 +37,4 @@ else:
import linux.clk
import linux.genpd
import linux.device
+ import linux.mm