linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: ard.biesheuvel@linaro.org (Ard Biesheuvel)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 6/6] efi/arm*: add support to dump the EFI page tables
Date: Fri, 22 Apr 2016 18:48:08 +0200	[thread overview]
Message-ID: <1461343688-8552-7-git-send-email-ard.biesheuvel@linaro.org> (raw)
In-Reply-To: <1461343688-8552-1-git-send-email-ard.biesheuvel@linaro.org>

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 <ard.biesheuvel@linaro.org>
---
 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

  parent reply	other threads:[~2016-04-22 16:48 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-22 16:48 [PATCH v2 0/6] arm64/ARM pt dumper changes Ard Biesheuvel
2016-04-22 16:48 ` [PATCH v2 1/6] arm64: ptdump: use static initializers for vmemmap region boundaries Ard Biesheuvel
2016-04-22 17:07   ` Mark Rutland
2016-04-22 16:48 ` [PATCH v2 2/6] arm64: ptdump: add region marker for kasan shadow region Ard Biesheuvel
2016-04-22 17:09   ` Mark Rutland
2016-04-22 16:48 ` [PATCH v2 3/6] arm64: ptdump: fold string literals into address_markers[] and pte_bits[] Ard Biesheuvel
2016-04-22 16:48 ` [PATCH v2 4/6] arm64: mm: dump: make page table dumping reusable Ard Biesheuvel
2016-04-25 11:07   ` Will Deacon
2016-05-13 12:56     ` Mark Rutland
2016-05-31 13:25       ` Will Deacon
2016-04-22 16:48 ` [PATCH v2 5/6] arm: " Ard Biesheuvel
2016-04-22 16:48 ` Ard Biesheuvel [this message]
2016-04-22 17:01   ` [PATCH v2 6/6] efi/arm*: add support to dump the EFI page tables Mark Rutland
2016-04-22 17:20     ` Ard Biesheuvel
2016-04-22 17:25       ` Mark Rutland
2016-04-25 11:26         ` Ard Biesheuvel
2016-04-27 20:12           ` Russell King - ARM Linux
2016-04-26 11:29 ` [PATCH v2 0/6] arm64/ARM pt dumper changes Will Deacon
2016-04-26 11:34   ` Ard Biesheuvel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1461343688-8552-7-git-send-email-ard.biesheuvel@linaro.org \
    --to=ard.biesheuvel@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).