Daniel P. Berrange
2006-Sep-18 18:07 UTC
[Xen-devel] Memory barrier definitions in xenctrl.h for ia64?
Looking in tools/libxc/xenctrl.h it seems we define macros for memory barriers, #if defined(__i386__) #define mb() __asm__ __volatile__ ( "lock; addl $0,0(%%esp)" : : : "memory" ) #define rmb() __asm__ __volatile__ ( "lock; addl $0,0(%%esp)" : : : "memory" ) #define wmb() __asm__ __volatile__ ( "" : : : "memory") #elif defined(__x86_64__) #define mb() __asm__ __volatile__ ( "mfence" : : : "memory") #define rmb() __asm__ __volatile__ ( "lfence" : : : "memory") #define wmb() __asm__ __volatile__ ( "" : : : "memory") #elif defined(__ia64__) /* FIXME */ #define mb() #define rmb() #define wmb() #elif defined(__powerpc__) /* XXX loosen these up later */ #define mb() __asm__ __volatile__ ("sync" : : : "memory") #define rmb() __asm__ __volatile__ ("sync" : : : "memory") /* lwsync? */ #define wmb() __asm__ __volatile__ ("sync" : : : "memory") /* eieio? */ #else #error "Define barriers" #endif I''m not familiar with ia64 myself - does it really not need memory barriers? The userspace tools blktap, xenfb & xconsoled are all using these macros in various places so if ia64 does indeed need memory barriers it looks like there is some nasty bug potential here Regards, Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=| _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2006-Sep-18 19:12 UTC
Re: [Xen-devel] Memory barrier definitions in xenctrl.h for ia64?
On 18/9/06 7:07 pm, "Daniel P. Berrange" <berrange@redhat.com> wrote:> The userspace tools blktap, xenfb & xconsoled are all using these macros in > various places so if ia64 does indeed need memory barriers it looks like > there is some nasty bug potential hereIt definitely needs barriers. They should be grabbed from Linux definitions in asm-ia64/system.h. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel