Skip to content

Pile o' entry/exit/sp0 changes

Andy Lutomirski lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest20 patches 5 repliesIn review
  2. v118 patches 38 repliesSuperseded

Changes in v2 from the cover letter

- Comment improvements.
- Lots of Reviewed-bys added.
- Fix vm86 bug.
- Completely remove RESTORE_..._REGS_... (Linus) -- adds two patches.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/20x86/asm/64: Remove the restore_c_regs_and_iret labelarch/x86/entry/entry_64.S+2 -30 replies
2/20x86/asm/64: Split the iret-to-user and iret-to-kernel pathsarch/x86/entry/entry_64.S arch/x86/entry/entry_64_compat.S arch/x86/kernel/head_64.S+27 -112 replies
3/20x86/asm/64: Move SWAPGS into the common iret-to-usermode patharch/x86/entry/entry_64.S arch/x86/entry/entry_64_compat.S+15 -200 replies
4/20x86/asm/64: Simplify reg restore code in the standard IRET pathsarch/x86/entry/calling.h arch/x86/entry/entry_64.S+27 -60 replies
5/20x86/asm/64: Shrink paranoid_exit_restore and make labels localarch/x86/entry/entry_64.S+5 -80 replies
6/20x86/asm/64: Use pop instead of movq in syscall_return_via_sysretarch/x86/entry/entry_64.S+11 -30 replies
7/20x86/asm/64: Merge the fast and slow SYSRET pathsarch/x86/entry/entry_64.S+3 -30 replies
8/20x86/entry/64: Use POP instead of MOV to restore regs on NMI returnarch/x86/entry/entry_64.S+7 -40 replies
9/20x86/entry/64: Remove the RESTORE_..._REGS infrastructurearch/x86/entry/calling.h+0 -520 replies
10/20xen: add xen nmi trap entryarch/x86/entry/entry_64.S arch/x86/include/asm/traps.h arch/x86/xen/enlighten_pv.c +1 more+4 -40 replies
11/20x86/asm/64: De-Xen-ify our NMI codearch/x86/entry/entry_64.S+18 -120 replies
12/20x86/asm/32: Pull MSR_IA32_SYSENTER_CS update code out of native_load_sp0()arch/x86/include/asm/processor.h arch/x86/include/asm/switch_to.h arch/x86/kernel/process_32.c +2 more+21 -100 replies
13/20x86/asm/64: Pass sp0 directly to load_sp0()arch/x86/include/asm/paravirt.h arch/x86/include/asm/paravirt_types.h arch/x86/include/asm/processor.h +5 more+20 -253 replies
14/20x86/asm: Add task_top_of_stack() to find the top of a task's stackarch/x86/include/asm/processor.h+2 -00 replies
15/20x86/xen/64: Clean up SP code in cpu_initialize_context()arch/x86/xen/smp_pv.c+14 -31 reply
16/20x86/boot/64: Stop initializing TSS.sp0 at bootarch/x86/kernel/cpu/common.c arch/x86/kernel/process.c+17 -30 replies
17/20x86/asm/64: Remove all remaining direct thread_struct::sp0 readsarch/x86/include/asm/switch_to.h arch/x86/kernel/process_32.c arch/x86/kernel/process_64.c +1 more+10 -40 replies
18/20x86/boot/32: Fix cpu_current_top_of_stack initialization at bootarch/x86/kernel/smpboot.c+1 -20 replies
19/20x86/asm/64: Remove thread_struct::sp0arch/x86/include/asm/compat.h arch/x86/include/asm/processor.h arch/x86/include/asm/switch_to.h +1 more+16 -200 replies
20/20x86/traps: Use a new on_thread_stack() helper to clean up an assertionarch/x86/include/asm/processor.h arch/x86/kernel/traps.c+7 -20 replies

Reviews trailers per patch

8 of 20 patches have a Reviewed-by or Acked-by.

PatchBorislav PetkovJuergen Gross
1/20R-b
2/20
3/20
4/20
5/20
6/20R-b
7/20
8/20
9/20
10/20
11/20R-b A-b
12/20
13/20R-b
14/20
15/20R-b
16/20
17/20R-b
18/20R-b
19/20
20/20R-b

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 00/20] Pile o' entry/exit/sp0 changes

Hi all-

Here we go again! I haven't done most of the requested label renaming, nor have I done Brian's reordering of the SYSCALL return code, mainly because I want to keep the ball rolling. As for label renaming, I'd rather let everyone finish arguing and then rename any labels at the end. I personally don't mind longish asm labels.

Changes from v1:
- Comment improvements.
- Lots of Reviewed-bys added.
- Fix vm86 bug.
- Completely remove RESTORE_..._REGS_... (Linus) -- adds two patches.

Changes from the old RFC version:
- Rebase
- Add Juergen's patch
- Add some assertions
- Cleanups

Andy Lutomirski (19):
x86/asm/64: Remove the restore_c_regs_and_iret label x86/asm/64: Split the iret-to-user and iret-to-kernel paths x86/asm/64: Move SWAPGS into the common iret-to-usermode path x86/asm/64: Simplify reg restore code in the standard IRET paths x86/asm/64: Shrink paranoid_exit_restore and make labels local x86/asm/64: Use pop instead of movq in syscall_return_via_sysret x86/asm/64: Merge the fast and slow SYSRET paths x86/entry/64: Use POP instead of MOV to restore regs on NMI return x86/entry/64: Remove the RESTORE_..._REGS infrastructure x86/asm/64: De-Xen-ify our NMI code
x86/asm/32: Pull MSR_IA32_SYSENTER_CS update code out of

    native_load_sp0()

x86/asm/64: Pass sp0 directly to load_sp0()
x86/asm: Add task_top_of_stack() to find the top of a task's stack x86/xen/64: Clean up SP code in cpu_initialize_context() x86/boot/64: Stop initializing TSS.sp0 at boot
x86/asm/64: Remove all remaining direct thread_struct::sp0 reads x86/boot/32: Fix cpu_current_top_of_stack initialization at boot x86/asm/64: Remove thread_struct::sp0
x86/traps: Use a new on_thread_stack() helper to clean up an assertion

Juergen Gross (1):
xen: add xen nmi trap entry

 arch/x86/entry/calling.h              |  69 +++++------------
 arch/x86/entry/entry_64.S             | 139 ++++++++++++++++++++--------------
 arch/x86/entry/entry_64_compat.S      |   3 +-
 arch/x86/include/asm/compat.h         |   1 +
 arch/x86/include/asm/paravirt.h       |   5 +-
 arch/x86/include/asm/paravirt_types.h |   2 +-
 arch/x86/include/asm/processor.h      |  52 +++++--------
 arch/x86/include/asm/switch_to.h      |  24 ++++++
 arch/x86/include/asm/traps.h          |   2 +-
 arch/x86/kernel/cpu/common.c          |  12 ++-
 arch/x86/kernel/head_64.S             |   2 +-
 arch/x86/kernel/process.c             |   8 +-
 arch/x86/kernel/process_32.c          |   6 +-
 arch/x86/kernel/process_64.c          |   5 +-
 arch/x86/kernel/smpboot.c             |   3 +-
 arch/x86/kernel/traps.c               |   3 +-
 arch/x86/kernel/vm86_32.c             |  20 ++---
 arch/x86/xen/enlighten_pv.c           |   9 +--
 arch/x86/xen/smp_pv.c                 |  17 ++++-
 arch/x86/xen/xen-asm_64.S             |   2 +-
 20 files changed, 208 insertions(+), 176 deletions(-)
Signature · 1 line
2.13.6