From: Borislav Petkov <bp@alien8.de>
To: Scotty Bauer <sbauer@eng.utah.edu>
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
Date: Wed, 11 Feb 2015 21:25:44 +0100 [thread overview]
Message-ID: <20150211202544.GF3650@pd.tnic> (raw)
In-Reply-To: <54DBA1E4.5050705@eng.utah.edu>
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.
--
next prev parent reply other threads:[~2015-02-11 20:26 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 ` [PATCH] x86, smpboot: Call CLFLUSH only on X86_BUG_CLFLUSH_MONITOR-affected CPUs Borislav Petkov
2015-02-11 18:39 ` Scotty Bauer
2015-02-11 20:25 ` Borislav Petkov [this message]
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=20150211202544.GF3650@pd.tnic \
--to=bp@alien8.de \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.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