lkml.org 
[lkml]   [2015]   [Mar]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] x86: entry_32.S: change ESPFIX test to not touch PT_OLDSS(%esp)
From
On Mon, Mar 9, 2015 at 7:05 AM, Denys Vlasenko <dvlasenk@redhat.com> wrote:
> New:
> 1e6: 0f ba 64 24 38 11 btl $0x11,0x38(%esp)

btl? Really?

Why isn't that just

testb $2,0x3a(%esp)

which is both smaller and quite a bit faster on older machines.

Sure, the btl is easier to explain in the source code, but instead of this:

> + btl $X86_EFLAGS_VM_BIT,PT_EFLAGS(%esp)

you'd have to add a comment, like

testb $2, PT_EFLAGS+2(%esp) # X86_EFLAGS_VM_BIT

or something.

Or just at least *partially* do what we used to do, and make it all be

movb PT_EFLAGS+2(%esp),%al
andb $2,%al
orb PT_CS(%esp),%al
testb $3,%al
je restore_nocheck
testb $SEGMENT_TI_MASK,PT_OLDSS(%esp)
jne ldt_ss

which still avoids looking at SS unless needed, and is smaller and
faster than the btl, afaik.

Linus


\
 
 \ /
  Last update: 2015-03-09 17:21    [W:0.118 / U:0.684 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site