Commit f7027c63 authored by Rusty Russell's avatar Rusty Russell

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: default avatarRusty Russell <rusty@rustcorp.com.au>
parent 1028375e
...@@ -182,9 +182,10 @@ struct virtqueue ...@@ -182,9 +182,10 @@ struct virtqueue
/* Remember the arguments to the program so we can "reboot" */ /* Remember the arguments to the program so we can "reboot" */
static char **main_args; static char **main_args;
/* Since guest is UP and we don't run at the same time, we don't need barriers. /* We have to be careful with barriers: our devices are all run in separate
* But I include them in the code in case others copy it. */ * threads and so we need to make sure that changes visible to the Guest happen
#define wmb() * in precise order. */
#define wmb() __asm__ __volatile__("" : : : "memory")
/* Convert an iovec element to the given type. /* Convert an iovec element to the given type.
* *
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment