RE: [RFC PATCH 53/56] drivers/cpu: Re-patch mitigations through sysfs
From: Kaplan, David
Date: Mon Oct 27 2025 - 10:07:06 EST
[AMD Official Use Only - AMD Internal Distribution Only]
> -----Original Message-----
> From: Nikolay Borisov <nik.borisov@xxxxxxxx>
> Sent: Monday, October 27, 2025 7:25 AM
> To: Kaplan, David <David.Kaplan@xxxxxxx>; Thomas Gleixner
> <tglx@xxxxxxxxxxxxx>; Borislav Petkov <bp@xxxxxxxxx>; Peter Zijlstra
> <peterz@xxxxxxxxxxxxx>; Josh Poimboeuf <jpoimboe@xxxxxxxxxx>; Pawan Gupta
> <pawan.kumar.gupta@xxxxxxxxxxxxxxx>; Ingo Molnar <mingo@xxxxxxxxxx>; Dave
> Hansen <dave.hansen@xxxxxxxxxxxxxxx>; x86@xxxxxxxxxx; H . Peter Anvin
> <hpa@xxxxxxxxx>
> Cc: Alexander Graf <graf@xxxxxxxxxx>; Boris Ostrovsky
> <boris.ostrovsky@xxxxxxxxxx>; linux-kernel@xxxxxxxxxxxxxxx
> Subject: Re: [RFC PATCH 53/56] drivers/cpu: Re-patch mitigations through sysfs
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> On 10/13/25 17:34, David Kaplan wrote:
> > Create a new file at /sys/devices/system/cpu/mitigations that prints the
> > current set of mitigation options and can be written to in order to
> > re-select mitigations.
> >
> > Only options related to mitigations are handled, with the file initially
> > returning the relevant options from the command line. When the file is
> > written, any existing selections are discarded and the new options are
> > evaluated.
> >
> > Signed-off-by: David Kaplan <david.kaplan@xxxxxxx>
> > ---
> > .../ABI/testing/sysfs-devices-system-cpu | 8 ++
> > drivers/base/cpu.c | 113 ++++++++++++++++++
> > include/linux/cpu.h | 3 +
> > 3 files changed, 124 insertions(+)
> >
>
> <snip>
>
> > +
> > +ssize_t cpu_show_mitigation_options(struct device *dev, struct device_attribute
> *attr, char *buf);
> > +ssize_t cpu_show_mitigation_options(struct device *dev, struct device_attribute
> *attr, char *buf)
>
> Make it static
>
> > +{
> > + return sysfs_emit(buf, saved_opts);
> > +}
> > +
> > +ssize_t cpu_write_mitigation_options(struct device *dev,
> > + struct device_attribute *attr,
> > + const char *buf, size_t count);
> > +
> > +void __weak cpu_prepare_repatch_alternatives(void)
> > +{
> > +}
> > +
> > +void __weak cpu_update_alternatives(void)
> > +{
> > +}
> > +
> > +void __weak cpu_select_mitigations(void)
> > +{
> > +}
> > +
> > +ssize_t cpu_write_mitigation_options(struct device *dev,
> > + struct device_attribute *attr,
> > + const char *buf, size_t count)
> Ditto
>
> <snip>
Ack, thanks
--David Kaplan