Skip to content

Commit d04b1ae

Browse files
jgross1bostrovs
authored andcommitted
xen/events: only register debug interrupt for 2-level events
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>
1 parent 7e14cde commit d04b1ae

3 files changed

Lines changed: 19 additions & 12 deletions

File tree

arch/x86/xen/smp.c

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,17 @@ int xen_smp_intr_init(unsigned int cpu)
8888
per_cpu(xen_callfunc_irq, cpu).irq = rc;
8989
per_cpu(xen_callfunc_irq, cpu).name = callfunc_name;
9090

91-
debug_name = kasprintf(GFP_KERNEL, "debug%d", cpu);
92-
rc = bind_virq_to_irqhandler(VIRQ_DEBUG, cpu, xen_debug_interrupt,
93-
IRQF_PERCPU | IRQF_NOBALANCING,
94-
debug_name, NULL);
95-
if (rc < 0)
96-
goto fail;
97-
per_cpu(xen_debug_irq, cpu).irq = rc;
98-
per_cpu(xen_debug_irq, cpu).name = debug_name;
91+
if (!xen_fifo_events) {
92+
debug_name = kasprintf(GFP_KERNEL, "debug%d", cpu);
93+
rc = bind_virq_to_irqhandler(VIRQ_DEBUG, cpu,
94+
xen_debug_interrupt,
95+
IRQF_PERCPU | IRQF_NOBALANCING,
96+
debug_name, NULL);
97+
if (rc < 0)
98+
goto fail;
99+
per_cpu(xen_debug_irq, cpu).irq = rc;
100+
per_cpu(xen_debug_irq, cpu).name = debug_name;
101+
}
99102

100103
callfunc_name = kasprintf(GFP_KERNEL, "callfuncsingle%d", cpu);
101104
rc = bind_ipi_to_irqhandler(XEN_CALL_FUNCTION_SINGLE_VECTOR,

arch/x86/xen/xen-ops.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ extern struct start_info *xen_start_info;
2929
extern struct shared_info xen_dummy_shared_info;
3030
extern struct shared_info *HYPERVISOR_shared_info;
3131

32+
extern bool xen_fifo_events;
33+
3234
void xen_setup_mfn_list_list(void);
3335
void xen_build_mfn_list_list(void);
3436
void xen_setup_machphys_mapping(void);

drivers/xen/events/events_base.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2050,8 +2050,8 @@ void xen_setup_callback_vector(void) {}
20502050
static inline void xen_alloc_callback_vector(void) {}
20512051
#endif
20522052

2053-
static bool fifo_events = true;
2054-
module_param(fifo_events, bool, 0);
2053+
bool xen_fifo_events = true;
2054+
module_param_named(fifo_events, xen_fifo_events, bool, 0);
20552055

20562056
static int xen_evtchn_cpu_prepare(unsigned int cpu)
20572057
{
@@ -2080,10 +2080,12 @@ void __init xen_init_IRQ(void)
20802080
int ret = -EINVAL;
20812081
evtchn_port_t evtchn;
20822082

2083-
if (fifo_events)
2083+
if (xen_fifo_events)
20842084
ret = xen_evtchn_fifo_init();
2085-
if (ret < 0)
2085+
if (ret < 0) {
20862086
xen_evtchn_2l_init();
2087+
xen_fifo_events = false;
2088+
}
20872089

20882090
xen_cpu_init_eoi(smp_processor_id());
20892091

0 commit comments

Comments
 (0)