All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v9 0/4] x86/kexec: Add exception handling for relocate_kernel
@ 2025-03-26 14:16 David Woodhouse
  2025-03-26 14:16 ` [PATCH v9 1/4] x86/kexec: Add 8250 serial port output David Woodhouse
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: David Woodhouse @ 2025-03-26 14:16 UTC (permalink / raw)
  To: kexec
  Cc: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
	H . Peter Anvin, David Woodhouse, Kirill A . Shutemov, Kai Huang,
	Nikolay Borisov, linux-kernel, Simon Horman, Dave Young,
	Peter Zijlstra, jpoimboe, bsz

Continuing the drip-feed of the exception handling support, on top of the
current tip/x86/asm branch. This adds output to the serial port configured
by earlyprintk, reduces the window during which exceptions can't be handled
during the transition from kernel to relocate_kernel environment, and adds
a kselftest for the kexec-jump and exception handling.

v9:
 • Rebase on top of partial merge into tip/x86/asm (commit 0717b1392dc7).
 • Add kselftest.
 • Update to cope with static_call() usage in earlyprintk.
 • Drop the attempt at adding CFI support for relocate_kernel().

v8: https://lore.kernel.org/all/20250314173226.3062535-1-dwmw2@infradead.org/
 • Fix UNRET objtool warning in exc_handler.
 • Clean up magic numbers in stack frame for exc_handler.
 • Fix i386 build error due to making the debug support unconditional.
 • The int3 is still a [DO NOT APPLY] hack for later, and I plan to deal
   with that with a userspace test case based on
   http://david.woodhou.se/loadret.c which will exercise kexec-jump at the
   same time.

v7: https://lore.kernel.org/kexec/20250312144257.2348250-1-dwmw2@infradead.org/
 • Drop CONFIG_KEXEC_DEBUG and make it all unconditional in order to
   "throw regressions back into the face of whoever manages to introduce
   them" (Ingo, https://lore.kernel.org/kexec/Z7rwA-qVauX7lY8G@gmail.com/)
 • Move IDT invalidation into relocate_kernel() itself.

v6: https://lore.kernel.org/kexec/20250115191423.587774-1-dwmw2@infradead.org/
 • Rebase onto already-merged fixes in tip/x86/boot.
 • Move CONFIG_KEXEC_DEBUG to generic kernel/Kconfig.kexec as Bartosz is
   working on an Arm64 version.

v5: https://lore.kernel.org/kexec/20241205153343.3275139-1-dwmw2@infradead.org/T/
 • Drop [RFC].
 • Drop _PAGE_NOPTISHADOW fix, which Ingo already took into tip/x86/urgent.
 • Add memory-mapped serial port support (32-bit MMIO spacing only).

v4 (RFC): https://lore.kernel.org/kexec/20241127190343.44916-1-dwmw2@infradead.org/T/
 • Add _PAGE_NOPTISHADOW fix for the identmap code.
 • Drop explicit map of control page, which was masking the identmap bug.

v3 (RFC): https://lore.kernel.org/kexec/20241125100815.2512-1-dwmw2@infradead.org/T/
 • Add CONFIG_KEXEC_DEBUG option and use earlyprintk config.
 • Allocate PGD separately from control page.
 • Explicitly map control page into identmap.

V2 (RFC): https://lore.kernel.org/kexec/20241122224715.171751-1-dwmw2@infradead.org/T/
 • Introduce linker script, start to clean up data access.

V1 (RFC): https://lore.kernel.org/kexec/20241103054019.3795299-1-dwmw2@infradead.org/T/
 • Initial proof-of-concept hacks.


David Woodhouse (4):
      x86/kexec: Add 8250 serial port output
      x86/kexec: Add 8250 MMIO serial port output
      x86/kexec: Invalidate GDT/IDT from relocate_kernel() instead of earlier
      selftests/kexec: Add x86_64 selftest for kexec-jump and exception handling

 arch/x86/include/asm/kexec.h                     |  2 +
 arch/x86/kernel/early_printk.c                   |  9 +++
 arch/x86/kernel/machine_kexec_64.c               | 27 ++++++---
 arch/x86/kernel/relocate_kernel_64.S             | 70 ++++++++++++++++++++---
 tools/testing/selftests/kexec/Makefile           |  7 +++
 tools/testing/selftests/kexec/test_kexec_jump.c  | 72 ++++++++++++++++++++++++
 tools/testing/selftests/kexec/test_kexec_jump.sh | 42 ++++++++++++++
 7 files changed, 213 insertions(+), 16 deletions(-)



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

end of thread, other threads:[~2025-04-10 11:13 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-26 14:16 [PATCH v9 0/4] x86/kexec: Add exception handling for relocate_kernel David Woodhouse
2025-03-26 14:16 ` [PATCH v9 1/4] x86/kexec: Add 8250 serial port output David Woodhouse
2025-04-10 11:13   ` [tip: x86/asm] " tip-bot2 for David Woodhouse
2025-03-26 14:16 ` [PATCH v9 2/4] x86/kexec: Add 8250 MMIO " David Woodhouse
2025-04-10 11:13   ` [tip: x86/asm] " tip-bot2 for David Woodhouse
2025-03-26 14:16 ` [PATCH v9 3/4] x86/kexec: Invalidate GDT/IDT from relocate_kernel() instead of earlier David Woodhouse
2025-04-01  9:48   ` Huang, Kai
2025-04-01  9:53     ` David Woodhouse
2025-04-10 11:12   ` [tip: x86/asm] " tip-bot2 for David Woodhouse
2025-03-26 14:16 ` [PATCH v9 4/4] selftests/kexec: Add x86_64 selftest for kexec-jump and exception handling David Woodhouse
2025-04-10 11:12   ` [tip: x86/asm] " tip-bot2 for David Woodhouse
2025-04-10  7:26 ` [PATCH v9 0/4] x86/kexec: Add exception handling for relocate_kernel David Woodhouse

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.