[Devel] [PATCH hci-8.1 0/4] configs: a User Mode Linux kernel for the KUnit tests
Eva Kurchatova (Virtuozzo)
eva.kurchatova at virtuozzo.com
Mon Oct 26 21:52:12 MSK 2026
On 10/26/26 20:05, Konstantin Khorenko wrote:
> Several KUnit tests can only be built into the kernel image, and the
> shipped kernel builds its tests as modules, so nothing runs them. The
> series adds a "um" config variant: a User Mode Linux kernel with every
> KUnit test built in, under KASAN and UBSAN. kernel.spec builds it with
> ARCH=um, kernel-selftests-internal ships it, and the hci-kunit test runs
> it.
>
> The variant inherits the generic and generic-x86 layers, so the tests
> meet the options of the shipped x86_64 kernel, vz ones included. What
> differs lives in custom-overrides/generic/um, one file per option as
> for the other variants, and passes process_configs.sh -n -w -c.
>
> - 1/4: the um variant, with the reason for each option turned off
> - 2/4: KASAN_KUNIT_TEST keeps its prompt under KUNIT_ALL_TESTS, so
> that the um config can leave it out
> - 3/4: KASAN, without its self-test
> - 4/4: no debug info, which kernel.spec would throw away anyway
>
> Outside this series:
>
> - vzkernel.vzspecs: "kernel.spec: build the User Mode Linux KUnit
> kernel" builds and packages it from kernel-um-rhel.config
> - git-publish.sh brings kernel-um-rhel.config to vzkernel.vzspecs
> along with the x86_64 configs
> - hci-tests PR #9241 (hci-kunit) runs it; a follow-up boots it with
> kasan_multi_shot
>
> The overrides and their reasons come from Eva Kurchatova's
> kunit-uml-config.sh approach in vzkernel.vzspecs, which derived the
> config at build time. This series moves the config into the kernel
> tree.
>
> https://virtuozzo.atlassian.net/browse/VSTOR-143636
> https://virtuozzo.atlassian.net/browse/VSTOR-148112
>
> Assisted-by: LLM
> Signed-off-by: Konstantin Khorenko <khorenko at virtuozzo.com>
The config is faithful. I built kernel-um-rhel.config, and compared it
with what kunit-uml-config.sh makes from the shipped x86_64 config: the
same 77 KUnit tests built in, the same vz options, the same sanity
checks. The only differences are the debug info (4/4) and the KASAN
self-test (2/4, 3/4). Built with ARCH=um and booted with
kasan_multi_shot: 182 pass, 0 fail, no kernel report.
Two points that I still believe are unresolved:
1. Please drop 2/4 and keep the KASAN self-test. hci-kunit does not fail
on its reports: since "hci-kunit: leave the reports of a suite that
provokes them out of the check" (PR #9241) reports inside the kasan
suite are expected, and the run is 183 pass, 0 fail with it. The test is
also the only proof that KASAN catches anything in this kernel. Without
it, a KASAN that silently stopped working would look like a clean run.
And 2/4 would be a vz-only change to lib/Kconfig.kasan that mainline
does not need.
2. The static list of builtin tests will drift. 69 of the override files
only turn a generic =m test into =y. A KUnit test that a RHEL import
adds lands in common/generic as =m and stays a module here, which the
UML kernel never loads, so it silently does not run. process_configs.sh
does not catch it, =m is a valid value. The script built every KUnit
test in by itself.
A check in kernel.spec after olddefconfig would cover it: fail when a
symbol defaulting to KUNIT_ALL_TESTS is =m, except the tests whose
subsystem is a module (cfg80211, mac80211, iwlwifi, xe, vkms, hid,
rpcsec_gss_krb5, prp).
Optional: CONFIG_SLUB_RCU_DEBUG=y. It is a KASAN feature that catches
use after free of RCU-freed slab objects, off here because the generic
layer sets it off for kernels without KASAN. My config lacked it too,
though.
More information about the Devel
mailing list