All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86, efi: Regression in Pass a minimal map to SetVirtualAddressMap()
@ 2011-09-09 14:18 Russ Anderson
  0 siblings, 0 replies; only message in thread
From: Russ Anderson @ 2011-09-09 14:18 UTC (permalink / raw)
  To: linux-kernel, x86; +Cc: Matthew Garrett, H. Peter Anvin, Russ Anderson, stable

Commit 7cb00b72876ea2451eb79d468da0e8fb9134aa8a allocated a new memmap
table to be passed down to bios.  The problem is that there needs to be a 
physical mapping of the table for bios to access it.  The bottom 512Gig
of memory has a physical mapping, so if the table is in that range 
bios can access it.  If the table is above that range bios cannot.  
UV systems with more than 512Gig of memory have hit this problem.

This patch undoes the previous commit, reverting back to using the
old memmap table.

Reported-by: Russ Anderson <rja@sgi.com>
Tested-by: Russ Anderson <rja@sgi.com>
Signed-off-by: Russ Anderson <rja@sgi.com>
Cc: stable@kernel.org


---
 arch/x86/platform/efi/efi.c |   14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

Index: linux/arch/x86/platform/efi/efi.c
===================================================================
--- linux.orig/arch/x86/platform/efi/efi.c	2011-09-08 15:07:33.099462927 -0500
+++ linux/arch/x86/platform/efi/efi.c	2011-09-08 15:13:18.843970180 -0500
@@ -625,8 +625,7 @@ void __init efi_enter_virtual_mode(void)
 	efi_status_t status;
 	unsigned long size;
 	u64 end, systab, addr, npages, end_pfn;
-	void *p, *va, *new_memmap = NULL;
-	int count = 0;
+	void *p, *va;
 
 	efi.systab = NULL;
 
@@ -695,21 +694,15 @@ void __init efi_enter_virtual_mode(void)
 			systab += md->virt_addr - md->phys_addr;
 			efi.systab = (efi_system_table_t *) (unsigned long) systab;
 		}
-		new_memmap = krealloc(new_memmap,
-				      (count + 1) * memmap.desc_size,
-				      GFP_KERNEL);
-		memcpy(new_memmap + (count * memmap.desc_size), md,
-		       memmap.desc_size);
-		count++;
 	}
 
 	BUG_ON(!efi.systab);
 
 	status = phys_efi_set_virtual_address_map(
-		memmap.desc_size * count,
+		memmap.desc_size * memmap.nr_map,
 		memmap.desc_size,
 		memmap.desc_version,
-		(efi_memory_desc_t *)__pa(new_memmap));
+		memmap.phys_map);
 
 	if (status != EFI_SUCCESS) {
 		printk(KERN_ALERT "Unable to switch EFI into virtual mode "
@@ -747,7 +740,6 @@ void __init efi_enter_virtual_mode(void)
 		runtime_code_page_mkexec();
 	early_iounmap(memmap.map, memmap.nr_map * memmap.desc_size);
 	memmap.map = NULL;
-	kfree(new_memmap);
 }
 
 /*
-- 
Russ Anderson, OS RAS/Partitioning Project Lead  
SGI - Silicon Graphics Inc          rja@sgi.com

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

only message in thread, other threads:[~2011-09-09 14:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-09 14:18 [PATCH] x86, efi: Regression in Pass a minimal map to SetVirtualAddressMap() Russ Anderson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.