lkml.org 
[lkml]   [2015]   [Feb]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/4] x86: entry.S: tidy up several suboptimal insns
On 02/24/2015 12:36 PM, Borislav Petkov wrote:
> On Tue, Feb 24, 2015 at 09:13:03PM +0100, Denys Vlasenko wrote:
>> They aren't equal. $1 and $2 in two lowest bits will also
>> be interpreted as "userspace" here. "Equal to $3" sends
>> a wrong message here to a human reading the code,
>> the code doesn't test for CPL=3, it tests for any nonzero CPL.
>
> Doh, of course.
>
> I was going to propose to make it even more explicit:
>
> andb $3, CS(%rsp)...
>
> but that's destructive.
>
> So yours makes it less misleading, actually. To me at least and
> obviously.
>

Yes, please use JZ/JNZ with TEST.

-hpa




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