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


Groups > linux.kernel > #1356504

Re: [PATCH] x86/asm/entry/32: simplify pushes of zeroed pt_regs->REGs

From Andy Lutomirski <luto@amacapital.net>
Newsgroups linux.kernel
Subject Re: [PATCH] x86/asm/entry/32: simplify pushes of zeroed pt_regs->REGs
Date 2016-03-12 19:10 +0100
Message-ID <rbW9d-1Em-29@gated-at.bofh.it> (permalink)
References <rbyzU-GR-9@gated-at.bofh.it> <rbTO1-8fT-1@gated-at.bofh.it> <rbVZw-1kN-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sat, Mar 12, 2016 at 9:53 AM, Denys Vlasenko <dvlasenk@redhat.com> wrote:
> On 03/12/2016 04:38 PM, Ingo Molnar wrote:
>>
>> * Denys Vlasenko <dvlasenk@redhat.com> wrote:
>>
>>> Use of a temporary R8 register here seems to be unnecessary.
>>>
>>> "push %r8" is a two-byte insn (it needs REX prefix to specify R8),
>>> "push $0" is two-byte too. It seems just using the latter would be
>>> no worse.
>>>
>>> Thus, code had an unnecessary "xorq %r8,%r8" insn.
>>
>> Neat!
>>
>>> It probably costs nothing in execution time here since we are probably
>>> limited by store bandwidth at this point, but still.
>>>
>>> Run-tested under QEMU: 32-bit calls still work:
>>>
>>> / # ./test_syscall_vdso32
>>
>> Did you manage to test all 3 compat variants:
>>
>>> @@ -72,24 +72,23 @@ ENTRY(entry_SYSENTER_compat)
>>> @@ -205,17 +204,16 @@ ENTRY(entry_SYSCALL_compat)
>>> @@ -316,11 +314,10 @@ ENTRY(entry_INT80_compat)
>
> Yes.
>
> test_syscall_vdso32 checks vdso syscall (if available)
> and direct int80 syscall.
> Booting two times, with different qemu flags:
>
>         qemu-system-x86_64 -cpu Opteron_G4
>         qemu-system-x86_64 -cpu SandyBridge
>
> makes kernel choose either SYSCALL or SYSENTER vdso.
> So it's all covered.

How carefully did you check the latter bit?  In my experience, if KVM
is used, your cpu will report as your native CPU's manufacturer
regardless of who actually makes the emulated CPU.  -machine accel=tcg
turns that off.

-- 
Andy Lutomirski
AMA Capital Management, LLC

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


Thread

[PATCH] x86/asm/entry/32: simplify pushes of zeroed pt_regs->REGs Denys Vlasenko <dvlasenk@redhat.com> - 2016-03-11 18:00 +0100
  Re: [PATCH] x86/asm/entry/32: simplify pushes of zeroed pt_regs->REGs Ingo Molnar <mingo@kernel.org> - 2016-03-12 16:40 +0100
    Re: [PATCH] x86/asm/entry/32: simplify pushes of zeroed pt_regs->REGs Denys Vlasenko <dvlasenk@redhat.com> - 2016-03-12 19:00 +0100
      Re: [PATCH] x86/asm/entry/32: simplify pushes of zeroed pt_regs->REGs Andy Lutomirski <luto@amacapital.net> - 2016-03-12 19:10 +0100
        Re: [PATCH] x86/asm/entry/32: simplify pushes of zeroed pt_regs->REGs Denys Vlasenko <dvlasenk@redhat.com> - 2016-03-12 22:50 +0100
  Re: [PATCH] x86/asm/entry/32: simplify pushes of zeroed pt_regs->REGs Ingo Molnar <mingo@kernel.org> - 2016-03-12 16:50 +0100

csiph-web