From: Rusty Russell Date: Tue, 2 Jul 2013 06:05:14 +0000 (+0930) Subject: tools/lguest: real barriers. X-Git-Tag: firefly_0821_release~176^2~5732^2~6 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=0d69a65e97fc8090ee83c8639137b4b5c8ece237;p=firefly-linux-kernel-4.4.55.git tools/lguest: real barriers. Lguest guests are UP, but the host is probably SMP, so real barriers are required in case the device thread and the guest are on different CPUs. Signed-off-by: Rusty Russell --- diff --git a/tools/lguest/lguest.c b/tools/lguest/lguest.c index 49ed25b5bbb9..a64f5cb0c15b 100644 --- a/tools/lguest/lguest.c +++ b/tools/lguest/lguest.c @@ -177,8 +177,8 @@ static struct termios orig_term; * in precise order. */ #define wmb() __asm__ __volatile__("" : : : "memory") -#define rmb() __asm__ __volatile__("" : : : "memory") -#define mb() __asm__ __volatile__("" : : : "memory") +#define rmb() __asm__ __volatile__("lock; addl $0,0(%%esp)" : : : "memory") +#define mb() __asm__ __volatile__("lock; addl $0,0(%%esp)" : : : "memory") /* Wrapper for the last available index. Makes it easier to change. */ #define lg_last_avail(vq) ((vq)->last_avail_idx)