Re: [PATCH v2] kfence: don't allow static keys mode on x86

From: David Laight

Date: Thu Dec 03 2026 - 17:41:32 EST


On Wed, 02 Dec 2026 14:48:21 -0800
Chris Down <chris@xxxxxxxxxxxxxx> wrote:

> Hi Marco,
>
> Marco Elver writes:
> >Having pondered this a bit longer, I'm quite split on what to do. One
> >option is to leave as-is, but does knowing it's constrained by EXPERT
> >cover the case you were worried about?
>
> Hmm, let me think a bit more about this. I agree with you and Peter that
> losing x86 build and test coverage of those paths is a real cost for the
> architectures that keep the option.
>
> Thanks for reviewing all the versions. Let me get back on this once I
> understand a bit more about under what conditions this was set, and why
> some tiers are using this. But for now feel free to consider this not
> needed to worry about :-)

I wondered why it was done at all.
I can imaging the static key being used to enable/disable kfence, but a
single extra memory access inside a memory allocater that is running with
'a bit of extra debug' enabled seems unlikely to be measurable.

I was more intrigued to see that is can't actually be turned off, and seems
to always be enabled (some time after boot) if compiled in.

David

>
> Thanks!
>
> Chris
>