Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752033AbcCLRxT (ORCPT ); Sat, 12 Mar 2016 12:53:19 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59233 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751148AbcCLRxE (ORCPT ); Sat, 12 Mar 2016 12:53:04 -0500 Message-ID: <56E4577C.1030107@redhat.com> Date: Sat, 12 Mar 2016 18:53:00 +0100 From: Denys Vlasenko User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Ingo Molnar CC: Steven Rostedt , Borislav Petkov , "H. Peter Anvin" , Andy Lutomirski , Frederic Weisbecker , Will Drewry , Kees Cook , x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] x86/asm/entry/32: simplify pushes of zeroed pt_regs->REGs References: <1457715214-7432-1-git-send-email-dvlasenk@redhat.com> <20160312153808.GC17873@gmail.com> In-Reply-To: <20160312153808.GC17873@gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1097 Lines: 38 On 03/12/2016 04:38 PM, Ingo Molnar wrote: > > * Denys Vlasenko 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.