public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Josh Poimboeuf <jpoimboe@redhat.com>
To: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@kernel.org>, "H . Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org, linux-kernel@vger.kernel.org,
	Andy Lutomirski <luto@kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Brian Gerst <brgerst@gmail.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Nilay Vaish <nilayvaish@gmail.com>
Subject: [PATCH v2 0/9] x86/entry/head: standardize the end of the stack
Date: Wed, 21 Sep 2016 16:03:58 -0500	[thread overview]
Message-ID: <cover.1474480779.git.jpoimboe@redhat.com> (raw)

v2:
- keep 'restore_all' label in "x86/entry/head/32: use local labels"

---

Thanks to all the recent x86 entry code refactoring, most tasks' kernel
stacks start at the same offset right below their saved pt_regs,
regardless of which syscall was used to enter the kernel.  That creates
a nice convention which makes it straightforward to identify the end of
the stack, which can be useful [*] for the unwinder.

But there a few places where tasks don't yet follow the convention.
This patch set finishes the job.

[*] This will be useful for three upcoming proposed features:

- Detecting corrupt stacks in the unwinder (which will also be a force
  for ensuring this end of stack convention continues to be followed in
  the future).

- Printing all saved pt_regs on the stack during an oops/warning.

- Validating stacks in the livepatch consistency model.


Josh Poimboeuf (9):
  x86/entry/head/32: use local labels
  x86/entry/32: rename 'error_code' to 'common_exception'
  x86/entry/32: fix the end of the stack for newly forked tasks
  x86/head/32: fix the end of the stack for idle tasks
  x86/smp: fix initial idle stack location on 32-bit
  x86/asm/head: use a common function for starting CPUs
  x86/head: put real return address on idle task stack
  x86/head: fix the end of the stack for idle tasks
  x86: move _stext marker to before head code

 arch/x86/entry/entry_32.S     | 108 +++++++++++++++++++++++++-----------------
 arch/x86/kernel/head_32.S     |  49 +++++++++++--------
 arch/x86/kernel/head_64.S     |  42 ++++++++--------
 arch/x86/kernel/smpboot.c     |   4 +-
 arch/x86/kernel/vmlinux.lds.S |   2 +-
 5 files changed, 116 insertions(+), 89 deletions(-)

-- 
2.7.4

             reply	other threads:[~2016-09-21 21:04 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-21 21:03 Josh Poimboeuf [this message]
2016-09-21 21:03 ` [PATCH v2 1/9] x86/entry/head/32: use local labels Josh Poimboeuf
2016-10-20 11:08   ` [tip:x86/asm] x86/entry/32, x86/boot/32: Use " tip-bot for Josh Poimboeuf
2016-09-21 21:04 ` [PATCH v2 2/9] x86/entry/32: rename 'error_code' to 'common_exception' Josh Poimboeuf
2016-10-20 11:08   ` [tip:x86/asm] x86/entry/32: Rename " tip-bot for Josh Poimboeuf
2016-09-21 21:04 ` [PATCH v2 3/9] x86/entry/32: fix the end of the stack for newly forked tasks Josh Poimboeuf
2016-10-20 11:09   ` [tip:x86/asm] x86/entry/32: Fix " tip-bot for Josh Poimboeuf
2016-09-21 21:04 ` [PATCH v2 4/9] x86/head/32: fix the end of the stack for idle tasks Josh Poimboeuf
2016-10-20 11:10   ` [tip:x86/asm] x86/boot/32: Fix " tip-bot for Josh Poimboeuf
2016-09-21 21:04 ` [PATCH v2 5/9] x86/smp: fix initial idle stack location on 32-bit Josh Poimboeuf
2016-10-20 11:10   ` [tip:x86/asm] x86/boot/smp/32: Fix initial idle stack location on 32-bit kernels tip-bot for Josh Poimboeuf
2016-09-21 21:04 ` [PATCH v2 6/9] x86/asm/head: use a common function for starting CPUs Josh Poimboeuf
2016-10-20 11:11   ` [tip:x86/asm] x86/boot/64: Use " tip-bot for Josh Poimboeuf
2016-09-21 21:04 ` [PATCH v2 7/9] x86/head: put real return address on idle task stack Josh Poimboeuf
2016-10-20 11:11   ` [tip:x86/asm] x86/boot/64: Put a real return address on the " tip-bot for Josh Poimboeuf
2016-09-21 21:04 ` [PATCH v2 8/9] x86/head: fix the end of the stack for idle tasks Josh Poimboeuf
2016-10-20 11:12   ` [tip:x86/asm] x86/boot: Fix " tip-bot for Josh Poimboeuf
2016-09-21 21:04 ` [PATCH v2 9/9] x86: move _stext marker to before head code Josh Poimboeuf
2016-10-20 11:12   ` [tip:x86/asm] x86/boot: Move the _stext marker to before the boot code tip-bot for Josh Poimboeuf
2016-10-18 17:17 ` [PATCH v2 0/9] x86/entry/head: standardize the end of the stack Josh Poimboeuf
2016-10-19 13:20   ` Ingo Molnar

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=cover.1474480779.git.jpoimboe@redhat.com \
    --to=jpoimboe@redhat.com \
    --cc=brgerst@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@kernel.org \
    --cc=nilayvaish@gmail.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.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