mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] x86: Populate virtual address field of all EFI memmap entries
@ 2011-04-28 18:02 Matthew Garrett
  0 siblings, 0 replies; only message in thread
From: Matthew Garrett @ 2011-04-28 18:02 UTC (permalink / raw)
  To: x86; +Cc: linux-kernel, Matthew Garrett

Our current implementation of SetVirtualAddressMap passes back the entire
memory map it received from the firmware, but only modifies entries that
have the runtime attribute set. Experiments (mostly involving screaming)
with real-world EFI implementations suggests that some will call
ConvertPointer on data that exist outside runtime regions anyway. The
easiest fix here seems to be to continue remapping runtime regions and
just to copy the physical address to the virtal address for other regions.

This doesn't fix any observed problems with our current implementation,
but it seems better to be safe than sorry.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
---
 arch/x86/platform/efi/efi.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
index 0fe27d7..f11b3b0 100644
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -507,8 +507,10 @@ void __init efi_enter_virtual_mode(void)
 	efi.systab = NULL;
 	for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) {
 		md = p;
-		if (!(md->attribute & EFI_MEMORY_RUNTIME))
+		if (!(md->attribute & EFI_MEMORY_RUNTIME)) {
+			md->virt_addr = md->phys_addr;
 			continue;
+		}
 
 		size = md->num_pages << EFI_PAGE_SHIFT;
 		end = md->phys_addr + size;
-- 
1.7.4.4


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-04-28 18:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-28 18:02 [PATCH] x86: Populate virtual address field of all EFI memmap entries Matthew Garrett

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®