aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hv
diff options
context:
space:
mode:
authorJason Wang <jasowang@redhat.com>2013-06-18 01:04:23 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-07-21 21:21:25 -0400
commit540005dcb39acd12c52d2a580a85ccfd5de76fc1 (patch)
tree77fc8954c469bce20592f633659d6d5c904b7165 /drivers/hv
parenta5ea8ca0b2d24ab8beae6b218abeb771d40ae966 (diff)
drivers: hv: switch to use mb() instead of smp_mb()
commit 35848f68b07df3f917cb13fc3c134718669f569b upstream. Even if guest were compiled without SMP support, it could not assume that host wasn't. So switch to use mb() instead of smp_mb() to force memory barriers for UP guest. Signed-off-by: Jason Wang <jasowang@redhat.com> Cc: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hv')
-rw-r--r--drivers/hv/ring_buffer.c10
-rw-r--r--drivers/hv/vmbus_drv.c2
2 files changed, 6 insertions, 6 deletions
diff --git a/drivers/hv/ring_buffer.c b/drivers/hv/ring_buffer.c
index d6fbb5772b8d..791f45dfc85d 100644
--- a/drivers/hv/ring_buffer.c
+++ b/drivers/hv/ring_buffer.c
@@ -32,7 +32,7 @@
32void hv_begin_read(struct hv_ring_buffer_info *rbi) 32void hv_begin_read(struct hv_ring_buffer_info *rbi)
33{ 33{
34 rbi->ring_buffer->interrupt_mask = 1; 34 rbi->ring_buffer->interrupt_mask = 1;
35 smp_mb(); 35 mb();
36} 36}
37 37
38u32 hv_end_read(struct hv_ring_buffer_info *rbi) 38u32 hv_end_read(struct hv_ring_buffer_info *rbi)
@@ -41,7 +41,7 @@ u32 hv_end_read(struct hv_ring_buffer_info *rbi)
41 u32 write; 41 u32 write;
42 42
43 rbi->ring_buffer->interrupt_mask = 0; 43 rbi->ring_buffer->interrupt_mask = 0;
44 smp_mb(); 44 mb();
45 45
46 /* 46 /*
47 * Now check to see if the ring buffer is still empty. 47 * Now check to see if the ring buffer is still empty.
@@ -71,7 +71,7 @@ u32 hv_end_read(struct hv_ring_buffer_info *rbi)
71 71
72static bool hv_need_to_signal(u32 old_write, struct hv_ring_buffer_info *rbi) 72static bool hv_need_to_signal(u32 old_write, struct hv_ring_buffer_info *rbi)
73{ 73{
74 smp_mb(); 74 mb();
75 if (rbi->ring_buffer->interrupt_mask) 75 if (rbi->ring_buffer->interrupt_mask)
76 return false; 76 return false;
77 77
@@ -442,7 +442,7 @@ int hv_ringbuffer_write(struct hv_ring_buffer_info *outring_info,
442 sizeof(u64)); 442 sizeof(u64));
443 443
444 /* Issue a full memory barrier before updating the write index */ 444 /* Issue a full memory barrier before updating the write index */
445 smp_mb(); 445 mb();
446 446
447 /* Now, update the write location */ 447 /* Now, update the write location */
448 hv_set_next_write_location(outring_info, next_write_location); 448 hv_set_next_write_location(outring_info, next_write_location);
@@ -549,7 +549,7 @@ int hv_ringbuffer_read(struct hv_ring_buffer_info *inring_info, void *buffer,
549 /* Make sure all reads are done before we update the read index since */ 549 /* Make sure all reads are done before we update the read index since */
550 /* the writer may start writing to the read area once the read index */ 550 /* the writer may start writing to the read area once the read index */
551 /*is updated */ 551 /*is updated */
552 smp_mb(); 552 mb();
553 553
554 /* Update the read index */ 554 /* Update the read index */
555 hv_set_next_read_location(inring_info, next_read_location); 555 hv_set_next_read_location(inring_info, next_read_location);
diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index bf421e0efa1e..4004e54ef05d 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -434,7 +434,7 @@ static void vmbus_on_msg_dpc(unsigned long data)
434 * will not deliver any more messages since there is 434 * will not deliver any more messages since there is
435 * no empty slot 435 * no empty slot
436 */ 436 */
437 smp_mb(); 437 mb();
438 438
439 if (msg->header.message_flags.msg_pending) { 439 if (msg->header.message_flags.msg_pending) {
440 /* 440 /*