From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932523AbdJ0ULY (ORCPT ); Fri, 27 Oct 2017 16:11:24 -0400 Received: from mx2.suse.de ([195.135.220.15]:56088 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932500AbdJ0ULW (ORCPT ); Fri, 27 Oct 2017 16:11:22 -0400 Date: Fri, 27 Oct 2017 22:11:25 +0200 From: Borislav Petkov To: Andy Lutomirski Cc: X86 ML , "linux-kernel@vger.kernel.org" , Brian Gerst , Dave Hansen , Linus Torvalds Subject: Re: [PATCH 07/18] x86/asm/64: Merge the fast and slow SYSRET paths Message-ID: <20171027201125.GD12039@nazgul.tnic> References: <998a8c2c39546115f93e4c6e2ad7f918626f6145.1509006199.git.luto@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <998a8c2c39546115f93e4c6e2ad7f918626f6145.1509006199.git.luto@kernel.org> User-Agent: Mutt/1.6.0 (2016-04-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 26, 2017 at 01:26:39AM -0700, Andy Lutomirski wrote: > They did almost the same thing. Remove a bunch of pointless > instructions (mostly hidden in macros) and reduce cognitive load by > merging them. > > Signed-off-by: Andy Lutomirski > --- > arch/x86/entry/entry_64.S | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S > index 9dafafa3e0ec..c855ee91a3a5 100644 > --- a/arch/x86/entry/entry_64.S > +++ b/arch/x86/entry/entry_64.S > @@ -220,10 +220,9 @@ entry_SYSCALL_64_fastpath: > TRACE_IRQS_ON /* user mode is traced as IRQs on */ > movq RIP(%rsp), %rcx > movq EFLAGS(%rsp), %r11 > - RESTORE_C_REGS_EXCEPT_RCX_R11 > - movq RSP(%rsp), %rsp > + addq $6*8, %rsp /* skip extra regs -- they were preserved */ > UNWIND_HINT_EMPTY > - USERGS_SYSRET64 > + jmp .Lpop_c_regs_except_rcx_r11_and_sysret > > 1: > /* > @@ -315,6 +314,7 @@ syscall_return_via_sysret: > /* rcx and r11 are already restored (see code above) */ > UNWIND_HINT_EMPTY > POP_EXTRA_REGS > +.Lpop_c_regs_except_rcx_r11_and_sysret: .Lpop_regs_sysret I guess. -- Regards/Gruss, Boris. SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg) --