]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
x86/irq: Move IS_ERR_OR_NULL() check into common do_IRQ() code
authorHeiner Kallweit <hkallweit1@gmail.com>
Mon, 19 Aug 2019 19:36:09 +0000 (21:36 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Mon, 19 Aug 2019 21:19:06 +0000 (23:19 +0200)
Both the 64bit and the 32bit handle_irq() implementation check the irq
descriptor pointer with IS_ERR_OR_NULL() and return failure. That can be
done simpler in the common do_IRQ() code.

This reduces the 64bit handle_irq() function to a wrapper around
generic_handle_irq_desc(). Invoke it directly from do_IRQ() to spare the
extra function call.

[ tglx: Got rid of the #ifdef and massaged changelog ]

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/2ec758c7-9aaa-73ab-f083-cc44c86aa741@gmail.com
arch/x86/include/asm/irq.h
arch/x86/kernel/irq.c
arch/x86/kernel/irq_32.c
arch/x86/kernel/irq_64.c

index 8f95686ec27e09662c1be58e2b6cb0d5aa79c67f..a176f6165d85b12e8d52e83eef6402c7148885b9 100644 (file)
@@ -34,7 +34,7 @@ extern __visible void smp_kvm_posted_intr_nested_ipi(struct pt_regs *regs);
 extern void (*x86_platform_ipi_callback)(void);
 extern void native_init_IRQ(void);
 
-extern bool handle_irq(struct irq_desc *desc, struct pt_regs *regs);
+extern void handle_irq(struct irq_desc *desc, struct pt_regs *regs);
 
 extern __visible unsigned int do_IRQ(struct pt_regs *regs);
 
index 4215653f8a8e8223c16cf2cb49a0686799d9a4de..3eae01202332a4e03be09bc6633a8962bc3bcb24 100644 (file)
@@ -243,8 +243,12 @@ __visible unsigned int __irq_entry do_IRQ(struct pt_regs *regs)
        RCU_LOCKDEP_WARN(!rcu_is_watching(), "IRQ failed to wake up RCU");
 
        desc = __this_cpu_read(vector_irq[vector]);
-
-       if (!handle_irq(desc, regs)) {
+       if (likely(!IS_ERR_OR_NULL(desc))) {
+               if (IS_ENABLED(CONFIG_X86_32))
+                       handle_irq(desc, regs);
+               else
+                       generic_handle_irq_desc(desc);
+       } else {
                ack_APIC_irq();
 
                if (desc != VECTOR_RETRIGGERED && desc != VECTOR_SHUTDOWN) {
index fc34816c6f044923ffdc82c0800f6efa68982e9a..a759ca97cd01cb5f9d3603987ce8676c2edb18e7 100644 (file)
@@ -148,18 +148,13 @@ void do_softirq_own_stack(void)
        call_on_stack(__do_softirq, isp);
 }
 
-bool handle_irq(struct irq_desc *desc, struct pt_regs *regs)
+void handle_irq(struct irq_desc *desc, struct pt_regs *regs)
 {
        int overflow = check_stack_overflow();
 
-       if (IS_ERR_OR_NULL(desc))
-               return false;
-
        if (user_mode(regs) || !execute_on_irq_stack(overflow, desc)) {
                if (unlikely(overflow))
                        print_stack_overflow();
                generic_handle_irq_desc(desc);
        }
-
-       return true;
 }
index 6bf6517a05bba3dafbcab3ad0499843d04e05be0..12df3a4abfdd84f54aa611a72489b0dcf3bb19fd 100644 (file)
 DEFINE_PER_CPU_PAGE_ALIGNED(struct irq_stack, irq_stack_backing_store) __visible;
 DECLARE_INIT_PER_CPU(irq_stack_backing_store);
 
-bool handle_irq(struct irq_desc *desc, struct pt_regs *regs)
-{
-       if (IS_ERR_OR_NULL(desc))
-               return false;
-
-       generic_handle_irq_desc(desc);
-       return true;
-}
-
 #ifdef CONFIG_VMAP_STACK
 /*
  * VMAP the backing store with guard pages