diff options
author | 2009-06-12 22:27:00 -0600 | |
---|---|---|
committer | 2009-06-12 22:27:00 +0930 | |
commit | f7027c6387d0c3acf569845165ec7947e2083c82 (patch) | |
tree | 306f36650d615491d468e040d7055b07053d2fb6 /Documentation/lguest/lguest.c | |
parent | lguest: clean up lguest_init_IRQ (diff) | |
download | linux-f7027c6387d0c3acf569845165ec7947e2083c82.tar.gz linux-f7027c6387d0c3acf569845165ec7947e2083c82.tar.bz2 linux-f7027c6387d0c3acf569845165ec7947e2083c82.zip |
lguest: get more serious about wmb() in example Launcher code
Since the Launcher process runs the Guest, it doesn't have to be very
serious about its barriers: the Guest isn't running while we are (Guest
is UP).
Before we change to use threads to service devices, we need to fix this.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'Documentation/lguest/lguest.c')
-rw-r--r-- | Documentation/lguest/lguest.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Documentation/lguest/lguest.c b/Documentation/lguest/lguest.c index 1a2b906a3ae6..1e31d1ec12a3 100644 --- a/Documentation/lguest/lguest.c +++ b/Documentation/lguest/lguest.c @@ -182,9 +182,10 @@ struct virtqueue /* Remember the arguments to the program so we can "reboot" */ static char **main_args; -/* Since guest is UP and we don't run at the same time, we don't need barriers. - * But I include them in the code in case others copy it. */ -#define wmb() +/* We have to be careful with barriers: our devices are all run in separate + * threads and so we need to make sure that changes visible to the Guest happen + * in precise order. */ +#define wmb() __asm__ __volatile__("" : : : "memory") /* Convert an iovec element to the given type. * |