History

mm: ptdump: reduce level numbers by 1 in note_page()

Rather than having to increment the 'depth' number by 1 in ptdump_hole(), let's change the meaning of 'level' in note_page() since that makes the code simplier. Note that for x86, the level numbers were previously increased by 1 in commit 45dcd2091363 ("x86/mm/dump_pagetables: Fix printout of p4d level") and the comment "Bit 7 has a different meaning" was not updated, so this change also makes the code match the comment again.

Steven Price committed 6 years ago

Commit f8f0d0b1 parent 9c7869c4 files · +22 −20Browse files

Showing the changes to include/linux (1 of 4 files). Show all

Unified · Split

include/linux/ptdump.h+1−0
@@ -11,6 +11,7 @@ struct ptdump_range { · 10 unmodified lines
11};11};
12 12
13struct ptdump_state {13struct ptdump_state {
14 /* level is 0:PGD to 4:PTE, or -1 if unknown */
14 void (*note_page)(struct ptdump_state *st, unsigned long addr,15 void (*note_page)(struct ptdump_state *st, unsigned long addr,
15 int level, unsigned long val);16 int level, unsigned long val);
16 const struct ptdump_range *range;17 const struct ptdump_range *range;