mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Adrian Huang <adrianhuang0701@gmail.com>
To: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>
Cc: x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	Jonathan Corbet <corbet@lwn.net>,
	linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org,
	Adrian Huang <adrianhuang0701@gmail.com>,
	Adrian Huang <ahuang12@lenovo.com>,
	Kees Cook <keescook@chromium.org>
Subject: [PATCH 1/1] Documentation/x86/boot: Correct algorithm for runtime start address
Date: Sun,  7 Mar 2021 22:22:51 +0800	[thread overview]
Message-ID: <20210307142251.797-1-adrianhuang0701@gmail.com> (raw)

From: Adrian Huang <ahuang12@lenovo.com>

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 <ahuang12@lenovo.com>
Cc: Kees Cook <keescook@chromium.org>
---
 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


                 reply	other threads:[~2021-03-07 14:25 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210307142251.797-1-adrianhuang0701@gmail.com \
    --to=adrianhuang0701@gmail.com \
    --cc=ahuang12@lenovo.com \
    --cc=bp@alien8.de \
    --cc=corbet@lwn.net \
    --cc=hpa@zytor.com \
    --cc=keescook@chromium.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®