Skip to contentSkip to conversation

x86/boot changes for v4.13

GIT PULL Ingo Molnar 1 participant 1 message Jul 3, 2017

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

Linus,

Please pull the latest x86-boot-for-linus git tree from:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86-boot-for-linus

# HEAD: fe2d48b805d01e14ddb8144de01de43171eb516f x86/debug: Extend the lower bound of crash kernel low reservations

The main changes in this cycle were KASLR improvements for rare environments with special boot options, by Baoquan He. Also misc smaller changes/cleanups.

Thanks,

Ingo

------------------>
Arnd Bergmann (1):
x86/KASLR: Use the right memcpy() implementation

Baoquan He (3):
x86/KASLR: Parse all 'memmap=' boot option entries
x86/KASLR: Handle the memory limit specified by the 'memmap=' and 'mem=' boot options Documentation/kernel-parameters.txt: Update 'memmap=' boot option description

Jiri Bohac (1):
x86/debug: Extend the lower bound of crash kernel low reservations

Jiri Slaby (1):
x86/boot: Remove unused copy_*_gs() functions

 Documentation/admin-guide/kernel-parameters.txt |   9 ++
 arch/x86/boot/compressed/cmdline.c              |   2 +-
 arch/x86/boot/compressed/kaslr.c                | 191 ++++++++++++++++--------
 arch/x86/boot/copy.S                            |  20 ---
 arch/x86/boot/string.c                          |   8 +
 arch/x86/kernel/setup.c                         |   2 +-
 6 files changed, 145 insertions(+), 87 deletions(-)
Documentation/admin-guide/kernel-parameters.txt +9 -0
index 15f79c27748d..4e4c3402412e 100644
@@ -2127,6 +2127,12 @@
 	memmap=nn[KMG]@ss[KMG]
 			[KNL] Force usage of a specific region of memory.
 			Region of memory to be used is from ss to ss+nn.
+			If @ss[KMG] is omitted, it is equivalent to mem=nn[KMG],
+			which limits max address to nn[KMG].
+			Multiple different regions can be specified,
+			comma delimited.
+			Example:
+				memmap=100M@2G,100M#3G,1G!1024G
 
 	memmap=nn[KMG]#ss[KMG]
 			[KNL,ACPI] Mark specific memory as ACPI data.
@@ -2139,6 +2145,9 @@
 			         memmap=64K$0x18690000
 			         or
 			         memmap=0x10000$0x18690000
+			Some bootloaders may need an escape character before '$',
+			like Grub2, otherwise '$' and the following number
+			will be eaten.
 
 	memmap=nn[KMG]!ss[KMG]
 			[KNL,X86] Mark specific memory as protected.
arch/x86/boot/compressed/cmdline.c +1 -1
index 73ccf63b0f48..9dc1ce6ba3c0 100644
@@ -13,7 +13,7 @@ static inline char rdfs8(addr_t addr)
 	return *((char *)(fs + addr));
 }
 #include "../cmdline.c"
-static unsigned long get_cmd_line_ptr(void)
+unsigned long get_cmd_line_ptr(void)
 {
 	unsigned long cmd_line_ptr = boot_params->hdr.cmd_line_ptr;
 
arch/x86/boot/compressed/kaslr.c +126 -65

281 lines not on this page · raw message

arch/x86/boot/copy.S +0 -20
index 1eb7d298b47d..15d9f74b0008 100644
@@ -65,23 +65,3 @@ GLOBAL(copy_to_fs)
 	popw	%es
 	retl
 ENDPROC(copy_to_fs)
-
-#if 0 /* Not currently used, but can be enabled as needed */
-GLOBAL(copy_from_gs)
-	pushw	%ds
-	pushw	%gs
-	popw	%ds
-	calll	memcpy
-	popw	%ds
-	retl
-ENDPROC(copy_from_gs)
-
-GLOBAL(copy_to_gs)
-	pushw	%es
-	pushw	%gs
-	popw	%es
-	calll	memcpy
-	popw	%es
-	retl
-ENDPROC(copy_to_gs)
-#endif
arch/x86/boot/string.c +8 -0
index 5457b02fc050..630e3664906b 100644
@@ -122,6 +122,14 @@ unsigned long long simple_strtoull(const char *cp, char **endp, unsigned int bas
 	return result;
 }
 
+long simple_strtol(const char *cp, char **endp, unsigned int base)
+{
+	if (*cp == '-')
+		return -simple_strtoull(cp + 1, endp, base);
+
+	return simple_strtoull(cp, endp, base);
+}
+
 /**
  * strlen - Find the length of a string
  * @s: The string to be sized
arch/x86/kernel/setup.c +1 -1
index 0b4d3c686b1e..848d0489ad00 100644
@@ -503,7 +503,7 @@ static int __init reserve_crashkernel_low(void)
 			return 0;
 	}
 
-	low_base = memblock_find_in_range(low_size, 1ULL << 32, low_size, CRASH_ALIGN);
+	low_base = memblock_find_in_range(0, 1ULL << 32, low_size, CRASH_ALIGN);
 	if (!low_base) {
 		pr_err("Cannot reserve %ldMB crashkernel low memory, please try smaller size.\n",
 		       (unsigned long)(low_size >> 20));