Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754133AbbBKSjl (ORCPT ); Wed, 11 Feb 2015 13:39:41 -0500 Received: from mailhub.eng.utah.edu ([155.98.110.27]:41806 "EHLO mailhub.eng.utah.edu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753057AbbBKSjk (ORCPT ); Wed, 11 Feb 2015 13:39:40 -0500 Message-ID: <54DBA1E4.5050705@eng.utah.edu> Date: Wed, 11 Feb 2015 11:39:32 -0700 From: Scotty Bauer User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Borislav Petkov CC: tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, linux-kernel@vger.kernel.org, x86@kernel.org Subject: Re: [PATCH] x86, smpboot: Call CLFLUSH only on X86_BUG_CLFLUSH_MONITOR-affected CPUs References: <54CBF6F9.5040508@eng.utah.edu> <20150130233142.GA1884@pd.tnic> <20150206160547.GF3220@pd.tnic> <20150206161310.GG3220@pd.tnic> In-Reply-To: <20150206161310.GG3220@pd.tnic> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-UCE-Score: -1.9 (-) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1721 Lines: 46 For what its worth I tried it out and it works fine on my end. Thanks for doing the hard work for me, Boris. Also, thanks for a pointer to the alternatives. I think it may be worth doing a patch that is almost verbatim to this for mwait_idle_with_hints in arch/x86/include/asm/mwait.h to keep things consistent. I can work on that over the weekend. --Scotty On 02/06/2015 09:13 AM, Borislav Petkov wrote: > From: Borislav Petkov > Subject: [PATCH] x86, smpboot: Call CLFLUSH only on X86_BUG_CLFLUSH_MONITOR-affected CPUs > > Make the AAI65 erratum workaround for Xeon 7400 machines only instead of > punishing all CPUs doing idle with MWAIT with the CLFLUSH penalty. > > Based on a patch originally by Scotty Bauer . > > Cc: Scotty Bauer > Signed-off-by: Borislav Petkov > --- > arch/x86/kernel/smpboot.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c > index 6d7022c683e3..771ebd6e8b77 100644 > --- a/arch/x86/kernel/smpboot.c > +++ b/arch/x86/kernel/smpboot.c > @@ -1432,7 +1432,11 @@ static inline void mwait_play_dead(void) > * case where we return around the loop. > */ > mb(); > - clflush(mwait_ptr); > + > + asm volatile(ALTERNATIVE("", "clflush %[p]", > + X86_BUG_CLFLUSH_MONITOR) > + : [p] "+m" (*(unsigned long *)mwait_ptr)); > + > mb(); > __monitor(mwait_ptr, 0, 0); > mb(); -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/