lkml.org 
[lkml]   [2014]   [Jan]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/4] efi: Dump the EFI page table
Date
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


\
 
 \ /
  Last update: 2014-01-11 22:01    [W:2.438 / U:0.416 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site