All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch V2 00/44] x86: Cleanup IDT code
@ 2017-08-25 21:46 Thomas Gleixner
  2017-08-25 21:46 ` [patch V2 01/44] x86/irq: Remove vector_used_by_percpu_irq() Thomas Gleixner
                   ` (43 more replies)
  0 siblings, 44 replies; 51+ messages in thread
From: Thomas Gleixner @ 2017-08-25 21:46 UTC (permalink / raw)
  To: LKML
  Cc: Ingo Molnar, Peter Anvin, Peter Zijlstra, Andy Lutomirski,
	Borislav Petkov, Steven Rostedt

The IDT code in x86 is a convoluted mess and contains quite some
bogosities.

One of the main offenders is the extra tracing IDT which has been
introduced to reduce the impact of tracing on the exception vectors when
tracepoints are disabled.

This results in an unholy macro mess which magically creates IDT entries by
prepending the exception handler name by trace_.

For most exceptions the tracepoint overhead in the disabled case is two
NOP5, which are negligible compared to the heavy work of the exception
handler itself. Modern CPUs are pretty good in optimizing NOPs.

The only two handlers where the overhead matters are the pagefault handler
and the reschedule IPI, where an active tracepoint introduces more extra
work. These two can be handled with separate static keys which reduces the
impact to a minimum.

As a result the whole tracing IDT machinery can be removed.

The second part of the series cleans up the handling of IDT/GDT/LDT/TSS
descriptors to get rid of macro based initialization via the obscure raw
32bit union fields a and b.

The last part moves the setup of the IDT into a separate file, where all
gate related code is moved to. The gate setup is converted to a table based
mechanism so the resulting code is smaller and better understandable.

The series applies on top of

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

and is available as a git branch from

 git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git WIP.x86/apic

There is more cleanup to come in the near future, which aims at replacing
the braindamaged vector assignment mechanics, which has quite some
shortcomings.

Changes since V1:

 - Reordered patch series to maintain bisectability

 - Addressed the review comments

 - Addressed the fallout reported by kbuild robot

 - Picked up acks and reviewed by tags

Thanks,

	tglx
---
 arch/x86/boot/compressed/eboot.c         |    8 
 arch/x86/entry/entry_32.S                |   20 -
 arch/x86/entry/entry_64.S                |   26 --
 arch/x86/entry/vdso/vma.c                |    2 
 arch/x86/include/asm/desc.h              |  248 +++------------------
 arch/x86/include/asm/desc_defs.h         |  122 +++++-----
 arch/x86/include/asm/entry_arch.h        |   17 -
 arch/x86/include/asm/hw_irq.h            |   20 -
 arch/x86/include/asm/irq.h               |    4 
 arch/x86/include/asm/irq_work.h          |    8 
 arch/x86/include/asm/segment.h           |    4 
 arch/x86/include/asm/trace/common.h      |   16 +
 arch/x86/include/asm/trace/exceptions.h  |    8 
 arch/x86/include/asm/trace/irq_vectors.h |   51 +++-
 arch/x86/include/asm/traps.h             |   10 
 arch/x86/include/asm/xen/hypercall.h     |    6 
 arch/x86/kernel/Makefile                 |    3 
 arch/x86/kernel/apic/apic.c              |   70 +----
 arch/x86/kernel/apic/vector.c            |    2 
 arch/x86/kernel/cpu/common.c             |    9 
 arch/x86/kernel/cpu/mcheck/mce_amd.c     |   16 -
 arch/x86/kernel/cpu/mcheck/therm_throt.c |   20 -
 arch/x86/kernel/cpu/mcheck/threshold.c   |   16 -
 arch/x86/kernel/cpu/mshyperv.c           |    9 
 arch/x86/kernel/eisa.c                   |   18 +
 arch/x86/kernel/head32.c                 |    4 
 arch/x86/kernel/head64.c                 |    6 
 arch/x86/kernel/head_32.S                |   42 ---
 arch/x86/kernel/idt.c                    |  365 +++++++++++++++++++++++++++++++
 arch/x86/kernel/irq.c                    |   40 +--
 arch/x86/kernel/irq_work.c               |   20 -
 arch/x86/kernel/irqinit.c                |  102 --------
 arch/x86/kernel/kvm.c                    |    4 
 arch/x86/kernel/machine_kexec_32.c       |   14 -
 arch/x86/kernel/reboot.c                 |    4 
 arch/x86/kernel/setup.c                  |    4 
 arch/x86/kernel/setup_percpu.c           |    9 
 arch/x86/kernel/smp.c                    |   81 +-----
 arch/x86/kernel/tls.c                    |    2 
 arch/x86/kernel/tracepoint.c             |   57 +---
 arch/x86/kernel/traps.c                  |  108 ---------
 arch/x86/kvm/vmx.c                       |    2 
 arch/x86/math-emu/fpu_entry.c            |   11 
 arch/x86/math-emu/fpu_system.h           |   48 +++-
 arch/x86/math-emu/get_address.c          |   17 -
 arch/x86/mm/fault.c                      |   49 +---
 arch/x86/xen/enlighten_pv.c              |   14 -
 drivers/xen/events/events_base.c         |    6 
 48 files changed, 759 insertions(+), 983 deletions(-)

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

