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 5/6] x86/boot: Use copied boot data in __startup_64()
Date: Wed, 12 Apr 2023 14:45:01 -0400 [thread overview]
Message-ID: <20230412184502.145289-6-brgerst@gmail.com> (raw)
In-Reply-To: <20230412184502.145289-1-brgerst@gmail.com>
Use the copied version instead of the original real mode data.
Signed-off-by: Brian Gerst <brgerst@gmail.com>
---
arch/x86/include/asm/setup.h | 2 +-
arch/x86/kernel/head64.c | 4 ++--
arch/x86/kernel/head_64.S | 2 --
3 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/arch/x86/include/asm/setup.h b/arch/x86/include/asm/setup.h
index 47eac5d877a8..f6c04b137d67 100644
--- a/arch/x86/include/asm/setup.h
+++ b/arch/x86/include/asm/setup.h
@@ -49,7 +49,7 @@ extern unsigned long saved_video_mode;
extern void reserve_standard_io_resources(void);
extern void i386_reserve_resources(void);
-extern unsigned long __startup_64(unsigned long physaddr, struct boot_params *bp);
+extern unsigned long __startup_64(unsigned long physaddr);
extern void startup_64_setup_env(unsigned long physbase);
extern void early_setup_idt(void);
extern void __init do_early_exception(struct pt_regs *regs, int trapnr);
diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c
index 9be8ce41d021..c7d3976a04d6 100644
--- a/arch/x86/kernel/head64.c
+++ b/arch/x86/kernel/head64.c
@@ -176,9 +176,9 @@ static unsigned long __head sme_postprocess_startup(struct boot_params *bp, pmdv
* boot-time crashes. To work around this problem, every global pointer must
* be adjusted using fixup_pointer().
*/
-unsigned long __head __startup_64(unsigned long physaddr,
- struct boot_params *bp)
+unsigned long __head __startup_64(unsigned long physaddr)
{
+ struct boot_params *bp = fixup_pointer(&boot_params, physaddr);
unsigned long load_delta, *p;
unsigned long pgtable_flags;
pgdval_t *pgd;
diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S
index 83fb0dc97ba5..c7b2ef379f42 100644
--- a/arch/x86/kernel/head_64.S
+++ b/arch/x86/kernel/head_64.S
@@ -113,9 +113,7 @@ SYM_CODE_START_NOALIGN(startup_64)
* programmed into CR3.
*/
leaq _text(%rip), %rdi
- pushq %rsi
call __startup_64
- popq %rsi
/* Form the CR3 value being sure to include the CR3 modifier */
addq $(early_top_pgt - __START_KERNEL_map), %rax
--
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 ` [PATCH v2 2/6] x86/boot: Remove extra call to copy_bootdata() Brian Gerst
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 ` Brian Gerst [this message]
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-6-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox