From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754926AbbCFIjL (ORCPT ); Fri, 6 Mar 2015 03:39:11 -0500 Received: from terminus.zytor.com ([198.137.202.10]:59253 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753323AbbCFIjI (ORCPT ); Fri, 6 Mar 2015 03:39:08 -0500 Date: Fri, 6 Mar 2015 00:38:19 -0800 From: tip-bot for Andy Lutomirski Message-ID: Cc: hpa@zytor.com, dvlasenk@redhat.com, linux-kernel@vger.kernel.org, bp@alien8.de, mingo@kernel.org, oleg@redhat.com, luto@amacapital.net, torvalds@linux-foundation.org, tglx@linutronix.de Reply-To: tglx@linutronix.de, oleg@redhat.com, torvalds@linux-foundation.org, luto@amacapital.net, mingo@kernel.org, dvlasenk@redhat.com, hpa@zytor.com, bp@alien8.de, linux-kernel@vger.kernel.org In-Reply-To: <88ff9006163d296a0665338585c36d9bfb85235d.1425611534.git.luto@amacapital.net> References: <88ff9006163d296a0665338585c36d9bfb85235d.1425611534.git.luto@amacapital.net> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/asm] x86/asm/entry/64/compat: Change the 32-bit sysenter code to use sp0 Git-Commit-ID: 9d0c914c60f4d3123debb653340dc1f7cf44939d X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 9d0c914c60f4d3123debb653340dc1f7cf44939d Gitweb: http://git.kernel.org/tip/9d0c914c60f4d3123debb653340dc1f7cf44939d Author: Andy Lutomirski AuthorDate: Thu, 5 Mar 2015 19:19:04 -0800 Committer: Ingo Molnar CommitDate: Fri, 6 Mar 2015 08:32:58 +0100 x86/asm/entry/64/compat: Change the 32-bit sysenter code to use sp0 The ia32 sysenter code loaded the top of the kernel stack into rsp by loading kernel_stack and then adjusting it. It can be simplified to just read sp0 directly. This requires the addition of a new asm-offsets entry for sp0. Signed-off-by: Andy Lutomirski Cc: Borislav Petkov Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Oleg Nesterov Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/88ff9006163d296a0665338585c36d9bfb85235d.1425611534.git.luto@amacapital.net Signed-off-by: Ingo Molnar --- arch/x86/ia32/ia32entry.S | 3 +-- arch/x86/kernel/asm-offsets_64.c | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/ia32/ia32entry.S b/arch/x86/ia32/ia32entry.S index ed97463..719db63 100644 --- a/arch/x86/ia32/ia32entry.S +++ b/arch/x86/ia32/ia32entry.S @@ -113,8 +113,7 @@ ENTRY(ia32_sysenter_target) CFI_DEF_CFA rsp,0 CFI_REGISTER rsp,rbp SWAPGS_UNSAFE_STACK - movq PER_CPU_VAR(kernel_stack), %rsp - addq $(KERNEL_STACK_OFFSET),%rsp + movq PER_CPU_VAR(init_tss + TSS_sp0), %rsp /* * No need to follow this irqs on/off section: the syscall * disabled irqs, here we enable it straight after entry: diff --git a/arch/x86/kernel/asm-offsets_64.c b/arch/x86/kernel/asm-offsets_64.c index fdcbb4d..5ce6f2d 100644 --- a/arch/x86/kernel/asm-offsets_64.c +++ b/arch/x86/kernel/asm-offsets_64.c @@ -81,6 +81,7 @@ int main(void) #undef ENTRY OFFSET(TSS_ist, tss_struct, x86_tss.ist); + OFFSET(TSS_sp0, tss_struct, x86_tss.sp0); BLANK(); DEFINE(__NR_syscall_max, sizeof(syscalls_64) - 1);