Skip to content

x86/entry: Entry/exception code rework, simple exceptions

Thomas Gleixner lkml stable 1 version Applied

Status from this message: The following commit has been merged into the core/rcu branch of tip:

Get series with b4
b4 am [email protected]

Versions newest first

  1. v4 Latest29 patches 63 repliesApplied

Patches in v4 Applied

#Subject and filesSizeRepliesApplied
1/29x86/traps: Mark fixup_bad_iret() noinstrarch/x86/kernel/traps.c+9 -75 replies
2/29x86/traps: Mark sync_regs() noinstrarch/x86/kernel/traps.c+1 -22 replies
3/29x86/entry: Disable interrupts for native_load_gs_index() in C codearch/x86/entry/entry_64.S arch/x86/include/asm/special_insns.h+19 -141 reply
4/29x86/traps: Make interrupt enable/disable symmetric in C codearch/x86/kernel/traps.c arch/x86/mm/fault.c+32 -113 replies
5/29x86/traps: Split trap numbers out in a seperate headerarch/x86/include/asm/trapnr.h arch/x86/include/asm/traps.h+32 -251 reply
6/29x86/entry/64: Reorder idtentriesarch/x86/entry/entry_64.S+17 -190 replies
7/29x86/entry: Distangle idtentryarch/x86/entry/entry_64.S+219 -1821 reply
8/29x86/entry/64: Provide sane error entry/exitarch/x86/entry/entry_64.S+19 -33 replies
9/29x86/entry/32: Provide macro to emit IDT entry stubsarch/x86/entry/entry_32.S+68 -06 replies
10/29x86/idtentry: Provide macros to define/declare IDT entry pointsarch/x86/entry/entry_32.S arch/x86/entry/entry_64.S arch/x86/include/asm/idtentry.h +1 more+80 -12 replies
11/29rcu: Provide rcu_irq_exit_preempt()include/linux/rcutiny.h include/linux/rcutree.h kernel/rcu/tree.c+23 -08 replies
12/29x86/entry/common: Provide idtentry_enter/exit()arch/x86/entry/common.c arch/x86/include/asm/idtentry.h+92 -08 replies
13/29x86/traps: Prepare for using DEFINE_IDTENTRYarch/x86/kernel/traps.c+5 -04 replies
14/29x86/entry: Convert Divide Error to IDTENTRYarch/x86/entry/entry_32.S arch/x86/entry/entry_64.S arch/x86/include/asm/idtentry.h +5 more+26 -155 replies
15/29x86/entry: Convert Overflow exception to IDTENTRYarch/x86/entry/entry_32.S arch/x86/entry/entry_64.S arch/x86/include/asm/idtentry.h +5 more+9 -151 reply
16/29x86/entry: Convert Bounds exception to IDTENTRYarch/x86/entry/entry_32.S arch/x86/entry/entry_64.S arch/x86/include/asm/idtentry.h +5 more+8 -191 reply
17/29x86/entry: Convert Invalid Opcode exception to IDTENTRYarch/x86/entry/entry_32.S arch/x86/entry/entry_64.S arch/x86/include/asm/idtentry.h +6 more+25 -163 replies
18/29x86/entry: Convert Device not available exception to IDTENTRYarch/x86/entry/entry_32.S arch/x86/entry/entry_64.S arch/x86/include/asm/idtentry.h +5 more+6 -201 reply
19/29x86/entry: Convert Coprocessor segment overrun exception to IDTENTRYarch/x86/entry/entry_32.S arch/x86/entry/entry_64.S arch/x86/include/asm/idtentry.h +5 more+10 -151 reply
20/29x86/entry: Provide IDTENTRY_ERRORCODEarch/x86/include/asm/idtentry.h+46 -01 reply
21/29x86/entry: Convert Invalid TSS exception to IDTENTRYarch/x86/entry/entry_32.S arch/x86/entry/entry_64.S arch/x86/include/asm/idtentry.h +5 more+12 -141 reply
22/29x86/entry: Convert Segment not present exception to IDTENTRYarch/x86/entry/entry_32.S arch/x86/entry/entry_64.S arch/x86/include/asm/idtentry.h +5 more+10 -141 reply
23/29x86/entry: Convert Stack segment exception to IDTENTRYarch/x86/entry/entry_32.S arch/x86/entry/entry_64.S arch/x86/include/asm/idtentry.h +5 more+8 -211 reply
24/29x86/entry: Convert General protection exception to IDTENTRYarch/x86/entry/entry_32.S arch/x86/entry/entry_64.S arch/x86/include/asm/idtentry.h +5 more+9 -201 reply
25/29x86/entry: Convert Spurious interrupt bug exception to IDTENTRYarch/x86/entry/entry_32.S arch/x86/entry/entry_64.S arch/x86/include/asm/idtentry.h +5 more+5 -161 reply
26/29x86/entry: Convert Coprocessor error exception to IDTENTRYarch/x86/entry/entry_32.S arch/x86/entry/entry_64.S arch/x86/include/asm/idtentry.h +5 more+6 -171 reply
27/29x86/entry: Convert Alignment check exception to IDTENTRYarch/x86/entry/entry_32.S arch/x86/entry/entry_64.S arch/x86/include/asm/idtentry.h +5 more+5 -161 reply
28/29x86/entry: Convert SIMD coprocessor error exception to IDTENTRYarch/x86/entry/entry_32.S arch/x86/entry/entry_64.S arch/x86/include/asm/idtentry.h +5 more+21 -331 reply
29/29x86/entry/32: Convert IRET exception to IDTENTRY_SWarch/x86/entry/entry_32.S arch/x86/include/asm/idtentry.h arch/x86/include/asm/traps.h +2 more+21 -163 replies

