public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/2] x86/boot: fix relying on link order
@ 2023-01-09 17:04 Alexander Lobakin
  2023-01-09 17:04 ` [PATCH v3 1/2] x86/boot: robustify calling startup_{32,64}() from the decompressor code Alexander Lobakin
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Alexander Lobakin @ 2023-01-09 17:04 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen
  Cc: Alexander Lobakin, Jiri Slaby, H. Peter Anvin,
	Peter Zijlstra (Intel), Tony Luck, Kees Cook, Masahiro Yamada,
	x86, linux-kernel

Currently, the x86 decompressor code expects the kernel entry point to be
exactly at the beginning of the kernel image. It's always been true, but
is hacky in multiple ways: special .head.text section and linking certain
object files first to have them at the beginning.
Make the code independent from the link order and then kill the latter.
The former is to be resolved a bit later.

I didn't put any "Fixes:" tag since it's not linear. The lines changed
with 0001 came from the initial x86 KASLR series, but that unconditional
jump to the kernel beginning already was there. It goes at least from the
set that brought relocatable kernel support to x86, but this is quite
prehistoric already and might not look really relatable.

Alexander Lobakin (2):
  x86/boot: robustify calling startup_{32,64}() from the decompressor
    code
  scripts/head-object-list: remove x86 from the list

 arch/x86/boot/compressed/head_32.S |  2 +-
 arch/x86/boot/compressed/head_64.S |  2 +-
 arch/x86/boot/compressed/misc.c    | 18 +++++++++++-------
 scripts/head-object-list.txt       |  6 ------
 4 files changed, 13 insertions(+), 15 deletions(-)

---
From v2[0]:
 * rebase on top of 6.2;
 * prettify debug entry point print.

From v1[1]:
 * collect the Tested-by tags (Jiri);
 * don't add pathetic returns after noreturn error() (Jiri);
 * debug-print the entry point offset via debug_putaddr() before
   booting (Jiri);
 * always have an empty line before return statements (Jiri). 

[0] https://lore.kernel.org/all/20221101161529.1634188-1-alexandr.lobakin@intel.com
[1] https://lore.kernel.org/all/20221031151047.167288-1-alexandr.lobakin@intel.com
-- 
2.39.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-01-09 18:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-09 17:04 [PATCH v3 0/2] x86/boot: fix relying on link order Alexander Lobakin
2023-01-09 17:04 ` [PATCH v3 1/2] x86/boot: robustify calling startup_{32,64}() from the decompressor code Alexander Lobakin
2023-01-09 18:22   ` [tip: x86/boot] x86/boot: Robustify " tip-bot2 for Alexander Lobakin
2023-01-09 17:04 ` [PATCH v3 2/2] scripts/head-object-list: remove x86 from the list Alexander Lobakin
2023-01-09 18:22   ` [tip: x86/boot] scripts/head-object-list: Remove " tip-bot2 for Alexander Lobakin
2023-01-09 17:23 ` [PATCH v3 0/2] x86/boot: fix relying on link order Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox