Skip to contentSkip to conversation

x86, efi: Regression in Pass a minimal map to SetVirtualAddressMap()

PATCH New Russ Anderson 1 participant 1 message Sep 9, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86, efi: Regression in Pass a minimal map to SetVirtualAddressMap()

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.

---
 arch/x86/platform/efi/efi.c |   14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)
arch/x86/platform/efi/efi.c +3 -11
Index: linux/arch/x86/platform/efi/efi.c
===================================================================
@@ -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);
 }
 
 /*
Signature · 2 lines
Russ Anderson, OS RAS/Partitioning Project Lead  
SGI - Silicon Graphics Inc          [email protected]