xen/events: only register debug interrupt for 2-level events
authorJuergen Gross <jgross@suse.com>
Thu, 22 Oct 2020 09:49:05 +0000 (11:49 +0200)
committerBoris Ostrovsky <boris.ostrovsky@oracle.com>
Fri, 23 Oct 2020 10:41:25 +0000 (05:41 -0500)
xen_debug_interrupt() is specific to 2-level event handling. So don't
register it with fifo event handling being active.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Link: https://lore.kernel.org/r/20201022094907.28560-4-jgross@suse.com
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
arch/x86/xen/smp.c
arch/x86/xen/xen-ops.h
drivers/xen/events/events_base.c

index 2097fa0ebdb59bf6a9e42f352751e0f4dd7fd558..c1b2f764b29a2f442f9d1d857c350d47396114d5 100644 (file)
@@ -88,14 +88,17 @@ int xen_smp_intr_init(unsigned int cpu)
        per_cpu(xen_callfunc_irq, cpu).irq = rc;
        per_cpu(xen_callfunc_irq, cpu).name = callfunc_name;
 
-       debug_name = kasprintf(GFP_KERNEL, "debug%d", cpu);
-       rc = bind_virq_to_irqhandler(VIRQ_DEBUG, cpu, xen_debug_interrupt,
-                                    IRQF_PERCPU | IRQF_NOBALANCING,
-                                    debug_name, NULL);
-       if (rc < 0)
-               goto fail;
-       per_cpu(xen_debug_irq, cpu).irq = rc;
-       per_cpu(xen_debug_irq, cpu).name = debug_name;
+       if (!xen_fifo_events) {
+               debug_name = kasprintf(GFP_KERNEL, "debug%d", cpu);
+               rc = bind_virq_to_irqhandler(VIRQ_DEBUG, cpu,
+                                            xen_debug_interrupt,
+                                            IRQF_PERCPU | IRQF_NOBALANCING,
+                                            debug_name, NULL);
+               if (rc < 0)
+                       goto fail;
+               per_cpu(xen_debug_irq, cpu).irq = rc;
+               per_cpu(xen_debug_irq, cpu).name = debug_name;
+       }
 
        callfunc_name = kasprintf(GFP_KERNEL, "callfuncsingle%d", cpu);
        rc = bind_ipi_to_irqhandler(XEN_CALL_FUNCTION_SINGLE_VECTOR,
index 45d556f718588feb920c1013dcbc368eae6f02d5..9546c3384c7597913383dc1ccdfa09494b338fe7 100644 (file)
@@ -29,6 +29,8 @@ extern struct start_info *xen_start_info;
 extern struct shared_info xen_dummy_shared_info;
 extern struct shared_info *HYPERVISOR_shared_info;
 
+extern bool xen_fifo_events;
+
 void xen_setup_mfn_list_list(void);
 void xen_build_mfn_list_list(void);
 void xen_setup_machphys_mapping(void);
index 1c25580c769151399743af867c551a4f5b7212dd..6038c4c35db5ad55259ecb08208e17d52759682c 100644 (file)
@@ -2050,8 +2050,8 @@ void xen_setup_callback_vector(void) {}
 static inline void xen_alloc_callback_vector(void) {}
 #endif
 
-static bool fifo_events = true;
-module_param(fifo_events, bool, 0);
+bool xen_fifo_events = true;
+module_param_named(fifo_events, xen_fifo_events, bool, 0);
 
 static int xen_evtchn_cpu_prepare(unsigned int cpu)
 {
@@ -2080,10 +2080,12 @@ void __init xen_init_IRQ(void)
        int ret = -EINVAL;
        evtchn_port_t evtchn;
 
-       if (fifo_events)
+       if (xen_fifo_events)
                ret = xen_evtchn_fifo_init();
-       if (ret < 0)
+       if (ret < 0) {
                xen_evtchn_2l_init();
+               xen_fifo_events = false;
+       }
 
        xen_cpu_init_eoi(smp_processor_id());