evtchn_do_upcall() has a micro optimization which is depends on that xchg is a barrier.
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Fri, 30 Jun 2006 09:07:38 +0000 (10:07 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Fri, 30 Jun 2006 09:07:38 +0000 (10:07 +0100)
However xchg of IA64 has acquire semantics so that event
channel notification is lost sometimes. This patch fixes it.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
linux-2.6-xen-sparse/drivers/xen/core/evtchn.c

index 7d57e105a4346812917013b17441d48673939a27..69541c6aa5a6d50110e4b2b7fdc14df41c87d376 100644 (file)
@@ -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);