Skip to contentSkip to conversation

[-] x86-make-mem=-option-to-work-for-efi-platform.patch removed from -mm tree

PATCH [email protected] 1 participant 1 message Sep 13, 2013

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

Subject: [-] x86-make-mem=-option-to-work-for-efi-platform.patch removed from -mm tree
To: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected]
From: [email protected]
Date: Fri, 13 Sep 2013 13:29:37 -0700

The patch titled
Subject: x86: make 'mem=' option to work for efi platform
has been removed from the -mm tree. Its filename was
x86-make-mem=-option-to-work-for-efi-platform.patch

This patch was dropped because Matt had testing failures

------------------------------------------------------
From: Wen Congyang <[email protected]>
Subject: x86: make 'mem=' option to work for efi platform

Current mem boot option only can work for non efi environment. If the user specifies add_efi_memmap, it cannot work for efi environment. In the efi environment, we call e820_add_region() to add the memory map. So we can modify __e820_add_region() and the mem boot option can work for efi environment.

Note: Only E820_RAM is limited, and BOOT_SERVICES_{CODE,DATA} are always mapped(If its address >= mem_limit, the memory won't be freed in efi_free_boot_services()).

Cc Matt Fleming <[email protected]>
Cc Rob Landley <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Bjorn Helgaas <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
Cc Yasuaki ISIMATU <[email protected]>
Cc KOSAKI Motohiro <[email protected]>
Cc Matthew Garrett <[email protected]>

---

 arch/x86/include/asm/e820.h |    2 
 arch/x86/kernel/e820.c      |   72 +++++++++++++++++++++++++++++-----
 arch/x86/platform/efi/efi.c |   15 +++++--
 3 files changed, 77 insertions(+), 12 deletions(-)
arch/x86/include/asm/e820.h renamed from arch/x86/include/asm/e820.h~x86-make-mem=-option-to-work-for-efi-platform +2 -0
diff -puN arch/x86/include/asm/e820.h~x86-make-mem=-option-to-work-for-efi-platform arch/x86/include/asm/e820.h
@@ -17,6 +17,8 @@ extern unsigned long pci_mem_start;
 extern int e820_any_mapped(u64 start, u64 end, unsigned type);
 extern int e820_all_mapped(u64 start, u64 end, unsigned type);
 extern void e820_add_region(u64 start, u64 size, int type);
+extern void e820_add_limit_region(u64 start, u64 size, int type);
+extern void e820_adjust_region(u64 *start, u64 *size);
 extern void e820_print_map(char *who);
 extern int
 sanitize_e820_map(struct e820entry *biosmap, int max_nr_map, u32 *pnr_map);
arch/x86/kernel/e820.c renamed from arch/x86/kernel/e820.c~x86-make-mem=-option-to-work-for-efi-platform +63 -9

128 lines not on this page · raw message

arch/x86/platform/efi/efi.c renamed from arch/x86/platform/efi/efi.c~x86-make-mem=-option-to-work-for-efi-platform +12 -3
diff -puN arch/x86/platform/efi/efi.c~x86-make-mem=-option-to-work-for-efi-platform arch/x86/platform/efi/efi.c
@@ -343,10 +343,17 @@ static void __init do_add_efi_memmap(voi
 		int e820_type;
 
 		switch (md->type) {
-		case EFI_LOADER_CODE:
-		case EFI_LOADER_DATA:
 		case EFI_BOOT_SERVICES_CODE:
 		case EFI_BOOT_SERVICES_DATA:
+			/* EFI_BOOT_SERVICES_{CODE,DATA} needs to be mapped */
+			if (md->attribute & EFI_MEMORY_WB)
+				e820_type = E820_RAM;
+			else
+				e820_type = E820_RESERVED;
+			e820_add_region(start, size, e820_type);
+			continue;
+		case EFI_LOADER_CODE:
+		case EFI_LOADER_DATA:
 		case EFI_CONVENTIONAL_MEMORY:
 			if (md->attribute & EFI_MEMORY_WB)
 				e820_type = E820_RAM;
@@ -371,7 +378,7 @@ static void __init do_add_efi_memmap(voi
 			e820_type = E820_RESERVED;
 			break;
 		}
-		e820_add_region(start, size, e820_type);
+		e820_add_limit_region(start, size, e820_type);
 	}
 	sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &e820.nr_map);
 }
@@ -479,6 +486,8 @@ void __init efi_free_boot_services(void)
 		    md->type != EFI_BOOT_SERVICES_DATA)
 			continue;
 
+		e820_adjust_region(&start, &size);
+
 		/* Could not reserve boot area */
 		if (!size)
 			continue;

_

Patches currently in -mm which might be from [email protected] are

origin.patch