Skip to content

Commit

Permalink
tools/virtio: fix smp_mb on x86
Browse files Browse the repository at this point in the history
Offset 128 overlaps the last word of the redzone.
Use 132 which is always beyond that.

Signed-off-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
mstsirkin authored and davem330 committed Jan 29, 2018
1 parent b4eab7d commit 491847f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/virtio/ringtest/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ static inline void busy_wait(void)
}

#if defined(__x86_64__) || defined(__i386__)
#define smp_mb() asm volatile("lock; addl $0,-128(%%rsp)" ::: "memory", "cc")
#define smp_mb() asm volatile("lock; addl $0,-132(%%rsp)" ::: "memory", "cc")
#else
/*
* Not using __ATOMIC_SEQ_CST since gcc docs say they are only synchronized
Expand Down

0 comments on commit 491847f

Please sign in to comment.