mbox series

[MINI-OS,00/12] kexec: add kexec support to Mini-OS

Message ID 20250321092451.17309-1-jgross@suse.com (mailing list archive)
Headers show
Series kexec: add kexec support to Mini-OS | expand

Message

Jürgen Groß March 21, 2025, 9:24 a.m. UTC
Add basic kexec support to Mini-OS for running in x86 PVH mode.

With this series applied it is possible to activate another kernel
from within Mini-OS.

Right now no Xen related teardown is done (so no reset of grant table,
event channels, PV devices). These should be added via kexec callbacks
which are added as a framework.

This is a major building block for support of Xenstore-stubdom live
update (in fact I've tested the kexec path to work using the PVH
variant of Xenstore-stubdom).

Juergen Gross (12):
  add kexec framework
  Mini-OS: add final kexec stage
  mini-os: add elf.h
  mini-os: analyze new kernel for kexec
  mini-os: kexec: finalize parameter location and size
  mini-os: reserve memory below boundary
  mini-os: kexec: build parameters for new kernel
  mini-os: kexec: move used pages away for new kernel
  Mini-OS: mm: change set_readonly() to change_readonly()
  Mini-OS: kexec: switch read-only area to be writable again
  mini-os: kexec: add kexec callback functionality
  mini-os: kexec: do the final kexec step

 Config.mk                  |   1 +
 Makefile                   |   1 +
 arch/x86/kexec.c           | 273 +++++++++++++++++++++++++++++
 arch/x86/minios-x86.lds.S  |  16 ++
 arch/x86/mm.c              | 238 ++++++++++++++++++++------
 arch/x86/testbuild/all-no  |   1 +
 arch/x86/testbuild/all-yes |   2 +
 arch/x86/testbuild/kexec   |   4 +
 arch/x86/x86_hvm.S         |  46 +++++
 include/elf.h              | 340 +++++++++++++++++++++++++++++++++++++
 include/kexec.h            |  63 +++++++
 include/mm.h               |   8 +
 include/x86/os.h           |   5 +
 kexec.c                    | 253 +++++++++++++++++++++++++++
 mm.c                       |  89 +++++++++-
 15 files changed, 1289 insertions(+), 51 deletions(-)
 create mode 100644 arch/x86/kexec.c
 create mode 100644 arch/x86/testbuild/kexec
 create mode 100644 include/elf.h
 create mode 100644 include/kexec.h
 create mode 100644 kexec.c

Comments

Samuel Thibault March 22, 2025, 11:54 p.m. UTC | #1
Hello,

Juergen Gross, le ven. 21 mars 2025 10:24:39 +0100, a ecrit:
> Add basic kexec support to Mini-OS for running in x86 PVH mode.

I am wondering if you had considered using libxc to implement this?
The original pv-grub1 is doing it (xen/stubdom/grub/kexec.c)

Samuel
Jürgen Groß March 23, 2025, 7:01 a.m. UTC | #2
On 23.03.25 00:54, Samuel Thibault wrote:
> Hello,
> 
> Juergen Gross, le ven. 21 mars 2025 10:24:39 +0100, a ecrit:
>> Add basic kexec support to Mini-OS for running in x86 PVH mode.
> 
> I am wondering if you had considered using libxc to implement this?
> The original pv-grub1 is doing it (xen/stubdom/grub/kexec.c)

The libxc (or more precise: libxenguest) usage is needed there only for
construction of the PV specific parts like the initial page tables and
the p2m map. The main kexec functionality as I need it for PVH stubdom
is in grub itself.

Additionally I've worked hard to get rid of non-stable Xen libraries in
Xenstore-stubdom. Adding them again just after removal would be weird.


Juergen