mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: Linux EFI <linux-efi@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Cc: Borislav Petkov <bp@suse.de>,
	Matt Fleming <matt@console-pimps.org>,
	Matthew Garrett <mjg59@srcf.ucam.org>,
	"H. Peter Anvin" <hpa@zytor.com>, Dave Young <dyoung@redhat.com>,
	Toshi Kani <toshi.kani@hp.com>
Subject: [PATCH 2/4] efi: Dump the EFI page table
Date: Sat, 11 Jan 2014 21:49:28 +0100	[thread overview]
Message-ID: <1389473370-1940-3-git-send-email-bp@alien8.de> (raw)
In-Reply-To: <1389473370-1940-1-git-send-email-bp@alien8.de>

From: Borislav Petkov <bp@suse.de>

This is very useful for debugging issues with the recently added
pagetable switching code for EFI virtual mode.

Signed-off-by: Borislav Petkov <bp@suse.de>
---
 arch/x86/platform/efi/efi.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
index d62ec87a2b26..c34be4ce94c9 100644
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -54,6 +54,7 @@
 #include <asm/rtc.h>
 
 #define EFI_DEBUG
+#undef EFI_PGT_DBG
 
 #define EFI_MIN_RESERVE 5120
 
@@ -818,6 +819,15 @@ void efi_memory_uc(u64 addr, unsigned long size)
 	set_memory_uc(addr, npages);
 }
 
+static void dump_pagetable(void)
+{
+#if defined(EFI_PGT_DBG) && defined(CONFIG_X86_PTDUMP)
+	pgd_t *pgd = (pgd_t *)__va(real_mode_header->trampoline_pgd);
+
+	walk_pgd_level(NULL, pgd);
+#endif
+}
+
 void __init old_map_region(efi_memory_desc_t *md)
 {
 	u64 start_pfn, end_pfn, end;
@@ -1033,6 +1043,7 @@ void __init efi_enter_virtual_mode(void)
 
 	efi_setup_page_tables();
 	efi_sync_low_kernel_mappings();
+	dump_pagetable();
 
 	if (!efi_setup) {
 		status = phys_efi_set_virtual_address_map(
-- 
1.8.5.2.192.g7794a68


  parent reply	other threads:[~2014-01-11 20:49 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-11 20:49 [PATCH 0/4] EFI memmap fix v2 Borislav Petkov
2014-01-11 20:49 ` [PATCH 1/4] x86, ptdump: Add the functionality to dump an arbitrary pagetable Borislav Petkov
2014-01-11 20:59   ` Joe Perches
2014-01-13  5:32   ` Dave Young
2014-01-13 10:18     ` Borislav Petkov
2014-01-13 12:23       ` Dave Young
2014-01-13 14:48         ` Arjan van de Ven
2014-01-13 14:57           ` Borislav Petkov
2014-01-14  1:40           ` Dave Young
2014-01-14 18:18             ` H. Peter Anvin
2014-01-15  1:16               ` Dave Young
2014-01-15 14:11                 ` H. Peter Anvin
2014-01-16  1:44                   ` Dave Young
2014-01-16  2:41                     ` Arjan van de Ven
2014-01-16  3:03                       ` Dave Young
2014-01-16  4:04                         ` H. Peter Anvin
2014-01-16  6:46                           ` Dave Young
2014-01-16  6:54                             ` Dave Young
2014-01-16 14:52                             ` Arjan van de Ven
2014-01-13 15:49   ` Matt Fleming
2014-01-11 20:49 ` Borislav Petkov [this message]
2014-01-13 16:00   ` [PATCH 2/4] efi: Dump the EFI page table Matt Fleming
2014-01-14  1:36     ` Dave Young
2014-01-11 20:49 ` [PATCH 3/4] x86, pageattr: Export page unmapping interface Borislav Petkov
2014-01-11 20:49 ` [PATCH 4/4] efi: Make efi virtual runtime map passing more robust Borislav Petkov
2014-01-13  5:40   ` Dave Young
2014-01-13 10:27     ` Borislav Petkov
2014-01-13 13:17       ` Dave Young
2014-01-13 16:22 ` [PATCH 0/4] EFI memmap fix v2 Toshi Kani
2014-01-13 16:54   ` Toshi Kani

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=1389473370-1940-3-git-send-email-bp@alien8.de \
    --to=bp@alien8.de \
    --cc=bp@suse.de \
    --cc=dyoung@redhat.com \
    --cc=hpa@zytor.com \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matt@console-pimps.org \
    --cc=mjg59@srcf.ucam.org \
    --cc=toshi.kani@hp.com \
    /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

Powered by JetHome