diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-01-18 19:44:24 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-01-18 19:44:24 -0500 |
commit | a200dcb34693084e56496960d855afdeaaf9578f (patch) | |
tree | bf65e4350460b7f98247278469f7600d1808c3fc /include/xen | |
parent | d05d82f7110b08fd36178a641b69a1f206e1142b (diff) | |
parent | 43e361f23c49dbddf74f56ddf6cdd85c5dbff6da (diff) |
Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
Pull virtio barrier rework+fixes from Michael Tsirkin:
"This adds a new kind of barrier, and reworks virtio and xen to use it.
Plus some fixes here and there"
* tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost: (44 commits)
checkpatch: add virt barriers
checkpatch: check for __smp outside barrier.h
checkpatch.pl: add missing memory barriers
virtio: make find_vqs() checkpatch.pl-friendly
virtio_balloon: fix race between migration and ballooning
virtio_balloon: fix race by fill and leak
s390: more efficient smp barriers
s390: use generic memory barriers
xen/events: use virt_xxx barriers
xen/io: use virt_xxx barriers
xenbus: use virt_xxx barriers
virtio_ring: use virt_store_mb
sh: move xchg_cmpxchg to a header by itself
sh: support 1 and 2 byte xchg
virtio_ring: update weak barriers to use virt_xxx
Revert "virtio_ring: Update weak barriers to use dma_wmb/rmb"
asm-generic: implement virt_xxx memory barriers
x86: define __smp_xxx
xtensa: define __smp_xxx
tile: define __smp_xxx
...
Diffstat (limited to 'include/xen')
-rw-r--r-- | include/xen/interface/io/ring.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/include/xen/interface/io/ring.h b/include/xen/interface/io/ring.h index 7dc685b4057d..21f4fbd55e48 100644 --- a/include/xen/interface/io/ring.h +++ b/include/xen/interface/io/ring.h | |||
@@ -208,12 +208,12 @@ struct __name##_back_ring { \ | |||
208 | 208 | ||
209 | 209 | ||
210 | #define RING_PUSH_REQUESTS(_r) do { \ | 210 | #define RING_PUSH_REQUESTS(_r) do { \ |
211 | wmb(); /* back sees requests /before/ updated producer index */ \ | 211 | virt_wmb(); /* back sees requests /before/ updated producer index */ \ |
212 | (_r)->sring->req_prod = (_r)->req_prod_pvt; \ | 212 | (_r)->sring->req_prod = (_r)->req_prod_pvt; \ |
213 | } while (0) | 213 | } while (0) |
214 | 214 | ||
215 | #define RING_PUSH_RESPONSES(_r) do { \ | 215 | #define RING_PUSH_RESPONSES(_r) do { \ |
216 | wmb(); /* front sees responses /before/ updated producer index */ \ | 216 | virt_wmb(); /* front sees responses /before/ updated producer index */ \ |
217 | (_r)->sring->rsp_prod = (_r)->rsp_prod_pvt; \ | 217 | (_r)->sring->rsp_prod = (_r)->rsp_prod_pvt; \ |
218 | } while (0) | 218 | } while (0) |
219 | 219 | ||
@@ -250,9 +250,9 @@ struct __name##_back_ring { \ | |||
250 | #define RING_PUSH_REQUESTS_AND_CHECK_NOTIFY(_r, _notify) do { \ | 250 | #define RING_PUSH_REQUESTS_AND_CHECK_NOTIFY(_r, _notify) do { \ |
251 | RING_IDX __old = (_r)->sring->req_prod; \ | 251 | RING_IDX __old = (_r)->sring->req_prod; \ |
252 | RING_IDX __new = (_r)->req_prod_pvt; \ | 252 | RING_IDX __new = (_r)->req_prod_pvt; \ |
253 | wmb(); /* back sees requests /before/ updated producer index */ \ | 253 | virt_wmb(); /* back sees requests /before/ updated producer index */ \ |
254 | (_r)->sring->req_prod = __new; \ | 254 | (_r)->sring->req_prod = __new; \ |
255 | mb(); /* back sees new requests /before/ we check req_event */ \ | 255 | virt_mb(); /* back sees new requests /before/ we check req_event */ \ |
256 | (_notify) = ((RING_IDX)(__new - (_r)->sring->req_event) < \ | 256 | (_notify) = ((RING_IDX)(__new - (_r)->sring->req_event) < \ |
257 | (RING_IDX)(__new - __old)); \ | 257 | (RING_IDX)(__new - __old)); \ |
258 | } while (0) | 258 | } while (0) |
@@ -260,9 +260,9 @@ struct __name##_back_ring { \ | |||
260 | #define RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(_r, _notify) do { \ | 260 | #define RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(_r, _notify) do { \ |
261 | RING_IDX __old = (_r)->sring->rsp_prod; \ | 261 | RING_IDX __old = (_r)->sring->rsp_prod; \ |
262 | RING_IDX __new = (_r)->rsp_prod_pvt; \ | 262 | RING_IDX __new = (_r)->rsp_prod_pvt; \ |
263 | wmb(); /* front sees responses /before/ updated producer index */ \ | 263 | virt_wmb(); /* front sees responses /before/ updated producer index */ \ |
264 | (_r)->sring->rsp_prod = __new; \ | 264 | (_r)->sring->rsp_prod = __new; \ |
265 | mb(); /* front sees new responses /before/ we check rsp_event */ \ | 265 | virt_mb(); /* front sees new responses /before/ we check rsp_event */ \ |
266 | (_notify) = ((RING_IDX)(__new - (_r)->sring->rsp_event) < \ | 266 | (_notify) = ((RING_IDX)(__new - (_r)->sring->rsp_event) < \ |
267 | (RING_IDX)(__new - __old)); \ | 267 | (RING_IDX)(__new - __old)); \ |
268 | } while (0) | 268 | } while (0) |
@@ -271,7 +271,7 @@ struct __name##_back_ring { \ | |||
271 | (_work_to_do) = RING_HAS_UNCONSUMED_REQUESTS(_r); \ | 271 | (_work_to_do) = RING_HAS_UNCONSUMED_REQUESTS(_r); \ |
272 | if (_work_to_do) break; \ | 272 | if (_work_to_do) break; \ |
273 | (_r)->sring->req_event = (_r)->req_cons + 1; \ | 273 | (_r)->sring->req_event = (_r)->req_cons + 1; \ |
274 | mb(); \ | 274 | virt_mb(); \ |
275 | (_work_to_do) = RING_HAS_UNCONSUMED_REQUESTS(_r); \ | 275 | (_work_to_do) = RING_HAS_UNCONSUMED_REQUESTS(_r); \ |
276 | } while (0) | 276 | } while (0) |
277 | 277 | ||
@@ -279,7 +279,7 @@ struct __name##_back_ring { \ | |||
279 | (_work_to_do) = RING_HAS_UNCONSUMED_RESPONSES(_r); \ | 279 | (_work_to_do) = RING_HAS_UNCONSUMED_RESPONSES(_r); \ |
280 | if (_work_to_do) break; \ | 280 | if (_work_to_do) break; \ |
281 | (_r)->sring->rsp_event = (_r)->rsp_cons + 1; \ | 281 | (_r)->sring->rsp_event = (_r)->rsp_cons + 1; \ |
282 | mb(); \ | 282 | virt_mb(); \ |
283 | (_work_to_do) = RING_HAS_UNCONSUMED_RESPONSES(_r); \ | 283 | (_work_to_do) = RING_HAS_UNCONSUMED_RESPONSES(_r); \ |
284 | } while (0) | 284 | } while (0) |
285 | 285 | ||