acrn-hypervisor/devicemodel/hw
Conghui Chen 6f482b8856 dm: virtio: add memory barrier before notify FE
Without memory barrier, the change of used ring index could not
immediately detected by FE, this would bring some problems.

For virtio-blk FE driver, when it receives an interrupt, and confirms the
used ring index has changed, it will first set ring flags with
VRING_AVAIL_F_NO_INTERRUPT, then get buffer from virtqueue, after
process this request, it will mask VRING_AVAIL_F_NO_INTERRUPT, and get
used ring index again before return. If used ring changes, it will
process it. At the same time, BE will read this flags before each notify,
if VRING_AVAIL_F_NO_INTERRUPT was set, BE will not inject interrupt.

Without memory barrier, before FE mask VRING_AVAIL_F_NO_INTERRUPT, BE
has finished notify without interrupt, then FE mask
VRING_AVAIL_F_NO_INTERRUPT, and get used ring index but failed (index
has changed from BE side). FE will return from interrupt handler
function, and wait for next interrupt which was not injected by BE. Thus,
this will cause kernel hung.

Tracked-On: #2732
Signed-off-by: Conghui Chen <conghui.chen@intel.com>
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Wang Yu <yu1.wang@intel.com>
2019-03-12 14:15:10 +08:00
..
pci dm: virtio: add memory barrier before notify FE 2019-03-12 14:15:10 +08:00
platform dm: usb: fix possible memory leak 2019-03-12 13:47:57 +08:00
block_if.c dm: storage: change DISCARD to synchronous mode 2019-01-23 12:56:47 +08:00
uart_core.c dm: Add teardown callback for mevent in uart_core 2018-12-27 09:58:20 +08:00
usb_core.c DM USB: add usb_dev_path_cmp function for convenience 2018-12-14 19:40:44 +08:00