Skip to contentSkip to conversation

efi: arm64: add debugfs node to dump UEFI runtime page tables

PATCH New Ard Biesheuvel 2 participants 2 messages Aug 16, 2016 – Aug 19, 2016 EFI

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 efi: arm64: add debugfs node to dump UEFI runtime page tables

Register the debugfs node 'efi_page_tables' to allow the UEFI runtime page tables to be inspected. Note that ARM does not have 'asm/ptdump.h' [yet] so for now, this is arm64 only.

---
v2: test for CONFIG_ARM64_PTDUMP rather than CONFIG_ARM64
add Mark's ack

 drivers/firmware/efi/arm-runtime.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
drivers/firmware/efi/arm-runtime.c +20 -0
index c394b81fe452..7ff61749acef 100644
@@ -39,6 +39,26 @@ static struct mm_struct efi_mm = {
 	.mmlist			= LIST_HEAD_INIT(efi_mm.mmlist),
 };
 
+#ifdef CONFIG_ARM64_PTDUMP
+#include <asm/ptdump.h>
+
+static struct ptdump_info efi_ptdump_info = {
+	.mm		= &efi_mm,
+	.markers	= (struct addr_marker[]){
+		{ 0,		"UEFI runtime start" },
+		{ TASK_SIZE_64,	"UEFI runtime end" }
+	},
+	.base_addr	= 0,
+};
+
+static int __init ptdump_init(void)
+{
+	return ptdump_register(&efi_ptdump_info, "efi_page_tables");
+}
+device_initcall(ptdump_init);
+
+#endif
+
 static bool __init efi_virtmap_init(void)
 {
 	efi_memory_desc_t *md;
Signature · 1 line
2.7.4
#1 lore raw

PATCH v2 1/1 efi: arm64: add debugfs node to dump UEFI runtime page tables

Quoted 4 lines · Ard Biesheuvel

Register the debugfs node 'efi_page_tables' to allow the UEFI runtime page tables to be inspected. Note that ARM does not have 'asm/ptdump.h' [yet] so for now, this is arm64 only.

Quoted 8 lines

---
v2: test for CONFIG_ARM64_PTDUMP rather than CONFIG_ARM64
add Mark's ack

 drivers/firmware/efi/arm-runtime.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

Thanks Ard. Queued up in 'next'.