Skip to content

x86/irq: trap and interrupt cleanups

H. Peter Anvin lkml 4 versions – Applied

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

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest8 patches 4 repliesApplied
  2. v2 posting 2/21 of 8 patches 0 repliesSuperseded
  3. v2 posting 1/28 of 9 patches 4 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v16 patches12 repliesSuperseded

Changes in v3 from the cover letter

* 5/8: Use an on-stack rather than a static variable.
* 7/8: Correct the sequence of needed changes in the patch description.

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/8x86/traps: add X86_NR_HW_TRAPS to <asm/trapnr.h>arch/x86/include/asm/trapnr.h+1 -03 replies
2/8x86/irqvector: add NR_EXTERNAL_VECTORS and NR_SYSTEM_VECTORSarch/x86/include/asm/idtentry.h arch/x86/include/asm/irq_vectors.h tools/arch/x86/include/asm/irq_vectors.h+8 -20 replies
3/8x86/irq: remove unused vectors from <asm/irq_vectors.h>arch/x86/include/asm/irq_vectors.h tools/arch/x86/include/asm/irq_vectors.h+4 -40 replies
4/8x86/idt: remove address argument to idt_invalidate()arch/x86/include/asm/desc.h arch/x86/kernel/idt.c arch/x86/kernel/machine_kexec_32.c +1 more+5 -60 replies
5/8x86/desc: add native_[ig]dt_invalidate() to <asm/desc.h>arch/x86/include/asm/desc.h+20 -00 replies
6/8x86/kexec: set_[gi]dt() -> native_[gi]dt_invalidate() in machine_kexec_*.carch/x86/kernel/machine_kexec_32.c arch/x86/kernel/machine_kexec_64.c+4 -440 replies
7/8x86/irq: WARN_ONCE() if irq_move_cleanup is called on a pending interruptarch/x86/kernel/apic/vector.c+5 -01 reply
8/8x86/irq: merge and functionalize common code in DECLARE/DEFINE_IDTENTRY_*arch/x86/entry/common.c arch/x86/include/asm/idtentry.h arch/x86/include/asm/irq_stack.h +4 more+117 -1420 replies

Reviews trailers per patch

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

PatchAndy LutomirskiSteve Wahl
1/8A-b
2/8A-b
3/8A-b
4/8
5/8
6/8
7/8
8/8

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/8] x86/irq: trap and interrupt cleanups

From: "H. Peter Anvin (Intel)" <[email protected]>

A collection of trap/interrupt-related patches, almost all cleanups. It does remove a modest amount of code (39 lines.) The only patches that should have any possible effect at all are:

7/8 - x86/irq: WARN_ONCE() if irq_move_cleanup is called on a pending interrupt

This condition is believed to be impossible after many improvements to the IRQ vector allocation code since this function was written. Per discussion with tglx, add a WARN_ONCE() if this happens as a first step towards excising this hack.

8/8 - x86/irq: merge and functonalize common code in DECLARE/DEFINE_IDTENTRY_*

This patch reverses kvm_set_cpu_l1tf_flush_l1d() and __irq_enter_raw() in DEFINE_IDTENTRY_SYSVEC_SIMPLE() in order to be able to unify the code with DEFINE_IDTENTRY_SYSVEC().

This replaces a lot of macros with inline functions, which required some amount of adjusting types in various places, they should have no effect.

The reason for unification is mainly to avoid the possibility of inadvertent divergence rather than the rather modest amount of code, but it does remove 25 lines of code.

Changes from v2:

* 5/8: Use an on-stack rather than a static variable.
* 7/8: Correct the sequence of needed changes in the patch description.

---
1/8 x86/traps: add X86_NR_HW_TRAPS to <asm/trapnr.h>
2/8 x86/irqvector: add NR_EXTERNAL_VECTORS and NR_SYSTEM_VECTORS 3/8 x86/irq: remove unused vectors from <asm/irq_vectors.h>
4/8 x86/idt: remove address argument to idt_invalidate()
5/8 x86/desc: add native_[ig]dt_invalidate() to <asm/desc.h>
6/8 x86/kexec: set_[gi]dt() -> native_[gi]dt_invalidate() in machine_kexec_*.c 7/8 x86/irq: WARN_ONCE() if irq_move_cleanup is called on a pending interrupt 8/8 x86/irq: merge and functionalize common code in DECLARE/DEFINE_IDTENTRY_*

 arch/x86/entry/common.c                  |   5 +-
 arch/x86/include/asm/desc.h              |  17 ++-
 arch/x86/include/asm/idtentry.h          | 174 +++++++++++++++----------------
 arch/x86/include/asm/irq_stack.h         |  73 +++++--------
 arch/x86/include/asm/irq_vectors.h       |   7 +-
 arch/x86/include/asm/trapnr.h            |   1 +
 arch/x86/kernel/apic/apic.c              |   2 +-
 arch/x86/kernel/apic/vector.c            |   5 +
 arch/x86/kernel/idt.c                    |   5 +-
 arch/x86/kernel/irq.c                    |   1 +
 arch/x86/kernel/machine_kexec_32.c       |  15 +--
 arch/x86/kernel/machine_kexec_64.c       |  33 +-----
 arch/x86/kernel/reboot.c                 |   2 +-
 arch/x86/kernel/sev-es.c                 |   6 +-
 arch/x86/kernel/traps.c                  |   2 +-
 tools/arch/x86/include/asm/irq_vectors.h |   7 +-
 16 files changed, 158 insertions(+), 197 deletions(-)
 arch/x86/entry/common.c                  |   5 +-
 arch/x86/include/asm/desc.h              |  22 +++-
 arch/x86/include/asm/idtentry.h          | 174 +++++++++++++++----------------
 arch/x86/include/asm/irq_stack.h         |  73 +++++--------
 arch/x86/include/asm/irq_vectors.h       |   7 +-
 arch/x86/include/asm/trapnr.h            |   1 +
 arch/x86/kernel/apic/apic.c              |   2 +-
 arch/x86/kernel/apic/vector.c            |   5 +
 arch/x86/kernel/idt.c                    |   5 +-
 arch/x86/kernel/irq.c                    |   1 +
 arch/x86/kernel/machine_kexec_32.c       |  15 +--
 arch/x86/kernel/machine_kexec_64.c       |  33 +-----
 arch/x86/kernel/reboot.c                 |   2 +-
 arch/x86/kernel/sev-es.c                 |   6 +-
 arch/x86/kernel/traps.c                  |   2 +-
 tools/arch/x86/include/asm/irq_vectors.h |   7 +-
 16 files changed, 163 insertions(+), 197 deletions(-)