public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: Scotty Bauer <sbauer@eng.utah.edu>
Cc: tglx@linutronix.de, mingo@redheat.com, hpa@zytor.com,
	linux-kernel@vger.kernel.org, x86@kernel.org
Subject: [PATCH] x86, smpboot: Call CLFLUSH only on X86_BUG_CLFLUSH_MONITOR-affected CPUs
Date: Fri, 6 Feb 2015 17:13:10 +0100	[thread overview]
Message-ID: <20150206161310.GG3220@pd.tnic> (raw)
In-Reply-To: <20150206160547.GF3220@pd.tnic>

From: Borislav Petkov <bp@suse.de>
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 <sbauer@eng.utah.edu>.

Cc: Scotty Bauer <sbauer@eng.utah.edu>
Signed-off-by: Borislav Petkov <bp@suse.de>
---
 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();
-- 
2.2.0.33.gc18b867


-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.
--

  reply	other threads:[~2015-02-06 16:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-30 21:26 [PATCH] x86/smpboot: check if CLFLUSH is actually necessary Scotty Bauer
2015-01-30 23:31 ` Borislav Petkov
2015-02-06 16:05   ` Borislav Petkov
2015-02-06 16:13     ` Borislav Petkov [this message]
2015-02-11 18:39       ` [PATCH] x86, smpboot: Call CLFLUSH only on X86_BUG_CLFLUSH_MONITOR-affected CPUs Scotty Bauer
2015-02-11 20:25         ` Borislav Petkov
2015-02-11 21:55 ` [PATCH] x86/smpboot: check if CLFLUSH is actually necessary H. Peter Anvin
2015-02-11 23:10   ` Scotty Bauer
2015-02-12  9:16     ` Borislav Petkov
2015-02-11 21:55 ` H. Peter Anvin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150206161310.GG3220@pd.tnic \
    --to=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redheat.com \
    --cc=sbauer@eng.utah.edu \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox