Skip to contentSkip to conversation

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

PATCH New Ard Biesheuvel 2 participants 3 messages Jun 30, 2016 – Jul 1, 2016 EFI

lore
Share & tools
lore
#0 lore raw

PATCH 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.

---

This patch could be helpful in assessing the series 'arm64: avoid block entries that we need to split later' that I sent out yesterday.

 drivers/firmware/efi/arm-runtime.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
drivers/firmware/efi/arm-runtime.c +20 -0
index 17ccf0a8787a..4197a1da013d 100644
@@ -39,6 +39,26 @@ static struct mm_struct efi_mm = {
 	.mmlist			= LIST_HEAD_INIT(efi_mm.mmlist),
 };
 
+#ifdef CONFIG_ARM64
+#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 1/1 efi: arm64: add debugfs node to dump UEFI runtime page tables

Quoted 9 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.

---

This patch could be helpful in assessing the series 'arm64: avoid block entries that we need to split later' that I sent out yesterday.

It's probably worth noting that this is based on the arm64 for-next/core branch. I don't know if/how we can orgnise branches for merging this.

drivers/firmware/efi/arm-runtime.c static struct mm_struct efi_mm = { · line 42

Quoted 12 lines
 drivers/firmware/efi/arm-runtime.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
drivers/firmware/efi/arm-runtime.c +1 -0
index 17ccf0a8787a..4197a1da013d 100644
@@ -39,6 +39,26 @@ static struct mm_struct efi_mm = {
 	.mmlist			= LIST_HEAD_INIT(efi_mm.mmlist),
 };
 
+#ifdef CONFIG_ARM64

If you use CONFIG_ARM64_PTDUMP for the moment, then we won't have some unused structs lying around when the feature is unused.

Otherwise, I agree that this is a useful debuging feature. FWIW, either way:

Thanks,
Mark.

Quoted 25 lines
drivers/firmware/efi/arm-runtime.c +19 -0
+#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
#2 lore raw

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

Quoted 5 lines · Mark Rutland
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 9 lines
Quoted 5 lines

---

This patch could be helpful in assessing the series 'arm64: avoid block entries that we need to split later' that I sent out yesterday.

It's probably worth noting that this is based on the arm64 for-next/core branch. I don't know if/how we can orgnise branches for merging this.

There's no rush, so Matt can take it for v4.9 I suppose?

Quoted 11 lines
Quoted 11 lines
 drivers/firmware/efi/arm-runtime.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
drivers/firmware/efi/arm-runtime.c +0 -0
index 17ccf0a8787a..4197a1da013d 100644
@@ -39,6 +39,26 @@ static struct mm_struct efi_mm = {
      .mmlist                 = LIST_HEAD_INIT(efi_mm.mmlist),
 };
 
Quoted 5 lines

drivers/firmware/efi/arm-runtime.c static struct mm_struct efi_mm = { · line 42

Quoted 1 line
drivers/firmware/efi/arm-runtime.c +1 -0
+#ifdef CONFIG_ARM64

If you use CONFIG_ARM64_PTDUMP for the moment, then we won't have some unused structs lying around when the feature is unused.

I can change that

Quoted 5 lines

Otherwise, I agree that this is a useful debuging feature. FWIW, either way:

Thanks.