All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch V3 00/23] x86/entry: Consolidation part II (syscalls)
@ 2020-03-20 17:59 ` Thomas Gleixner
  0 siblings, 0 replies; 67+ messages in thread
From: Thomas Gleixner @ 2020-03-20 17:59 UTC (permalink / raw)
  To: LKML
  Cc: x86, Paul McKenney, Josh Poimboeuf, Joel Fernandes (Google),
	Steven Rostedt (VMware),
	Masami Hiramatsu, Alexei Starovoitov, Frederic Weisbecker,
	Mathieu Desnoyers, Brian Gerst, Juergen Gross, Alexandre Chartre,
	Peter Zijlstra, Tom Lendacky, Paolo Bonzini, kvm

Hi!

This is the third version of the syscall entry code consolidation
series. V2 can be found here:

  https://lore.kernel.org/r/20200308222359.370649591@linutronix.de

It applies on top of

  git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/entry

and is also available from git:

    git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel entry-v3-part2

The changes vs. V2:

 - A massive rework utilizing Peter Zijlstras objtool patches to analyze
   the new .noinstr.text section:

   https://lore.kernel.org/r/20200317170234.897520633@infradead.org

   Working with this was really helpful as it clearly pin pointed code
   which calls out of the protected section which is much more efficient
   and focussed than chasing everything manually.

 - Picked up the two RCU patches from Paul for completeness. The bugfix
   is required anyway and the comments have been really helpful to see
   where the defense line has to be.

 - As the tool flagged KVM as red zone, I looked at the context tracking
   usage there and it has similar if not worse issues. New set of patches
   dealing with that.

Please have a close look at the approach and the resulting protected areas.

Known issues:

  - The kprobes '.noinstr.text' exclusion currently works only for built
    in code. Haven't figured out how to to fix that, but I'm sure that
    Masami knows :)

  - The various SANitizers if enabled ruin the picture. Peter and I still
    have no brilliant idea what to do about that.

Thanks,

	tglx
---
 arch/x86/entry/common.c                |  173 ++++++++++++++++++++++++---------
 arch/x86/entry/entry_32.S              |   24 ----
 arch/x86/entry/entry_64.S              |    6 -
 arch/x86/entry/entry_64_compat.S       |   32 ------
 arch/x86/entry/thunk_64.S              |   45 +++++++-
 arch/x86/include/asm/bug.h             |    3 
 arch/x86/include/asm/hardirq.h         |    4 
 arch/x86/include/asm/irqflags.h        |    3 
 arch/x86/include/asm/nospec-branch.h   |    4 
 arch/x86/include/asm/paravirt.h        |    3 
 arch/x86/kvm/svm.c                     |  152 ++++++++++++++++++----------
 arch/x86/kvm/vmx/ops.h                 |    4 
 arch/x86/kvm/vmx/vmenter.S             |    2 
 arch/x86/kvm/vmx/vmx.c                 |   78 +++++++++++---
 arch/x86/kvm/x86.c                     |    4 
 b/include/asm-generic/bug.h            |    9 +
 include/asm-generic/sections.h         |    3 
 include/asm-generic/vmlinux.lds.h      |    4 
 include/linux/compiler.h               |   24 ++++
 include/linux/compiler_types.h         |    4 
 include/linux/context_tracking.h       |   27 +++--
 include/linux/context_tracking_state.h |    6 -
 include/linux/irqflags.h               |    6 +
 include/linux/sched.h                  |    1 
 kernel/context_tracking.c              |   14 +-
 kernel/kprobes.c                       |   11 ++
 kernel/locking/lockdep.c               |   66 +++++++++---
 kernel/panic.c                         |    4 
 kernel/rcu/tree.c                      |   91 +++++++++++------
 kernel/rcu/tree_plugin.h               |    4 
 kernel/rcu/update.c                    |    7 -
 kernel/trace/trace_preemptirq.c        |   25 ++++
 lib/debug_locks.c                      |    2 
 lib/smp_processor_id.c                 |   10 -
 scripts/mod/modpost.c                  |    2 
 35 files changed, 590 insertions(+), 267 deletions(-)



^ permalink raw reply	[flat|nested] 67+ messages in thread

end of thread, other threads:[~2020-04-03  8:31 UTC | newest]

Thread overview: 67+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-20 17:59 [patch V3 00/23] x86/entry: Consolidation part II (syscalls) Thomas Gleixner
2020-03-20 17:59 ` [RESEND][patch " Thomas Gleixner
2020-03-20 17:59 ` [patch V3 01/23] rcu: Dont acquire lock in NMI handler in rcu_nmi_enter_common() Thomas Gleixner
2020-03-20 17:59   ` [RESEND][patch " Thomas Gleixner
2020-03-24 15:37   ` [patch " Frederic Weisbecker
2020-03-20 17:59 ` [patch V3 02/23] rcu: Add comments marking transitions between RCU watching and not Thomas Gleixner
2020-03-20 17:59   ` [RESEND][patch " Thomas Gleixner
2020-03-24 15:38   ` [patch " Frederic Weisbecker
2020-03-20 17:59 ` [patch V3 03/23] vmlinux.lds.h: Create section for protection against instrumentation Thomas Gleixner
2020-03-20 17:59   ` [RESEND][patch " Thomas Gleixner
2020-03-24 12:26   ` Borislav Petkov
2020-04-03  8:08   ` Alexandre Chartre
2020-03-20 18:00 ` [patch V3 04/23] kprobes: Prevent probes in .noinstr.text section Thomas Gleixner
2020-03-20 18:00   ` [RESEND][patch " Thomas Gleixner
2020-03-23 14:00   ` [patch " Masami Hiramatsu
2020-03-23 16:03     ` Thomas Gleixner
2020-03-24  5:49       ` Masami Hiramatsu
2020-03-24  9:47         ` Thomas Gleixner
2020-03-25 13:39           ` Masami Hiramatsu
2020-03-20 18:00 ` [patch V3 05/23] tracing: Provide lockdep less trace_hardirqs_on/off() variants Thomas Gleixner
2020-03-20 18:00   ` [RESEND][patch " Thomas Gleixner
2020-04-03  8:34   ` Alexandre Chartre
2020-03-20 18:00 ` [patch V3 06/23] bug: Annotate WARN/BUG/stackfail as noinstr safe Thomas Gleixner
2020-03-20 18:00   ` [RESEND][patch " Thomas Gleixner
2020-04-02 21:01   ` Josh Poimboeuf
2020-04-02 21:34     ` Peter Zijlstra
2020-04-02 21:43       ` Josh Poimboeuf
2020-04-02 21:49     ` Thomas Gleixner
2020-03-20 18:00 ` [patch V3 07/23] lockdep: Prepare for noinstr sections Thomas Gleixner
2020-03-20 18:00   ` [RESEND][patch " Thomas Gleixner
2020-03-20 18:00 ` [patch V3 08/23] x86/entry: Mark enter_from_user_mode() noinstr Thomas Gleixner
2020-03-20 18:00   ` [RESEND][patch " Thomas Gleixner
2020-03-20 18:00 ` [patch V3 09/23] x86/entry/common: Protect against instrumentation Thomas Gleixner
2020-03-20 18:00   ` [RESEND][patch " Thomas Gleixner
2020-03-20 18:00 ` [patch V3 10/23] x86/entry: Move irq tracing on syscall entry to C-code Thomas Gleixner
2020-03-20 18:00   ` [RESEND][patch " Thomas Gleixner
2020-03-20 18:00 ` [patch V3 11/23] x86/entry: Move irq flags tracing to prepare_exit_to_usermode() Thomas Gleixner
2020-03-20 18:00   ` [RESEND][patch " Thomas Gleixner
2020-03-20 18:00 ` [patch V3 12/23] context_tracking: Ensure that the critical path cannot be instrumented Thomas Gleixner
2020-03-20 18:00   ` [RESEND][patch " Thomas Gleixner
2020-03-20 18:00 ` [patch V3 13/23] lib/smp_processor_id: Move it into noinstr section Thomas Gleixner
2020-03-20 18:00   ` [RESEND][patch " Thomas Gleixner
2020-03-20 18:00 ` [patch V3 14/23] x86/speculation/mds: Mark mds_user_clear_cpu_buffers() __always_inline Thomas Gleixner
2020-03-20 18:00   ` [RESEND][patch " Thomas Gleixner
2020-03-20 18:00 ` [patch V3 15/23] x86/entry/64: Check IF in __preempt_enable_notrace() thunk Thomas Gleixner
2020-03-20 18:00   ` [RESEND][patch " Thomas Gleixner
2020-03-20 18:00 ` [patch V3 16/23] x86/entry/64: Mark ___preempt_schedule_notrace() thunk noinstr Thomas Gleixner
2020-03-20 18:00   ` [RESEND][patch " Thomas Gleixner
2020-03-20 18:00 ` [patch V3 17/23] rcu/tree: Mark the idle relevant functions noinstr Thomas Gleixner
2020-03-20 18:00   ` [RESEND][patch " Thomas Gleixner
2020-03-24 16:09   ` Paul E. McKenney
2020-03-24 19:28     ` Thomas Gleixner
2020-03-24 19:58       ` Paul E. McKenney
2020-03-20 18:00 ` [patch V3 18/23] x86/kvm: Move context tracking where it belongs Thomas Gleixner
2020-03-20 18:00   ` [RESEND][patch " Thomas Gleixner
2020-03-20 18:00 ` [patch V3 19/23] x86/kvm/vmx: Add hardirq tracing to guest enter/exit Thomas Gleixner
2020-03-20 18:00   ` [RESEND][patch " Thomas Gleixner
2020-03-24 23:03   ` Peter Zijlstra
2020-03-24 23:21     ` Thomas Gleixner
2020-03-20 18:00 ` [patch V3 20/23] x86/kvm/svm: Handle hardirqs proper on " Thomas Gleixner
2020-03-20 18:00   ` [RESEND][patch " Thomas Gleixner
2020-03-20 18:00 ` [patch V3 21/23] context_tracking: Make guest_enter/exit_irqoff() .noinstr ready Thomas Gleixner
2020-03-20 18:00   ` [RESEND][patch " Thomas Gleixner
2020-03-20 18:00 ` [patch V3 22/23] x86/kvm/vmx: Move guest enter/exit into .noinstr.text Thomas Gleixner
2020-03-20 18:00   ` [RESEND][patch " Thomas Gleixner
2020-03-20 18:00 ` [patch V3 23/23] x86/kvm/svm: " Thomas Gleixner
2020-03-20 18:00   ` [RESEND][patch " Thomas Gleixner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.