Re: [PATCH 5/8] x86: Make old K8 swapgs workaround conditional

From: Andi Kleen
Date: Fri Apr 10 2015 - 19:10:21 EST


On Sat, Apr 11, 2015 at 12:01:10AM +0200, Borislav Petkov wrote:
> > diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
> > index a220239..e7f5667 100644
> > --- a/arch/x86/kernel/cpu/amd.c
> > +++ b/arch/x86/kernel/cpu/amd.c
> > @@ -551,6 +551,9 @@ static void init_amd_k8(struct cpuinfo_x86 *c)
> > if ((level >= 0x0f48 && level < 0x0f50) || level >= 0x0f58)
> > set_cpu_cap(c, X86_FEATURE_REP_GOOD);
> >
> > + /* Early steppings needed a mfence on swapgs. */
> > + set_cpu_cap(c, X86_BUG_SWAPGS_MFENCE);
>
> set_cpu_bug()
>
> and this should not be set on all K8 but for the early steppings only
> which need it.

I don't know which one, but I don't think it really matters.

-Andi
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/