Reviews trailers per patch

All 29 patches have a Reviewed-by or Acked-by.

PatchPeter ZijlstraAlexandre ChartreAndy LutomirskiPaul E. McKenneyMasami Hiramatsu
1/29A-b R-b
2/29A-b R-b
3/29A-b
4/29Originally-by A-b
5/29R-b R-b
6/29R-b A-b
7/29R-b A-b
8/29A-b
9/29R-b A-b
10/29R-b A-b
11/29R-b
12/29A-b R-b A-b
13/29R-b
14/29R-b A-b
15/29A-b
16/29A-b
17/29A-b
18/29A-b
19/29A-b
20/29A-b
21/29A-b
22/29A-b
23/29A-b
24/29A-b
25/29A-b
26/29A-b
27/29A-b
28/29A-b
29/29R-b A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 5 reviewers.

Read the v4 thread

Cover letter [patch V4 part 3 00/29] x86/entry: Entry/exception code rework, simple exceptions

Folks,

This is the third part of the rework series. Part 2 can be found here:

https://lore.kernel.org/r/[email protected]

The series has a total of 138 patches and is split into 5 parts. The base for this 3rd series is:

git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git entry-v4-part-2

The full series with all parts applied is available here:

git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git entry-v4-part-5

The third part, i.e. this series is available from:

git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git entry-v4-part-3

This part contains the modifications for the simple exceptions and traps:

- Preparatory changes and simplifications moving especially tracing affected code out of ASM

- Distangle the unreadable idtentry maze on 64bit

- Provide C entry/exit functions which handle the transitions vs. RCU, context tracking and instrumentation.

- Provide a set of macros to define and declare exception and trap handlers

The macros generate:
- The prototypes for the relevant C, ASM and XEN/PV functions
- C wrappers for the actual handler code which contain all the necessary entry handling
- Automatic emission of the low level ASM entry code

- Converting the trivial exceptions over to the new scheme

The objtool check for the noinstr.text correctness is not yet added to the build machinery and has to be invoked manually for now:

objtool check -fal vmlinux.o

The checking only works for builtin code as objtool cannot do a combined analysis of vmlinux.o and a module.o

Thanks,

tglx

8<----------

 arch/x86/entry/common.c              |   90 +++++++
 arch/x86/entry/entry_32.S            |  188 ++++++---------
 arch/x86/entry/entry_64.S            |  436 +++++++++++++++++++----------------
 arch/x86/include/asm/idtentry.h      |  153 ++++++++++++
 arch/x86/include/asm/special_insns.h |   14 -
 arch/x86/include/asm/trapnr.h        |   31 ++
 arch/x86/include/asm/traps.h         |   76 ------
 arch/x86/kernel/idt.c                |   28 +-
 arch/x86/kernel/traps.c              |  184 +++++++++-----
 arch/x86/mm/fault.c                  |   17 +
 arch/x86/xen/enlighten_pv.c          |   33 +-
 arch/x86/xen/xen-asm_32.S            |    2 
 arch/x86/xen/xen-asm_64.S            |   28 +-
 include/linux/rcutiny.h              |    1 
 include/linux/rcutree.h              |    1 
 kernel/rcu/tree.c                    |   21 +
 16 files changed, 808 insertions(+), 495 deletions(-)