Skip to contentSkip to conversation

x86/mm/dump_pagetables: Add SLAB_VIRTUAL knowledge

PATCH In review Kees Cook 2 participants 2 messages Sep 16, 2023 – Sep 18, 2023

Subsystems (2)
lore
Share & tools
lore

Kees Cook

author
#0 lore raw

PATCH 1/1 x86/mm/dump_pagetables: Add SLAB_VIRTUAL knowledge

Add the markings for the SLAB_VIRTUAL area.

Cc Matteo Rizzo <[email protected]>
Cc Jann Horn <[email protected]>
Cc Dave Hansen <[email protected]>
Cc Andy Lutomirski <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc "H. Peter Anvin" <[email protected]>

---
This is on top of the SLAB_VIRTUAL series:
https://lore.kernel.org/all/[email protected]/

Feel free to collapse this into the x86 patch from the above series.

FYI, as expected, the kernel page table entries get way longer with SLAB_VIRTUAL. :)

Without SLAB_VIRTUAL:

# wc -l /sys/kernel/debug/page_tables/kernel
1501 /sys/kernel/debug/page_tables/kernel

With SLAB_VIRTUAL:

# wc -l /sys/kernel/debug/page_tables/kernel
7549 /sys/kernel/debug/page_tables/kernel
---
 arch/x86/mm/dump_pagetables.c | 6 ++++++
 1 file changed, 6 insertions(+)
arch/x86/mm/dump_pagetables.c +6 -0
index e1b599ecbbc2..b1fa68669e61 100644
@@ -64,6 +64,9 @@ enum address_markers_idx {
 	KASAN_SHADOW_END_NR,
 #endif
 	CPU_ENTRY_AREA_NR,
+#ifdef CONFIG_SLAB_VIRTUAL
+	SLAB_AREA_NR,
+#endif
 #ifdef CONFIG_X86_ESPFIX64
 	ESPFIX_START_NR,
 #endif
@@ -95,6 +98,9 @@ static struct addr_marker address_markers[] = {
 	[LDT_NR]		= { 0UL,		"LDT remap" },
 #endif
 	[CPU_ENTRY_AREA_NR]	= { CPU_ENTRY_AREA_BASE,"CPU entry Area" },
+#ifdef CONFIG_SLAB_VIRTUAL
+	[SLAB_AREA_NR]		= { SLAB_BASE_ADDR,	"Slab Area" },
+#endif
 #ifdef CONFIG_X86_ESPFIX64
 	[ESPFIX_START_NR]	= { ESPFIX_BASE_ADDR,	"ESPfix Area", 16 },
 #endif
Signature · 1 line
2.34.1
#1 lore raw
Quoted 4 lines · Kees Cook

Add the markings for the SLAB_VIRTUAL area.

Feel free to collapse this into the x86 patch from the above series.

Thanks! I will add it to the next revision of the series.

--
Matteo