Re: [PATCH] x86/cpu/hygon: Work around XSAVES Erratum 1386

From: David Laight

Date: Fri Nov 20 2026 - 09:44:37 EST


On Fri, 20 Nov 2026 22:12:59 +0800
Tina Zhang <zhang_wei@xxxxxxxxxxxxxx> wrote:

> Hi David,
>
>
> On 11/20/2026 5:46 PM, David Laight wrote:
> > On Thu, 29 Oct 2026 07:57:12 +0800
> > Tina Zhang<zhang_wei@xxxxxxxxxxxxxx> wrote:
> >
> >> The XSAVES malfunction described in AMD Erratum 1386 also affects
> >> certain Hygon Family 18h processors. Under specific conditions, XSAVES
> >> may fail to save XMM register state, allowing stale register values to
> >> reappear after the state is restored.
> >>
> >> None of the affected processors enumerate supervisor XSAVE state
> >> components. XSAVEC is therefore equivalent for their enabled state
> >> components and is not affected by the erratum.
> > Would it just make sense to use XSAVES unless there are bits set in XSS
> > MSR that the kernel might need to request be saved?
>
> Did you mean that the kernel could prefer XSAVEC when no supervisor
> XSAVE state needs to be saved, rather than clearing X86_FEATURE_XSAVES
> on the affected processors?

Or when there can never be any supervisor XSAVE state to be saved.
I rather lost track of these instructions after XSAVEOPT.

David

>
> That sounds reasonable in principle, although IIUC it would require
> changes to the current xstate instruction selection logic.
>
> Thanks,
> Tina
>