Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754092AbbBKU0Z (ORCPT ); Wed, 11 Feb 2015 15:26:25 -0500 Received: from mail.skyhub.de ([78.46.96.112]:39592 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752655AbbBKU0X (ORCPT ); Wed, 11 Feb 2015 15:26:23 -0500 Date: Wed, 11 Feb 2015 21:25:44 +0100 From: Borislav Petkov To: Scotty Bauer 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 Message-ID: <20150211202544.GF3650@pd.tnic> References: <54CBF6F9.5040508@eng.utah.edu> <20150130233142.GA1884@pd.tnic> <20150206160547.GF3220@pd.tnic> <20150206161310.GG3220@pd.tnic> <54DBA1E4.5050705@eng.utah.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <54DBA1E4.5050705@eng.utah.edu> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1659 Lines: 42 Hi Scotty, On Wed, Feb 11, 2015 at 11:39:32AM -0700, Scotty Bauer wrote: > 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. please do not top-post, thanks. Right, in thinking about this more, your original version actually is, IMO, still the right thing to do. Why, you ask. Well, because even with the alternatives, we need to alternate not only the CLFLUSH but the surrounding MFENCEs too. And those are different instructions on 32- and 64-bit. And doing that with the alternatives might become uglier/more cluttered in the end than your version. And so, in the end of the day, having an unconditional, two-byte JMP in there for all machines which are *not* affected shouldn't hurt - we're jumping with great probability to the same I$ cacheline so not even a cache miss. And we're on our way to idle so one more JMP is a dont-care. And the C-code is actually readable. :-) My only suggestion would be to change your original patch to what is done in mwait_idle_with_hints() and use static_cpu_has_bug(). Thanks. -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply. -- -- 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/