Re: [PATCH] x86/cpu/hygon: Work around XSAVES Erratum 1386
From: David Laight
Date: Fri Nov 20 2026 - 04:47:11 EST
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?
That is 'use XSAVES unless you need to use XSAVEC'.
Then you don't have to worry about cpu models and microcode versions.
David
>
> Family 18h models 00h through 06h and model 10h are affected. Other
> Family 18h models contain the fix in hardware.
>
> For the following model and stepping combinations, the minimum
> microcode revisions containing the fix are:
>
> Model Stepping Microcode
> 04h 0 0x9040000f
> 04h 1 0x9041000f
> 06h 0 0x9060000f
> 06h 1 0x9061000f
> 10h 0 0x91000004
>
> These are the only known steppings for those models.
>
> Disable XSAVES on affected processors unless a matching model and
> stepping entry identifies a sufficiently recent microcode revision
> containing the fix. This allows the x86 FPU code to use XSAVEC
> instead.
...