Skip to content

x86/entry/head: standardize the end of the stack

Josh Poimboeuf lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest9 patches 2 repliesIn review
  2. v19 patches 7 repliesSuperseded

Changes in v2 from the cover letter

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

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9x86/entry/head/32: use local labelsarch/x86/entry/entry_32.S arch/x86/kernel/head_32.S+38 -370 replies
2/9x86/entry/32: rename 'error_code' to 'common_exception'arch/x86/entry/entry_32.S+23 -200 replies
3/9x86/entry/32: fix the end of the stack for newly forked tasksarch/x86/entry/entry_32.S+19 -30 replies
4/9x86/head/32: fix the end of the stack for idle tasksarch/x86/kernel/head_32.S+5 -30 replies
5/9x86/smp: fix initial idle stack location on 32-bitarch/x86/kernel/smpboot.c+1 -30 replies
6/9x86/asm/head: use a common function for starting CPUsarch/x86/kernel/head_64.S+11 -110 replies
7/9x86/head: put real return address on idle task stackarch/x86/kernel/head_64.S+3 -20 replies
8/9x86/head: fix the end of the stack for idle tasksarch/x86/kernel/head_32.S arch/x86/kernel/head_64.S+15 -90 replies
9/9x86: move _stext marker to before head codearch/x86/kernel/vmlinux.lds.S+1 -10 replies

Reviews trailers per patch

2 of 9 patches have a Reviewed-by or Acked-by.

PatchAndy Lutomirski
1/9
2/9
3/9
4/9
5/9R-b
6/9
7/9R-b
8/9
9/9

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/9] x86/entry/head: standardize the end of the stack

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(-)
Signature · 1 line
2.7.4