[PATCH v2 9/9] selftests: kho: add read-only KHO test to vmtest.sh

sashiko-bot at kernel.org sashiko-bot at kernel.org
Sun Oct 25 10:57:07 PDT 2026


> vmtest.sh currently only tests standard KHO restoration and does not
> exercise read-only KHO mode ('kho_ro=<fdt_phys>') in QEMU.
> 
> Extend tools/testing/selftests/kho/vmtest.sh and init.c to enable both
> CONFIG_KEXEC_HANDOVER=y and CONFIG_KEXEC_HANDOVER_READONLY=y in the
> kernel configuration and run a second QEMU test verifying read-only KHO
> after the standard KHO test on both x86_64 and aarch64:
> 
> - Enable CONFIG_KEXEC_HANDOVER_READONLY=y alongside
>   CONFIG_KEXEC_HANDOVER=y in build_kernel().
> - Pass KHO_RO_CMDLINE ('nokaslr kho_bootmem=64M,64M,64M' on x86_64) to
>   the first kernel in the read-only test run and configure 4G of RAM on
>   aarch64 so GFP_KERNEL KHO allocations are placed in ZONE_NORMAL above
>   4G, outside the read-only kernel's System RAM.
> - When booted with 'kho_ro_test', read /debugfs/kho/out/fdt_phys in
>   init.c and kexec into the target kernel with 'kho_ro=<fdt_phys>' and
>   architecture-specific memory parameters
>   ('memmap=792M$16M memmap=24M$1000M' on x86_64, 'mem=128M' on aarch64)
>   so the preserved pages are excluded from the boot memory map and
>   mapped via kho_ro_map_folio().
> - Verify 'KHO restore succeeded' from test_kho in read-only mode.
> 
> Signed-off-by: Pasha Tatashin <pasha.tatashin at soleen.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261025174017.3870481-1-pasha.tatashin@soleen.com?part=9




More information about the kexec mailing list