acrn-hypervisor/devicemodel/hw/pci
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
..
virtio dm: virtio: add memory barrier before notify FE 2019-03-12 14:15:10 +08:00
ahci.c dm: storage: rename delete to discard 2018-12-18 13:21:07 +08:00
core.c [RevertMe] dm: pci: restore workaround when alloc pci mem64 bar 2019-03-05 15:14:24 +08:00
gsi_sharing.c dm: hw: Replace sscanf with permitted string API 2018-12-17 19:17:29 +08:00
gvt.c dm: Fix some issues from string operations 2018-12-25 18:40:04 +08:00
hostbridge.c
irq.c DM: wrap ASSERT/DEASSERT IRQ line with Set/Clear IRQ line 2018-10-29 09:26:23 +08:00
lpc.c dm: refine the uart_core 2018-12-27 09:58:20 +08:00
npk.c dm: Fix some issues from string operations 2018-12-25 18:40:04 +08:00
passthrough.c dm: passthru: add error handling if msix table init failed 2018-12-20 09:08:37 +08:00
platform_gsi_info.c
uart.c dm: refine the uart_core 2018-12-27 09:58:20 +08:00
wdt_i6300esb.c dm: provide timer callback handlers the number of expirations 2019-01-23 10:33:28 +08:00
xhci.c dm: usb: fix possible memory leak 2019-03-12 13:47:57 +08:00