ia64/xen-unstable

changeset 10613:c9696012fe05

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 <yamahata@valinux.co.jp>
author kaf24@firebug.cl.cam.ac.uk
date Fri Jun 30 10:07:38 2006 +0100 (2006-06-30)
parents 5db7bbccf4d2
children 86cae321e707
files linux-2.6-xen-sparse/drivers/xen/core/evtchn.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/drivers/xen/core/evtchn.c	Fri Jun 30 10:04:22 2006 +0100
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/core/evtchn.c	Fri Jun 30 10:07:38 2006 +0100
     1.3 @@ -219,7 +219,10 @@ asmlinkage void evtchn_do_upcall(struct 
     1.4  
     1.5  	vcpu_info->evtchn_upcall_pending = 0;
     1.6  
     1.7 -	/* NB. No need for a barrier here -- XCHG is a barrier on x86. */
     1.8 +#ifndef CONFIG_X86 /* No need for a barrier -- XCHG is a barrier on x86. */
     1.9 +	/* Clear master pending flag /before/ clearing selector flag. */
    1.10 +	rmb();
    1.11 +#endif
    1.12  	l1 = xchg(&vcpu_info->evtchn_pending_sel, 0);
    1.13  	while (l1 != 0) {
    1.14  		l1i = __ffs(l1);