Skip to contentSkip to conversation

arm64/mm/ptdump: Add address markers for BPF regions

PATCH Applied Anshuman Khandual 3 participants 3 messages Sep 4, 2020 – Sep 7, 2020 arm64

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64/mm/ptdump: Add address markers for BPF regions

Kernel virtual region [BPF_JIT_REGION_START..BPF_JIT_REGION_END] is missing from address_markers[], hence relevant page table entries are not displayed with /sys/kernel/debug/kernel_page_tables. This adds those missing markers. While here, also rename arch/arm64/mm/dump.c which sounds bit ambiguous, as arch/arm64/mm/ptdump.c instead.

Cc Catalin Marinas <[email protected]>
Cc Will Deacon <[email protected]>
Cc Ard Biesheuvel <[email protected]>
Cc Steven Price <[email protected]>
Cc Andrew Morton <[email protected]>
---
 arch/arm64/mm/Makefile             | 2 +-
 arch/arm64/mm/{dump.c => ptdump.c} | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)
 rename arch/arm64/mm/{dump.c => ptdump.c} (99%)
arch/arm64/mm/Makefile +1 -1
index d91030f0ffee..2a1d275cd4d7 100644
@@ -4,7 +4,7 @@ obj-y				:= dma-mapping.o extable.o fault.o init.o \
 				   ioremap.o mmap.o pgd.o mmu.o \
 				   context.o proc.o pageattr.o
 obj-$(CONFIG_HUGETLB_PAGE)	+= hugetlbpage.o
-obj-$(CONFIG_PTDUMP_CORE)	+= dump.o
+obj-$(CONFIG_PTDUMP_CORE)	+= ptdump.o
 obj-$(CONFIG_PTDUMP_DEBUGFS)	+= ptdump_debugfs.o
 obj-$(CONFIG_NUMA)		+= numa.o
 obj-$(CONFIG_DEBUG_VIRTUAL)	+= physaddr.o
arch/arm64/mm/ptdump.c renamed from arch/arm64/mm/dump.c +2 -0
similarity index 99%
rename from arch/arm64/mm/dump.c
rename to arch/arm64/mm/ptdump.c
index 0b8da1cc1c07..265284dc942d 100644
@@ -41,6 +41,8 @@ static struct addr_marker address_markers[] = {
 	{ 0 /* KASAN_SHADOW_START */,	"Kasan shadow start" },
 	{ KASAN_SHADOW_END,		"Kasan shadow end" },
 #endif
+	{ BPF_JIT_REGION_START,		"BPF start" },
+	{ BPF_JIT_REGION_END,		"BPF end" },
 	{ MODULES_VADDR,		"Modules start" },
 	{ MODULES_END,			"Modules end" },
 	{ VMALLOC_START,		"vmalloc() area" },
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Anshuman Khandual

Kernel virtual region [BPF_JIT_REGION_START..BPF_JIT_REGION_END] is missing from address_markers[], hence relevant page table entries are not displayed with /sys/kernel/debug/kernel_page_tables. This adds those missing markers. While here, also rename arch/arm64/mm/dump.c which sounds bit ambiguous, as arch/arm64/mm/ptdump.c instead.

Quoted 8 lines
Cc Catalin Marinas <[email protected]>
Cc Will Deacon <[email protected]>
Cc Ard Biesheuvel <[email protected]>
Cc Steven Price <[email protected]>
Cc Andrew Morton <[email protected]>

LGTM

Quoted 36 lines
---
  arch/arm64/mm/Makefile             | 2 +-
  arch/arm64/mm/{dump.c => ptdump.c} | 2 ++
  2 files changed, 3 insertions(+), 1 deletion(-)

rename arch/arm64/mm/{dump.c => ptdump.c} (99%)

arch/arm64/mm/Makefile +1 -1
index d91030f0ffee..2a1d275cd4d7 100644
@@ -4,7 +4,7 @@ obj-y				:= dma-mapping.o extable.o fault.o init.o \
  				   ioremap.o mmap.o pgd.o mmu.o \
  				   context.o proc.o pageattr.o
  obj-$(CONFIG_HUGETLB_PAGE)	+= hugetlbpage.o
-obj-$(CONFIG_PTDUMP_CORE)	+= dump.o
+obj-$(CONFIG_PTDUMP_CORE)	+= ptdump.o
  obj-$(CONFIG_PTDUMP_DEBUGFS)	+= ptdump_debugfs.o
  obj-$(CONFIG_NUMA)		+= numa.o
  obj-$(CONFIG_DEBUG_VIRTUAL)	+= physaddr.o
arch/arm64/mm/ptdump.c renamed from arch/arm64/mm/dump.c +2 -0
similarity index 99%
rename from arch/arm64/mm/dump.c
rename to arch/arm64/mm/ptdump.c
index 0b8da1cc1c07..265284dc942d 100644
@@ -41,6 +41,8 @@ static struct addr_marker address_markers[] = {
  	{ 0 /* KASAN_SHADOW_START */,	"Kasan shadow start" },
  	{ KASAN_SHADOW_END,		"Kasan shadow end" },
  #endif
+	{ BPF_JIT_REGION_START,		"BPF start" },
+	{ BPF_JIT_REGION_END,		"BPF end" },
  	{ MODULES_VADDR,		"Modules start" },
  	{ MODULES_END,			"Modules end" },
  	{ VMALLOC_START,		"vmalloc() area" },
maintainer Applied
#2 lore raw
In reply to Anshuman Khandual
Quoted 5 lines · Anshuman Khandual

Kernel virtual region [BPF_JIT_REGION_START..BPF_JIT_REGION_END] is missing from address_markers[], hence relevant page table entries are not displayed with /sys/kernel/debug/kernel_page_tables. This adds those missing markers. While here, also rename arch/arm64/mm/dump.c which sounds bit ambiguous, as arch/arm64/mm/ptdump.c instead.

Applied to arm64 (for-next/mm), thanks!

[1/1] arm64/mm/ptdump: Add address markers for BPF regions

      https://git.kernel.org/arm64/c/c048ddf86cdd

Cheers,

Signature · 5 lines
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev