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

From: Tina Zhang

Date: Thu Nov 26 2026 - 09:06:56 EST




On 11/26/2026 12:47 PM, Borislav Petkov wrote:
On Tue, Nov 24, 2026 at 10:26:32PM +0800, Tina Zhang wrote:
static void init_hygon(struct cpuinfo_x86 *c)
{
u64 vm_cr;
early_init_hygon(c);
+ /*
+ * Model 00h is a valid Hygon processor model, but x86_match_cpu()
+ * treats a model value of 0 as X86_MODEL_ANY. Match Model 00h
+ * explicitly.
+ */
+ if ((c->x86 == 0x18 && c->x86_model == 0x00) ||
+ x86_match_cpu(erratum_1386_cpus))

So this can be:

if ((c->x86 == 0x18) &&
(c->x86_model <= 0x6 || c->x86_model == 0x10))

and you don't need the _cpus table?

Yes, that covers all affected Family 18h models, including 00h.
I'll use that check and drop erratum_1386_cpus[] in v4.

Thanks,
Tina