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.
Showing the changes to include/linux (1 of 4 files). Show all
Unified · Split
| @@ -11,6 +11,7 @@ struct ptdump_range { · 10 unmodified lines | |||
| 11 | }; | 11 | }; |
| 12 | 12 | ||
| 13 | struct ptdump_state { | 13 | struct 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; |