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>, "H . Peter Anvin" <hpa@zytor.com>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@kernel.org>, Brian Gerst <brgerst@gmail.com>
Subject: [PATCH v2 2/6] x86/boot: Remove extra call to copy_bootdata()
Date: Wed, 12 Apr 2023 14:44:58 -0400 [thread overview]
Message-ID: <20230412184502.145289-3-brgerst@gmail.com> (raw)
In-Reply-To: <20230412184502.145289-1-brgerst@gmail.com>
The call to copy_bootdata() in x86_64_start_reservations() is only
applicable to Xen, since native has already call it. Xen on the other
hand, has already filled in boot_params and just passes its address in,
so the copy ends up being a no-op and can be removed.
Signed-off-by: Brian Gerst <brgerst@gmail.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 f37cbff7354c..fd409b7dda74 100644
--- a/arch/x86/include/asm/setup.h
+++ b/arch/x86/include/asm/setup.h
@@ -129,7 +129,7 @@ asmlinkage void __init i386_start_kernel(void);
#else
asmlinkage void __init x86_64_start_kernel(char *real_mode);
-asmlinkage void __init x86_64_start_reservations(char *real_mode_data);
+asmlinkage void __init x86_64_start_reservations(void);
#endif /* __i386__ */
#endif /* _SETUP */
diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c
index 4a3b195c9002..6e0f53a66678 100644
--- a/arch/x86/kernel/head64.c
+++ b/arch/x86/kernel/head64.c
@@ -533,15 +533,11 @@ asmlinkage __visible void __init x86_64_start_kernel(char * real_mode_data)
/* 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 x86_64_start_reservations(char *real_mode_data)
+void __init 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));
-
sanitize_boot_params(&boot_params);
x86_early_init_platform_quirks();
diff --git a/arch/x86/xen/enlighten_pv.c b/arch/x86/xen/enlighten_pv.c
index 5a034a994682..a4db5c28af57 100644
--- a/arch/x86/xen/enlighten_pv.c
+++ b/arch/x86/xen/enlighten_pv.c
@@ -1430,7 +1430,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.39.2
next prev parent reply other threads:[~2023-04-12 18:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-12 18:44 [PATCH v2 0/6] x86/boot: Clean up handling of boot_params pointer Brian Gerst
2023-04-12 18:44 ` [PATCH v2 1/6] x86/boot: Move sanitize_boot_params() Brian Gerst
2023-04-12 18:44 ` Brian Gerst [this message]
2023-04-12 18:44 ` [PATCH v2 3/6] x86/boot: Clean up get_cmd_line_ptr() Brian Gerst
2023-04-12 18:45 ` [PATCH v2 4/6] x86/boot: Move copy_bootdata() to very early boot Brian Gerst
2023-04-12 18:45 ` [PATCH v2 5/6] x86/boot: Use copied boot data in __startup_64() Brian Gerst
2023-04-12 18:45 ` [PATCH v2 6/6] x86/boot: Use copied boot data in sme_enable() 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=20230412184502.145289-3-brgerst@gmail.com \
--to=brgerst@gmail.com \
--cc=bp@alien8.de \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--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 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.