Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754032AbdIFVjp (ORCPT ); Wed, 6 Sep 2017 17:39:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:50306 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753496AbdIFVhK (ORCPT ); Wed, 6 Sep 2017 17:37:10 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D309121AC3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=luto@kernel.org From: Andy Lutomirski To: x86@kernel.org Cc: linux-kernel@vger.kernel.org, Borislav Petkov , Brian Gerst , Andrew Cooper , Juergen Gross , Boris Ostrovsky , Kees Cook , Andy Lutomirski Subject: [RFC 07/17] x86/asm/64: Merge the fast and slow SYSRET paths Date: Wed, 6 Sep 2017 14:36:52 -0700 Message-Id: <043e94318b4fc3bccb41845a2b3500bb4c78a21a.1504733277.git.luto@kernel.org> X-Mailer: git-send-email 2.13.5 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 828 Lines: 31 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 45d4cb8fd81b..a9e318f7cc9b 100644 --- a/arch/x86/entry/entry_64.S +++ b/arch/x86/entry/entry_64.S @@ -216,9 +216,8 @@ 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 - USERGS_SYSRET64 + addq $6*8, %rsp + jmp .Lpop_c_regs_and_sysret 1: /* @@ -309,6 +308,7 @@ return_from_SYSCALL_64: syscall_return_via_sysret: /* rcx and r11 are already restored (see code above) */ POP_EXTRA_REGS +.Lpop_c_regs_and_sysret: popq %rsi /* skip r11 */ popq %r10 popq %r9 -- 2.13.5