From: kaf24@firebug.cl.cam.ac.uk Date: Fri, 30 Jun 2006 09:07:38 +0000 (+0100) Subject: evtchn_do_upcall() has a micro optimization which is depends on that xchg is a barrier. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15912^2~22 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=047923da523a118caf6c3837a1205f3d3b7137d7;p=xen.git evtchn_do_upcall() has a micro optimization which is depends on that xchg is a barrier. However xchg of IA64 has acquire semantics so that event channel notification is lost sometimes. This patch fixes it. Signed-off-by: Isaku Yamahata --- diff --git a/linux-2.6-xen-sparse/drivers/xen/core/evtchn.c b/linux-2.6-xen-sparse/drivers/xen/core/evtchn.c index 7d57e105a4..69541c6aa5 100644 --- a/linux-2.6-xen-sparse/drivers/xen/core/evtchn.c +++ b/linux-2.6-xen-sparse/drivers/xen/core/evtchn.c @@ -219,7 +219,10 @@ asmlinkage void evtchn_do_upcall(struct pt_regs *regs) vcpu_info->evtchn_upcall_pending = 0; - /* NB. No need for a barrier here -- XCHG is a barrier on x86. */ +#ifndef CONFIG_X86 /* No need for a barrier -- XCHG is a barrier on x86. */ + /* Clear master pending flag /before/ clearing selector flag. */ + rmb(); +#endif l1 = xchg(&vcpu_info->evtchn_pending_sel, 0); while (l1 != 0) { l1i = __ffs(l1);