Skip to content

target-arm: Add some omitted dma cache coherency flags

Alexander Graf qemu-arm qemu-devel 2 versions – Applied

Status from this message: Thanks, applied to target-arm.next.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 8 repliesApplied
  2. v11 patch 15 repliesSuperseded

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/4target-arm: Declare virtio-mmio as dma-coherent in dthw/arm/vexpress.c hw/arm/virt.c+2 -00 replies
2/4hw/arm/virt: Declare virtio-mmio as dma cache coherent in ACPIhw/arm/virt-acpi-build.c+1 -01 reply
3/4hw/arm/virt: Declare fwcfg as dma cache coherent in ACPIhw/arm/virt-acpi-build.c+1 -01 reply
4/4hw/arm/virt: Declare fwcfg as dma cache coherent in dthw/arm/virt.c+1 -00 replies

Reviews trailers per patch

2 of 4 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchLaszlo ErsekArd BiesheuvelShannon Zhao
SeriesR-b R-b
1/4
2/4R-b
3/4R-b
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v2 thread

Cover letter [Qemu-arm] [PATCH v2 0/4] target-arm: Add some omitted dma cache coherency flags

ARM is amazing when it comes to cache coherency and VMs. While any sane architecture allows the host to override the guest's caching attributes, that's very hard to do on ARM.

That means that the guest may directly access guest memory bypassing the cache while QEMU happily writes to / reads from cache. The end result is very nasty, because both sides see very different views of the world.

That means that we need to be very cautious to tell guests that devices that QEMU emulates are going to use data in the cache rather than directly on memory.

We added this to PCI a while back for DT (5d636e21 "hw/arm/virt: mark the PCIe host controller as DMA coherent in the DT") and ACPI (bc64b96 "hw/arm/virt-
acpi-build: _CCA attribute is compulsory") but never updated virtio-mmio or fw-cfg in DT or ACPI tables.

This patch set adds the respective cache coherency flags for them in both DT and ACPI.

Fortunately, no guests except for Linux 4.9.7 and 4.9.8 are broken because of this. Upstream realized quickly enough that every user of virtio-mmio out there describes its cache coherency incorrectly and reverted the patch that would require said dma coherency flag. But we should be safe for the future and "do the right thing".

Alexander Graf (4):
target-arm: Declare virtio-mmio as dma-coherent in dt hw/arm/virt: Declare virtio-mmio as dma cache coherent in ACPI hw/arm/virt: Declare fwcfg as dma cache coherent in ACPI hw/arm/virt: Declare fwcfg as dma cache coherent in dt

 hw/arm/vexpress.c        | 1 +
 hw/arm/virt-acpi-build.c | 2 ++
 hw/arm/virt.c            | 2 ++
 3 files changed, 5 insertions(+)
Signature · 1 line
2.10.0