Skip to content

Commit 6087c7f

Browse files
Jacob PanKAGA-KOKO
authored andcommitted
x86/irq: Factor out handler invocation from common_interrupt()
Prepare for calling external interrupt handlers directly from the posted MSI demultiplexing loop. Extract the common code from common_interrupt() to avoid code duplication. Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/r/20240423174114.526704-8-jacob.jun.pan@linux.intel.com
1 parent 43650dc commit 6087c7f

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

arch/x86/kernel/irq.c

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -242,18 +242,10 @@ static __always_inline void handle_irq(struct irq_desc *desc,
242242
__handle_irq(desc, regs);
243243
}
244244

245-
/*
246-
* common_interrupt() handles all normal device IRQ's (the special SMP
247-
* cross-CPU interrupts have their own entry points).
248-
*/
249-
DEFINE_IDTENTRY_IRQ(common_interrupt)
245+
static __always_inline void call_irq_handler(int vector, struct pt_regs *regs)
250246
{
251-
struct pt_regs *old_regs = set_irq_regs(regs);
252247
struct irq_desc *desc;
253248

254-
/* entry code tells RCU that we're not quiescent. Check it. */
255-
RCU_LOCKDEP_WARN(!rcu_is_watching(), "IRQ failed to wake up RCU");
256-
257249
desc = __this_cpu_read(vector_irq[vector]);
258250
if (likely(!IS_ERR_OR_NULL(desc))) {
259251
handle_irq(desc, regs);
@@ -268,7 +260,20 @@ DEFINE_IDTENTRY_IRQ(common_interrupt)
268260
__this_cpu_write(vector_irq[vector], VECTOR_UNUSED);
269261
}
270262
}
263+
}
264+
265+
/*
266+
* common_interrupt() handles all normal device IRQ's (the special SMP
267+
* cross-CPU interrupts have their own entry points).
268+
*/
269+
DEFINE_IDTENTRY_IRQ(common_interrupt)
270+
{
271+
struct pt_regs *old_regs = set_irq_regs(regs);
272+
273+
/* entry code tells RCU that we're not quiescent. Check it. */
274+
RCU_LOCKDEP_WARN(!rcu_is_watching(), "IRQ failed to wake up RCU");
271275

276+
call_irq_handler(vector, regs);
272277
set_irq_regs(old_regs);
273278
}
274279

0 commit comments

Comments
 (0)