DORMANTno replies

[PATCH 1/1] Documentation/x86/boot: Correct algorithm for runtime start address

From: Adrian Huang <hidden>
Date: 2021-03-07 14:25:22
Also in: lkml
Subsystem: documentation, the rest · Maintainers: Jonathan Corbet, Linus Torvalds

From: Adrian Huang <redacted>

Commit 8ab3820fd5b2 ("x86, kaslr: Return location from decompress_kernel")
enforces CONFIG_PHYSICAL_START as the minimum relocation address when
the kernel option CONFIG_RELOCATABLE is enabled. This change should be
included accordingly.

Signed-off-by: Adrian Huang <redacted>
Cc: Kees Cook <redacted>
---
 Documentation/x86/boot.rst | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/Documentation/x86/boot.rst b/Documentation/x86/boot.rst
index fc844913dece..808ea181ca40 100644
--- a/Documentation/x86/boot.rst
+++ b/Documentation/x86/boot.rst
@@ -894,10 +894,16 @@ Offset/size:	0x260/4
 
   The kernel runtime start address is determined by the following algorithm::
 
-	if (relocatable_kernel)
-	runtime_start = align_up(load_address, kernel_alignment)
-	else
-	runtime_start = pref_address
+	if (relocatable_kernel) {
+		runtime_start = align_up(load_address, kernel_alignment);
+
+		/* pref_address is the minimum relocation address */
+		if (runtime_start < pref_address)
+			runtime_start = pref_address;
+	} else {
+		/* Adhere to the statement describing in field 'pref_address' */
+		runtime_start = pref_address;
+	}
 
 ============	===============
 Field name:	handover_offset
-- 
2.17.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help