Skip to content

Commit

Permalink
lguest: get more serious about wmb() in example Launcher code
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Rusty Russell committed Jun 12, 2009
1 parent 1028375 commit f7027c6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Documentation/lguest/lguest.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down

0 comments on commit f7027c6

Please sign in to comment.