lkml.org 
[lkml]   [2015]   [Feb]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] x86, smpboot: Call CLFLUSH only on X86_BUG_CLFLUSH_MONITOR-affected CPUs
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.
--


\
 
 \ /
  Last update: 2015-02-11 21:41    [W:0.052 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site