mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andy Lutomirski <luto@kernel.org>
To: Ingo Molnar <mingo@kernel.org>, X86 ML <x86@kernel.org>,
	Denys Vlasenko <dvlasenk@redhat.com>
Cc: linux-kernel@vger.kernel.org, Andy Lutomirski <luto@amacapital.net>
Subject: [PATCH 1/2] x86_32, asm: Improve a TOP_OF_KERNEL_STACK_PADDING comment and long asm line
Date: Thu,  2 Apr 2015 12:41:44 -0700	[thread overview]
Message-ID: <41fee7bb8490ae840fe7ef2699f9c2feb932e729.1428002830.git.luto@kernel.org> (raw)
In-Reply-To: <cover.1428002830.git.luto@kernel.org>
In-Reply-To: <cover.1428002830.git.luto@kernel.org>

From: Andy Lutomirski <luto@amacapital.net>

At Denys' request, clean up the comment describing stack padding in
the 32-bit sysenter path.  This also fixes a long line of asm.  No
code changes.

Signed-off-by: Andy Lutomirski <luto@amacapital.net>
---
 arch/x86/kernel/entry_32.S | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S
index 4c8cc34e6d68..438d19389f67 100644
--- a/arch/x86/kernel/entry_32.S
+++ b/arch/x86/kernel/entry_32.S
@@ -395,10 +395,14 @@ sysenter_past_esp:
 	/*CFI_REL_OFFSET cs, 0*/
 	/*
 	 * Push current_thread_info()->sysenter_return to the stack.
-	 * A tiny bit of offset fixup is necessary - 4*4 means the 4 words
-	 * pushed above; +8 corresponds to copy_thread's esp0 setting.
+	 * A tiny bit of offset fixup is necessary: TI_sysenter_return
+	 * is relative to thread_info, which is at the bottom of the
+	 * kernel stack page.  4*4 means the 4 words pushed above;
+	 * TOP_OF_KERNEL_STACK_PADDING takes us to the top of the stack;
+	 * and THREAD_SIZE takes us to the bottom.
 	 */
-	pushl_cfi ((TI_sysenter_return)-THREAD_SIZE+TOP_OF_KERNEL_STACK_PADDING+4*4)(%esp)
+	pushl_cfi ((TI_sysenter_return) - THREAD_SIZE + \
+	           TOP_OF_KERNEL_STACK_PADDING + 4*4)(%esp)
 	CFI_REL_OFFSET eip, 0
 
 	pushl_cfi %eax
-- 
2.3.0


  reply	other threads:[~2015-04-02 19:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-02 19:41 [PATCH 0/2] x86_32, asm: Minor stack/tss cleanups Andy Lutomirski
2015-04-02 19:41 ` Andy Lutomirski [this message]
2015-04-03  8:21   ` [tip:x86/asm] x86/asm/entry/32: Improve a TOP_OF_KERNEL_STACK_PADDING comment tip-bot for Andy Lutomirski
2015-04-02 19:41 ` [PATCH 2/2] x86_32: Stop caching MSR_IA32_SYSENTER_ESP in tss.sp1 Andy Lutomirski
2015-04-03  8:21   ` [tip:x86/asm] x86/asm/entry/32: " 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=41fee7bb8490ae840fe7ef2699f9c2feb932e729.1428002830.git.luto@kernel.org \
    --to=luto@kernel.org \
    --cc=dvlasenk@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=mingo@kernel.org \
    --cc=x86@kernel.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

all inboxes | Powered by JetHome®