[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <SJ1PR11MB6083654145DEDC921F7E39BAFC172@SJ1PR11MB6083.namprd11.prod.outlook.com>
Date: Thu, 25 Apr 2024 16:29:37 +0000
From: "Luck, Tony" <tony.luck@...el.com>
To: Borislav Petkov <bp@...en8.de>
CC: Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>,
"Dave Hansen" <dave.hansen@...ux.intel.com>, "x86@...nel.org"
<x86@...nel.org>, "H. Peter Anvin" <hpa@...or.com>, Luis Chamberlain
<mcgrof@...nel.org>, "Paolo Bonzini" <pbonzini@...hat.com>, "Raj, Ashok"
<ashok.raj@...el.com>, "Si, Bingsong" <sibs@...natelecom.cn>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"patches@...ts.linux.dev" <patches@...ts.linux.dev>
Subject: RE: [PATCH v4 29/71] x86/cpu/intel: Switch to new Intel CPU model
defines
> > +static bool vfm_match(struct cpuinfo_x86 *c, u32 vfm)
> > +{
> > + return c->x86_vendor == VFM_VENDOR(vfm) &&
> > + c->x86 == VFM_FAMILY(vfm) &&
> > + c->x86_model == VFM_MODEL(vfm);
> > +}
>
> Why is that one here?
>
> It looks generic enough to put it in asm/processor.h so that it can get
> used elsewhere too instead of homegrowing things again...
Looking at it now in the context of where this patch series ended, it looks
to be superfluous. It just reduces to:
static bool vfm_match(struct cpuinfo_x86 *c, u32 vfm)
{
return c->x86_vfm == vfm;
}
But since it is only used in one place, I should just do that test inline without
a helper:
if (c->x86_vfm == spectre_bad_microcodes[i].vfm &&
c->x86_stepping == spectre_bad_microcodes[i].stepping)
return (c->microcode <= spectre_bad_microcodes[i].microcode);
-Tony
Powered by blists - more mailing lists