From: tip-bot for Andy Lutomirski <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
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
Subject: [tip:x86/asm] x86/asm/entry/64/compat: Change the 32-bit sysenter code to use sp0
Date: Fri, 6 Mar 2015 00:38:19 -0800 [thread overview]
Message-ID: <tip-9d0c914c60f4d3123debb653340dc1f7cf44939d@git.kernel.org> (raw)
In-Reply-To: <88ff9006163d296a0665338585c36d9bfb85235d.1425611534.git.luto@amacapital.net>
Commit-ID: 9d0c914c60f4d3123debb653340dc1f7cf44939d
Gitweb: http://git.kernel.org/tip/9d0c914c60f4d3123debb653340dc1f7cf44939d
Author: Andy Lutomirski <luto@amacapital.net>
AuthorDate: Thu, 5 Mar 2015 19:19:04 -0800
Committer: Ingo Molnar <mingo@kernel.org>
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 <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/88ff9006163d296a0665338585c36d9bfb85235d.1425611534.git.luto@amacapital.net
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
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);
next prev parent reply other threads:[~2015-03-06 8:39 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-06 3:19 [PATCH v2 0/6] Baby steps toward cleaning up KERNEL_STACK_OFFSET Andy Lutomirski
2015-03-06 3:19 ` [PATCH v2 1/6] x86: Add this_cpu_sp0() to read sp0 for the current cpu Andy Lutomirski
2015-03-06 8:37 ` [tip:x86/asm] x86/asm/entry: " tip-bot for Andy Lutomirski
2015-03-06 3:19 ` [PATCH v2 2/6] x86: Switch all C consumers of kernel_stack to this_cpu_sp0 Andy Lutomirski
2015-03-06 8:38 ` [tip:x86/asm] x86/asm/entry: Switch all C consumers of kernel_stack to this_cpu_sp0() tip-bot for Andy Lutomirski
2015-03-06 3:19 ` [PATCH v2 3/6] x86, asm: Change the 32-bit sysenter code to use sp0 Andy Lutomirski
2015-03-06 8:38 ` tip-bot for Andy Lutomirski [this message]
2015-03-06 3:19 ` [PATCH v2 4/6] x86: Rename init_tss to cpu_tss Andy Lutomirski
2015-03-06 8:38 ` [tip:x86/asm] x86/asm/entry: Rename 'init_tss' to 'cpu_tss' tip-bot for Andy Lutomirski
2015-03-06 3:19 ` [PATCH v2 5/6] x86: Remove INIT_TSS and fold the definitions into cpu_tss Andy Lutomirski
2015-03-06 8:39 ` [tip:x86/asm] x86/asm/entry: Remove INIT_TSS and fold the definitions into 'cpu_tss' tip-bot for Andy Lutomirski
2015-03-06 3:19 ` [PATCH v2 6/6] x86, asm: Rename INIT_TSS_IST to TSS_IST Andy Lutomirski
2015-03-06 7:30 ` Ingo Molnar
2015-03-06 8:39 ` [tip:x86/asm] x86/asm/entry: Rename 'INIT_TSS_IST' to ' CPU_TSS_IST' tip-bot for Andy Lutomirski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-9d0c914c60f4d3123debb653340dc1f7cf44939d@git.kernel.org \
--to=tipbot@zytor.com \
--cc=bp@alien8.de \
--cc=dvlasenk@redhat.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=mingo@kernel.org \
--cc=oleg@redhat.com \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox