Skip to content

Commit 348be43

Browse files
committed
xen/events: remove event handling recursion detection
__xen_evtchn_do_upcall() contains guards against being called recursively. This mechanism was introduced in the early pvops times (kernel 2.6.26) when there were all the Xen backend drivers missing from the upstream kernel, and some of those out-of-tree drivers were enabling interrupts in their event handlers (which was explicitly allowed in the initial XenoLinux). Nowadays we don't need to support those old drivers any more and the capability to allow recursive calls of __xen_evtchn_do_upcall() can be removed. Signed-off-by: Juergen Gross <[email protected]> Reviewed-by: Boris Ostrovsky <[email protected]> Signed-off-by: Juergen Gross <[email protected]>
1 parent b94ae8a commit 348be43

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

drivers/xen/events/events_base.c

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1213,31 +1213,21 @@ void xen_send_IPI_one(unsigned int cpu, enum ipi_vector vector)
12131213
notify_remote_via_irq(irq);
12141214
}
12151215

1216-
static DEFINE_PER_CPU(unsigned, xed_nesting_count);
1217-
12181216
static void __xen_evtchn_do_upcall(void)
12191217
{
12201218
struct vcpu_info *vcpu_info = __this_cpu_read(xen_vcpu);
1221-
int cpu = get_cpu();
1222-
unsigned count;
1219+
int cpu = smp_processor_id();
12231220

12241221
do {
12251222
vcpu_info->evtchn_upcall_pending = 0;
12261223

1227-
if (__this_cpu_inc_return(xed_nesting_count) - 1)
1228-
goto out;
1229-
12301224
xen_evtchn_handle_events(cpu);
12311225

12321226
BUG_ON(!irqs_disabled());
12331227

1234-
count = __this_cpu_read(xed_nesting_count);
1235-
__this_cpu_write(xed_nesting_count, 0);
1236-
} while (count != 1 || vcpu_info->evtchn_upcall_pending);
1237-
1238-
out:
1228+
virt_rmb(); /* Hypervisor can set upcall pending. */
12391229

1240-
put_cpu();
1230+
} while (vcpu_info->evtchn_upcall_pending);
12411231
}
12421232

12431233
void xen_evtchn_do_upcall(struct pt_regs *regs)

0 commit comments

Comments
 (0)