diff options
author | Ian Campbell <ian.campbell@citrix.com> | 2013-07-04 10:32:44 +0200 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2013-07-04 10:32:44 +0200 |
commit | b12649ce9e7a162dae386d32bd04c5fdc537d65c (patch) | |
tree | 7292f884076246fa3927ecea73b25c8116fb2355 /xen/common/trace.c | |
parent | b0581b9214d2359207f836f4f075e978527b9a7b (diff) | |
download | xen-b12649ce9e7a162dae386d32bd04c5fdc537d65c.tar.gz xen-b12649ce9e7a162dae386d32bd04c5fdc537d65c.tar.bz2 xen-b12649ce9e7a162dae386d32bd04c5fdc537d65c.zip |
use SMP barrier in common code dealing with shared memory protocols
Xen currently makes no strong distinction between the SMP barriers (smp_mb
etc) and the regular barrier (mb etc). In Linux, where we inherited these
names from having imported Linux code which uses them, the SMP barriers are
intended to be sufficient for implementing shared-memory protocols between
processors in an SMP system while the standard barriers are useful for MMIO
etc.
On x86 with the stronger ordering model there is not much practical difference
here but ARM has weaker barriers available which are suitable for use as SMP
barriers.
Therefore ensure that common code uses the SMP barriers when that is all which
is required.
On both ARM and x86 both types of barrier are currently identical so there is
no actual change. A future patch will change smp_mb to a weaker barrier on
ARM.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/common/trace.c')
-rw-r--r-- | xen/common/trace.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/xen/common/trace.c b/xen/common/trace.c index fd4ac489ee..63ea0b7ba0 100644 --- a/xen/common/trace.c +++ b/xen/common/trace.c @@ -255,7 +255,7 @@ static int alloc_trace_bufs(unsigned int pages) opt_tbuf_size = pages; printk("xentrace: initialised\n"); - wmb(); /* above must be visible before tb_init_done flag set */ + smp_wmb(); /* above must be visible before tb_init_done flag set */ tb_init_done = 1; return 0; @@ -414,7 +414,7 @@ int tb_control(xen_sysctl_tbuf_op_t *tbc) int i; tb_init_done = 0; - wmb(); + smp_wmb(); /* Clear any lost-record info so we don't get phantom lost records next time we * start tracing. Grab the lock to make sure we're not racing anyone. After this * hypercall returns, no more records should be placed into the buffers. */ @@ -607,7 +607,7 @@ static inline void __insert_record(struct t_buf *buf, memcpy(next_page, (char *)rec + remaining, rec_size - remaining); } - wmb(); + smp_wmb(); next += rec_size; if ( next >= 2*data_size ) @@ -718,7 +718,7 @@ void __trace_var(u32 event, bool_t cycles, unsigned int extra, return; /* Read tb_init_done /before/ t_bufs. */ - rmb(); + smp_rmb(); spin_lock_irqsave(&this_cpu(t_lock), flags); |