Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1244981

Re: [PATCH v2 07/36] x86/entry/64/compat: After SYSENTER, move STI after the NT fixup

From Brian Gerst <brgerst@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2 07/36] x86/entry/64/compat: After SYSENTER, move STI after the NT fixup
Date 2015-10-12 20:20 +0200
Message-ID <qiPRv-6RC-5@gated-at.bofh.it> (permalink)
References <qgoC6-715-5@gated-at.bofh.it> <qgoC6-715-9@gated-at.bofh.it> <qh0R3-3eS-1@gated-at.bofh.it> <qhLPY-3oh-9@gated-at.bofh.it> <qiPou-64e-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, Oct 12, 2015 at 1:48 PM, Denys Vlasenko <dvlasenk@redhat.com> wrote:
> On 10/09/2015 09:48 PM, Andy Lutomirski wrote:
>> Anyway, it's still a win, but I'll keep playing.  There may be even
>> better ways to do this.
>
> Such as this?
> Drop OR, check for cleared IF here:
>
>         testl   $X86_EFLAGS_NT, EFLAGS(%rsp)
>         jnz     sysenter_fix_flags
>         testl   $X86_EFLAGS_IF, EFLAGS(%rsp)
>         jz      sysenter_fix_flags
> sysenter_flags_fixed:
>
> and make sysenter_fix_flags code set IF in addition to TF clearing.
> This way, we don't even have an unconditional RMW op.

IF should normally be set in userspace, but since SYSENTER doesn't
save the old flags and always clears IF when entering the kernel, the
flags pushed on the stack will always have IF clear.

--
Brian Gerst
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH v2 07/36] x86/entry/64/compat: After SYSENTER, move STI after the NT fixup Andy Lutomirski <luto@kernel.org> - 2015-10-06 02:50 +0200
  [tip:x86/asm] x86/entry/64/compat: After SYSENTER,   move STI after the NT fixup tip-bot for Andy Lutomirski <tipbot@zytor.com> - 2015-10-07 18:20 +0200
  Re: [PATCH v2 07/36] x86/entry/64/compat: After SYSENTER, move STI  after the NT fixup Denys Vlasenko <dvlasenk@redhat.com> - 2015-10-07 19:40 +0200
    Re: [PATCH v2 07/36] x86/entry/64/compat: After SYSENTER, move STI  after the NT fixup Andy Lutomirski <luto@amacapital.net> - 2015-10-07 21:10 +0200
    Re: [PATCH v2 07/36] x86/entry/64/compat: After SYSENTER, move STI  after the NT fixup Andy Lutomirski <luto@amacapital.net> - 2015-10-09 21:50 +0200
      Re: [PATCH v2 07/36] x86/entry/64/compat: After SYSENTER, move STI  after the NT fixup Denys Vlasenko <dvlasenk@redhat.com> - 2015-10-12 19:50 +0200
        Re: [PATCH v2 07/36] x86/entry/64/compat: After SYSENTER, move STI  after the NT fixup Brian Gerst <brgerst@gmail.com> - 2015-10-12 20:20 +0200

csiph-web