All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Gerst <brgerst@gmail.com>
To: linux-kernel@vger.kernel.org, x86@kernel.org
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Borislav Petkov <bp@alien8.de>, Ard Biesheuvel <ardb@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	Tom Lendacky <thomas.lendacky@amd.com>,
	Brian Gerst <brgerst@gmail.com>
Subject: [PATCH 4/5] x86/boot/64: Remove copy_bootdata() call
Date: Thu, 23 Jul 2026 23:02:55 -0400	[thread overview]
Message-ID: <20260724030256.232690-5-brgerst@gmail.com> (raw)
In-Reply-To: <20260724030256.232690-1-brgerst@gmail.com>

On a normal boot, copy_bootdata() is first called in
x86_64_start_kernel().  The second call in x86_64_start_reservations()
is effectively a no-op.

Xen PV directly initializes boot_params, so it does not need to call
copy_bootdata() at all.

Remove the unnecessary call to copy_bootdata() from
x86_64_start_reservations().

Signed-off-by: Brian Gerst <brgerst@gmail.com>
Cc: Juergen Gross <jgross@suse.com>
---
 arch/x86/include/asm/setup.h | 2 +-
 arch/x86/kernel/head64.c     | 8 ++------
 arch/x86/xen/enlighten_pv.c  | 2 +-
 3 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/arch/x86/include/asm/setup.h b/arch/x86/include/asm/setup.h
index d23f4272d930..18a4d3826af7 100644
--- a/arch/x86/include/asm/setup.h
+++ b/arch/x86/include/asm/setup.h
@@ -130,7 +130,7 @@ void __init mk_early_pgtbl_32(void);
 
 #else
 asmlinkage void __init __noreturn x86_64_start_kernel(char *real_mode);
-asmlinkage void __init __noreturn x86_64_start_reservations(char *real_mode_data);
+asmlinkage void __init __noreturn x86_64_start_reservations(void);
 
 #endif /* __i386__ */
 #endif /* _SETUP */
diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c
index 9f19635c6390..d895376e9346 100644
--- a/arch/x86/kernel/head64.c
+++ b/arch/x86/kernel/head64.c
@@ -276,15 +276,11 @@ asmlinkage __visible void __init __noreturn x86_64_start_kernel(char * real_mode
 	/* set init_top_pgt kernel high mapping*/
 	init_top_pgt[511] = early_top_pgt[511];
 
-	x86_64_start_reservations(real_mode_data);
+	x86_64_start_reservations();
 }
 
-void __init __noreturn x86_64_start_reservations(char *real_mode_data)
+void __init __noreturn x86_64_start_reservations(void)
 {
-	/* version is always not zero if it is copied */
-	if (!boot_params.hdr.version)
-		copy_bootdata(__va(real_mode_data));
-
 	x86_early_init_platform_quirks();
 
 	switch (boot_params.hdr.hardware_subarch) {
diff --git a/arch/x86/xen/enlighten_pv.c b/arch/x86/xen/enlighten_pv.c
index 6aa13d19c0a4..e6e2666da5a1 100644
--- a/arch/x86/xen/enlighten_pv.c
+++ b/arch/x86/xen/enlighten_pv.c
@@ -1556,7 +1556,7 @@ asmlinkage __visible void __init xen_start_kernel(struct start_info *si)
 
 	/* Start the world */
 	cr4_init_shadow(); /* 32b kernel does this in i386_start_kernel() */
-	x86_64_start_reservations((char *)__pa_symbol(&boot_params));
+	x86_64_start_reservations();
 }
 
 static int xen_cpu_up_prepare_pv(unsigned int cpu)
-- 
2.55.0


  parent reply	other threads:[~2026-07-24  3:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-24  3:02 [PATCH 0/5] x86/boot: Early boot cleanups Brian Gerst
2026-07-24  3:02 ` [PATCH 1/5] x86/sme: Clear decrypted BSS separately Brian Gerst
2026-07-24  3:02 ` [PATCH 2/5] x86/boot/64: Clear BSS as early as possible Brian Gerst
2026-07-24 11:04   ` Nikolay Borisov
2026-07-24  3:02 ` [PATCH 3/5] x86/boot: Remove hardcoded boot_param constants Brian Gerst
2026-07-24  3:02 ` Brian Gerst [this message]
2026-07-24  3:02 ` [PATCH 5/5] x86/boot/64: Copy boot parameters and command line earlier Brian Gerst

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=20260724030256.232690-5-brgerst@gmail.com \
    --to=brgerst@gmail.com \
    --cc=ardb@kernel.org \
    --cc=bp@alien8.de \
    --cc=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=thomas.lendacky@amd.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.