Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

authored by

Jacob Pan and committed by
Thomas Gleixner
6087c7f3 43650dcf

+14 -9
+14 -9
arch/x86/kernel/irq.c
··· 242 242 __handle_irq(desc, regs); 243 243 } 244 244 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) 250 246 { 251 - struct pt_regs *old_regs = set_irq_regs(regs); 252 247 struct irq_desc *desc; 253 - 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 248 257 249 desc = __this_cpu_read(vector_irq[vector]); 258 250 if (likely(!IS_ERR_OR_NULL(desc))) { ··· 260 268 __this_cpu_write(vector_irq[vector], VECTOR_UNUSED); 261 269 } 262 270 } 271 + } 263 272 273 + /* 274 + * common_interrupt() handles all normal device IRQ's (the special SMP 275 + * cross-CPU interrupts have their own entry points). 276 + */ 277 + DEFINE_IDTENTRY_IRQ(common_interrupt) 278 + { 279 + struct pt_regs *old_regs = set_irq_regs(regs); 280 + 281 + /* entry code tells RCU that we're not quiescent. Check it. */ 282 + RCU_LOCKDEP_WARN(!rcu_is_watching(), "IRQ failed to wake up RCU"); 283 + 284 + call_irq_handler(vector, regs); 264 285 set_irq_regs(old_regs); 265 286 } 266 287