end of thread, other threads:[~2017-08-26 15:09 UTC | newest]

Thread overview: 51+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-25 21:46 [patch V2 00/44] x86: Cleanup IDT code Thomas Gleixner
2017-08-25 21:46 ` [patch V2 01/44] x86/irq: Remove vector_used_by_percpu_irq() Thomas Gleixner
2017-08-25 21:46 ` [patch V2 02/44] x86/irq: Unexport used_vectors Thomas Gleixner
2017-08-25 21:46 ` [patch V2 03/44] x86/irq: Get rid of the first_system_vector bogisity Thomas Gleixner
2017-08-25 21:46 ` [patch V2 04/44] x86/irq: Remove duplicated used_vectors definition Thomas Gleixner
2017-08-25 21:46 ` [patch V2 05/44] x86/boot: Move EISA setup to a proper place Thomas Gleixner
2017-08-25 21:46 ` [patch V2 06/44] x86/tracing: Introduce a static key for exception tracing Thomas Gleixner
2017-08-25 21:46 ` [patch V2 07/44] x86/traps: Simplify pagefault tracing logic Thomas Gleixner
2017-08-25 21:46 ` [patch V2 08/44] x86/apic: Remove the duplicated tracing version of local_timer_interrupt Thomas Gleixner
2017-08-25 21:46 ` [patch V2 09/44] x86/apic: Use this_cpu_ptr in local_timer_interrupt Thomas Gleixner
2017-08-25 21:46 ` [patch V2 10/44] x86/irq: Get rid of duplicated trace_x86_platform_ipi() code Thomas Gleixner
2017-08-25 21:46 ` [patch V2 11/44] x86/apic: Remove the duplicated tracing versions of interrupts Thomas Gleixner
2017-08-25 21:47 ` [patch V2 12/44] x86/irqwork: Get rid of duplicated tracing interrupt code Thomas Gleixner
2017-08-25 21:47 ` [patch V2 13/44] x86/mce: Remove " Thomas Gleixner
2017-08-25 21:47 ` [patch V2 14/44] x86/smp: Remove pointless duplicated " Thomas Gleixner
2017-08-25 21:47 ` [patch V2 15/44] x86/smp: Use static key for reschedule interrupt tracing Thomas Gleixner
2017-08-25 21:47 ` [patch V2 16/44] x86/idt: Remove tracing idt completely Thomas Gleixner
2017-08-25 21:47 ` [patch V2 17/44] x86/idt: Cleanup the i386 low level entry macros Thomas Gleixner
2017-08-25 21:47 ` [patch V2 18/44] x86/tracing: Disentangle pagefault and resched IPI tracing key Thomas Gleixner
2017-08-25 21:47 ` [patch V2 19/44] x86/ipi: Make platform IPI depend on APIC Thomas Gleixner
2017-08-25 21:47 ` [patch V2 20/44] x86/irq_work: Make it " Thomas Gleixner
2017-08-25 21:47 ` [patch V2 21/44] x86/tracing: Build tracepoints only when they are used Thomas Gleixner
2017-08-25 21:47 ` [patch V2 22/44] x86/idt: Unify gate_struct handling for 32/64bit Thomas Gleixner
2017-08-25 21:47 ` [patch V2 23/44] x86/percpu: Use static initializer for GDT entry Thomas Gleixner
2017-08-25 21:47 ` [patch V2 24/44] x86/fpu: Use bitfield accessors for desc_struct Thomas Gleixner
2017-08-25 21:47 ` [patch V2 25/44] x86: Replace access to desc_struct:a/b fields Thomas Gleixner
2017-08-26  2:16   ` Boris Ostrovsky
2017-08-25 21:47 ` [patch V2 26/44] x86/gdt: Use bitfields for initialization Thomas Gleixner
2017-08-25 21:47 ` [patch V2 27/44] x86/ldttss: Cleanup 32bit descriptors Thomas Gleixner
2017-08-25 21:47 ` [patch V2 28/44] x86/idt: Create file for IDT related code Thomas Gleixner
2017-08-25 21:47 ` [patch V2 29/44] x86/idt: Move 32bit idt_descr to C code Thomas Gleixner
2017-08-25 21:47 ` [patch V2 30/44] x86/idt: Remove unused set_trap_gate() Thomas Gleixner
2017-08-25 21:47 ` [patch V2 31/44] x86/idt: Consolidate IDT invalidation Thomas Gleixner
2017-08-25 21:47 ` [patch V2 32/44] x86/idt: Move early IDT handler setup to IDT code Thomas Gleixner
2017-08-25 21:47 ` [patch V2 33/44] x86/idt: Move early IDT setup out of 32bit asm Thomas Gleixner
2017-08-25 21:47 ` [patch V2 34/44] x86/idt: Prepare for table based init Thomas Gleixner
2017-08-25 21:47 ` [patch V2 35/44] x86/idt: Switch early trap init to IDT tables Thomas Gleixner
2017-08-26  2:24   ` Boris Ostrovsky
2017-08-26  8:16     ` Thomas Gleixner
2017-08-26 10:59       ` Juergen Gross
2017-08-26 13:05         ` Thomas Gleixner
2017-08-26 15:07           ` Boris Ostrovsky
2017-08-25 21:47 ` [patch V2 36/44] x86/idt: Move debug stack init to table based Thomas Gleixner
2017-08-25 21:47 ` [patch V2 37/44] x86/idt: Move ist stack based traps to table init Thomas Gleixner
2017-08-25 21:47 ` [patch V2 38/44] x86/idt: Move regular trap init to tables Thomas Gleixner
2017-08-25 21:47 ` [patch V2 39/44] x86/idt: Move APIC gate initialization " Thomas Gleixner
2017-08-25 21:47 ` [patch V2 40/44] x86/idt: Move interrupt gate initialization to IDT code Thomas Gleixner
2017-08-25 21:47 ` [patch V2 41/44] x86/idt: Remove unused functions/inlines Thomas Gleixner
2017-08-25 21:47 ` [patch V2 42/44] x86/idt: Deinline setup functions Thomas Gleixner
2017-08-25 21:47 ` [patch V2 43/44] x86/idt: Simplify alloc_intr_gate Thomas Gleixner
2017-08-25 21:47 ` [patch V2 44/44] x86/idt: Hide set_intr_gate() 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.