Skip to content

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

Thomas Gleixner lkml 1 version Applied

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

Get series with b4
b4 am [email protected]

Versions newest first

  1. v4 Latest24 patches 45 repliesApplied

Patches in v4 Applied

#Subject and filesSizeRepliesApplied
1/24x86/int3: Ensure that poke_int3_handler() is not tracedarch/x86/include/asm/ptrace.h arch/x86/include/asm/text-patching.h arch/x86/kernel/alternative.c+14 -121 reply
2/24x86/int3: Avoid atomic instrumentationarch/x86/kernel/alternative.c+3 -39 replies
3/24lib/bsearch: Provide __always_inline variantinclude/linux/bsearch.h lib/bsearch.c+26 -221 reply
4/24x86/int3: Inline bsearch()arch/x86/kernel/alternative.c arch/x86/kernel/traps.c+9 -41 reply
5/24x86/entry: Provide IDTENTRY_RAWarch/x86/include/asm/idtentry.h+31 -01 reply
6/24x86/entry: Convert INT3 exception to IDTENTRY_RAWarch/x86/entry/entry_32.S arch/x86/entry/entry_64.S arch/x86/include/asm/idtentry.h +5 more+23 -261 reply
7/24x86/traps: Split int3 handler uparch/x86/kernel/traps.c+39 -282 replies
8/24x86/entry: Provide IDTENTRY_ISTarch/x86/include/asm/idtentry.h+54 -02 replies
9/24x86/mce: Move nmi_enter/exit() into the entry pointarch/x86/kernel/cpu/mce/core.c arch/x86/kernel/cpu/mce/p5.c arch/x86/kernel/cpu/mce/winchip.c+13 -211 reply
10/24x86/entry: Convert Machine Check to IDTENTRY_ISTarch/x86/entry/entry_32.S arch/x86/entry/entry_64.S arch/x86/include/asm/idtentry.h +11 more+32 -421 reply
11/24x86/mce: Use untraced rd/wrmsr in the MCE offline/crash checkarch/x86/kernel/cpu/mce/core.c+2 -21 reply
12/24x86/idtentry: Provide IDTENTRY_XEN for XEN/PVarch/x86/include/asm/idtentry.h+16 -01 reply
13/24x86/entry: Convert NMI to IDTENTRY_NMIarch/x86/entry/entry_32.S arch/x86/entry/entry_64.S arch/x86/include/asm/idtentry.h +5 more+25 -221 reply
14/24x86/nmi: Protect NMI entry against instrumentationarch/x86/include/asm/desc.h arch/x86/kernel/cpu/common.c arch/x86/kernel/nmi.c+12 -121 reply
15/24x86/db: Split out dr6/7 handlingarch/x86/kernel/hw_breakpoint.c arch/x86/kernel/traps.c+44 -2410 replies
16/24x86/entry: Convert Debug exception to IDTENTRY_DBarch/x86/entry/entry_32.S arch/x86/entry/entry_64.S arch/x86/include/asm/idtentry.h +5 more+24 -301 reply
17/24x86/entry/64: Remove error code clearing from #DB and #MCE ASM stubarch/x86/entry/entry_64.S+0 -11 reply
18/24x86/entry: Provide IDTRENTRY_NOIST variants for #DB and #MCarch/x86/include/asm/idtentry.h+17 -21 reply
19/24x86/entry: Implement user mode C entry points for #DB and #MCEarch/x86/entry/entry_64.S arch/x86/kernel/cpu/mce/core.c arch/x86/kernel/traps.c+88 -241 reply
20/24x86/traps: Restructure #DB handlingarch/x86/kernel/traps.c+35 -341 reply
21/24x86/traps: Address objtool noinstr complaints in #DBarch/x86/kernel/traps.c+10 -41 reply
22/24x86/mce: Address objtools noinstr complaintsarch/x86/kernel/cpu/mce/core.c arch/x86/kernel/cpu/mce/p5.c arch/x86/kernel/cpu/mce/winchip.c +1 more+22 -81 reply
23/24x86/entry: Provide IDTENTRY_DFarch/x86/include/asm/idtentry.h+99 -02 replies
24/24x86/entry: Convert double fault exception to IDTENTRY_DFarch/x86/entry/entry_32.S arch/x86/entry/entry_64.S arch/x86/include/asm/idtentry.h +6 more+31 -322 replies

Reviews trailers per patch

23 of 24 patches have a Reviewed-by or Acked-by.

PatchAlexandre ChartreMasami HiramatsuAndy Lutomirski
1/24A-b
2/24R-b A-b
3/24A-b
4/24A-b
5/24A-b
6/24A-b
7/24
8/24A-b
9/24A-b
10/24A-b
11/24A-b
12/24A-b
13/24A-b
14/24A-b
15/24A-b
16/24A-b
17/24A-b
18/24A-b
19/24A-b
20/24A-b
21/24A-b
22/24A-b
23/24A-b
24/24R-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 3 reviewers.

Read the v4 thread

Cover letter [patch V4 part 4 00/24] x86/entry: Entry/exception code rework, nasty exceptions

Folks,

This is the forth part of the rework series. Part 3 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 4th series is:

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

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 forth part, i.e. this series is available from:

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

This part contains the modifications for complex and nasty exceptions and traps:

- Conversion of int3 including a full isolation of the text poke handler so it is fully self contained, i.e does not call out into any instrumentable code.

- Conversion of NMI handling including protection against instrumentation

- Conversion of #DB with separation of the user and kernel mode entries

- Conversion of #MC and #DF

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/entry_32.S            |   38 ----
 arch/x86/entry/entry_64.S            |   35 +---
 arch/x86/include/asm/desc.h          |    8 
 arch/x86/include/asm/idtentry.h      |  235 +++++++++++++++++++++++++++++
 arch/x86/include/asm/mce.h           |    2 
 arch/x86/include/asm/ptrace.h        |    2 
 arch/x86/include/asm/text-patching.h |   11 -
 arch/x86/include/asm/traps.h         |   23 --
 arch/x86/kernel/alternative.c        |   25 +--
 arch/x86/kernel/cpu/common.c         |    6 
 arch/x86/kernel/cpu/mce/core.c       |   91 ++++++++---
 arch/x86/kernel/cpu/mce/inject.c     |    4 
 arch/x86/kernel/cpu/mce/internal.h   |    2 
 arch/x86/kernel/cpu/mce/p5.c         |    8 
 arch/x86/kernel/cpu/mce/winchip.c    |    8 
 arch/x86/kernel/doublefault_32.c     |   10 -
 arch/x86/kernel/hw_breakpoint.c      |    6 
 arch/x86/kernel/idt.c                |   22 +-
 arch/x86/kernel/nmi.c                |   14 -
 arch/x86/kernel/traps.c              |  283 ++++++++++++++++++++++++-----------
 arch/x86/kvm/vmx/vmx.c               |    2 
 arch/x86/xen/enlighten_pv.c          |   17 +-
 arch/x86/xen/xen-asm_64.S            |   12 -
 include/linux/bsearch.h              |   26 ++-
 kernel/time/timekeeping.c            |    2 
 lib/bsearch.c                        |   22 --
 26 files changed, 615 insertions(+), 299 deletions(-)