Re: [RFC PATCH 03/56] cpu: Reset global mitigations

Josh Poimboeuf
2025-10-17T16:03:11Z

On Fri, Oct 17, 2025 at 02:19:43PM +0000, Kaplan, David wrote:
> > > Considering this will have no effect on other arches (or even on x86 at
> > > this point in the series), should CONFIG_DYNAMIC_MITIGATIONS depend on
> > > an arch-specific CONFIG_HAVE_DYNAMIC_MITIGATIONS?
> > >
> > > Then the weak function can be removed (and weak functions should be
> > > avoided anyway, IMO).
> > >
> >
> > Ok. I agree, the feature doesn't make sense without arch-specific support anyway,
> > so that seems reasonable.
>
> Well, so right now CONFIG_DYNAMIC_MITIGATIONS is only defined in
> arch/x86/Kconfig so it's already arch-specific. It's part of the CPU
> mitigations menu there.
>
> So I guess these weak functions aren't actually needed in the first
> place.
>
> Alternatively I suppose I could make CONFIG_DYNAMIC_MITIGATIONS a
> generic feature (which requires an arch to support it).

I'd say generic is probably the way to go, as the sysfs files and
mitigations= interfaces are already generic, and users might want this
on other arches eventually.

--
Josh