Messages in this thread | | | Date | Mon, 9 Mar 2015 09:08:11 -0700 | Subject | Re: [PATCH] x86: entry_32.S: change ESPFIX test to not touch PT_OLDSS(%esp) | From | Linus Torvalds <> |
| |
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
| |