lkml.org 
[lkml]   [2021]   [Oct]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [GIT PULL] KVM fixes for Linux 5.15-rc7
From
On 18/10/21 20:15, Linus Torvalds wrote:
>> * Use a bitwise-OR instead of a logical-OR to aggregate the reserved
>> * bits and EPT's invalid memtype/XWR checks to avoid an extra Jcc
>> * (this is extremely unlikely to be short-circuited as true).
> That makes very little sense.
>
> It seems to be avoiding a 'jcc' and replace it with a 'setcc' and an
> 'or'. Which is likely both bigger and slower.

The compiler knows that the setcc is unnecessary, because a!=0|b!=0 is
the same as (a|b)!=0.

> If the jcc were unpredictable, maybe that would be one thing. But at
> least from a quick look, that doesn't even seem likely
>
> The other use of that function has a "WARN_ONCE()" on it, so
> presumably it normally doesn't ever trigger either of the boolean
> conditions.

Yes, and that was why it used a "|".

Anyway, not worth arguing for or against; I'll just change it to logical OR.

Paolo

\
 
 \ /
  Last update: 2021-10-18 20:29    [W:0.051 / U:0.432 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site