Thread (19 messages) 19 messages, 4 authors, 2016-05-31
STALE3707d
Revisions (4)
  1. v2 current
  2. v2 [diff vs current]
  3. v2 [diff vs current]
  4. v2 [diff vs current]

[PATCH v2 6/6] efi/arm*: add support to dump the EFI page tables

From: Ard Biesheuvel <hidden>
Date: 2016-04-22 16:48:08
Also in: linux-efi
Subsystem: extensible firmware interface (efi), the rest · Maintainers: Ard Biesheuvel, Linus Torvalds

From: Mark Rutland <mark.rutland@arm.com>

Occasionally it's useful to inspect the page tables used for EFI runtime
services, similarly to those cases where it's useful to be able to
inspect the kernel page tables.

Now that the kernel page table dump code has been made generic, use it
to export the EFI runtime services page tables under debugfs (as
"efi_page_tables").

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
[ ardb: mildly refactored for compatibility with ARM ]
Signed-off-by: Ard Biesheuvel <redacted>
---
 drivers/firmware/efi/arm-runtime.c | 21 ++++++++++++++++++++
 1 file changed, 21 insertions(+)
diff --git a/drivers/firmware/efi/arm-runtime.c b/drivers/firmware/efi/arm-runtime.c
index 6ae21e41a429..c48fc2f5413b 100644
--- a/drivers/firmware/efi/arm-runtime.c
+++ b/drivers/firmware/efi/arm-runtime.c
@@ -27,6 +27,7 @@
 #include <asm/mmu.h>
 #include <asm/pgalloc.h>
 #include <asm/pgtable.h>
+#include <asm/ptdump.h>
 
 extern u64 efi_system_table;
 
@@ -133,3 +134,23 @@ void efi_virtmap_unload(void)
 	efi_set_pgd(current->active_mm);
 	preempt_enable();
 }
+
+static const struct addr_marker efi_addr_markers[] = {
+	{ 0,	"EFI runtime services" },
+	{ -1 },
+};
+
+static struct ptdump_info efi_ptdump_info = {
+	.mm		= &efi_mm,
+	.markers	= efi_addr_markers,
+	.base_addr	= 0,
+	.max_addr	= SZ_1G,
+};
+
+static int efi_ptdump_init(void)
+{
+	if (!efi_enabled(EFI_RUNTIME_SERVICES))
+		return 0;
+	return ptdump_register(&efi_ptdump_info, "efi_page_tables");
+}
+device_initcall(efi_ptdump_init);
-- 
2.7.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help