Re: [PATCH RFC v10 22/22] mm: Add basic tests for kpkeys_hardened_pgtables

From: Kevin Brodsky

Date: Thu Nov 12 2026 - 07:18:53 EST


On 11/11/2026 17:15, Mark Brown wrote:
>>> Yes, or something like that - unfortunately KUnit checks to see if the
>>> config options appear in the configuration so something that vanishes on
>>> other architectures causes issues.
>> Alright, I guess there's not much we can do then, short of creating
>> arch-specific fragments.
> Or my suggestion below, or come up with some generic option that could
> always be there and would in turn select hardening things. There's
> probably a case for having something given that the hardening features
> will tend to catch some kinds of test error but that feels more config
> fragment like. Another idea would be to teach KUnit about the idea that
> it should try turning on some config options but not worry if they're
> not selected.
>
>>> Perhaps the default for the config
>>> option ought to depend on KUNIT_ALL_TESTS?
>> Not sure I'm following, the config already has default KUNIT_ALL_TESTS?
> The config for the test does, but KPKEYS_HARDENED_PGTABLES which the
> test depends on does not so unless the underlying defconfig turns that
> on the test won't be enabled. I was suggesting also adding a default
> for testing.

Ah got it. It doesn't look like there's a precedent for KUNIT_ALL_TESTS
having that kind of side effect though.

A separate fragment for hardening options where KUnit ignores options
not getting selected seems like a reasonable approach.

- Kevin