From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756494AbbDJXKR (ORCPT ); Fri, 10 Apr 2015 19:10:17 -0400 Received: from one.firstfloor.org ([193.170.194.197]:45826 "EHLO one.firstfloor.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751674AbbDJXKO (ORCPT ); Fri, 10 Apr 2015 19:10:14 -0400 Date: Sat, 11 Apr 2015 01:10:13 +0200 From: Andi Kleen To: Borislav Petkov Cc: Andi Kleen , x86@kernel.org, luto@kernel.org, linux-kernel@vger.kernel.org, Andi Kleen Subject: Re: [PATCH 5/8] x86: Make old K8 swapgs workaround conditional Message-ID: <20150410231013.GD2366@two.firstfloor.org> References: <1428681033-1549-1-git-send-email-andi@firstfloor.org> <1428681033-1549-6-git-send-email-andi@firstfloor.org> <20150410220110.GC28317@pd.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150410220110.GC28317@pd.tnic> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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