Re: [PATCH v2] x86/cpu/hygon: Work around XSAVES Erratum 1386
From: Borislav Petkov
Date: Sat Nov 21 2026 - 14:19:56 EST
On Sat, Nov 21, 2026 at 06:53:20PM +0800, Tina Zhang 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.
>
> The failure mode is documented as Erratum 1386 in "Revision Guide for
> AMD Family 19h Models 00h-0Fh Processors", Publication #56683 [1].
>
> 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.
>
> 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.
>
> [1] https://www.amd.com/content/dam/amd/en/documents/processor-tech-docs/revision-guides/56683.pdf
>
> Signed-off-by: Tina Zhang <zhang_wei@xxxxxxxxxxxxxx>
> Tested-by: Qiming Deng <dengqiming@xxxxxxxx>
> Reviewed-by: Zhen Yang <yangzhen@xxxxxxxx>
> Cc: stable@xxxxxxxxxxxxxxx
> ---
> Changes in v2:
> - Keep the workaround self-contained in hygon.c while following the AMD
> implementation pattern.
> - Describe the affected processors in an x86_cpu_id table instead of using
> open-coded family and model checks.
> - Add a reference to the public Erratum 1386 documentation.
>
> arch/x86/kernel/cpu/hygon.c | 41 +++++++++++++++++++++++++++++++++++++
> 1 file changed, 41 insertions(+)
https://sashiko.dev/#/patchset/20261121105320.478279-1-zhang_wei%40open-hieco.net
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette