[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 0/4] target-arm: Add some omitted dma cache c
From: |
Ard Biesheuvel |
Subject: |
Re: [Qemu-devel] [PATCH v2 0/4] target-arm: Add some omitted dma cache coherency flags |
Date: |
Thu, 9 Feb 2017 17:51:22 +0000 |
On 9 February 2017 at 12:53, Alexander Graf <address@hidden> wrote:
> 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
>
This looks correct to me.
Reviewed-by: Ard Biesheuvel <address@hidden>
- [Qemu-devel] [PATCH v2 2/4] hw/arm/virt: Declare virtio-mmio as dma cache coherent in ACPI, (continued)
- [Qemu-devel] [PATCH v2 2/4] hw/arm/virt: Declare virtio-mmio as dma cache coherent in ACPI, Alexander Graf, 2017/02/09
- [Qemu-devel] [PATCH v2 3/4] hw/arm/virt: Declare fwcfg as dma cache coherent in ACPI, Alexander Graf, 2017/02/09
- [Qemu-devel] [PATCH v2 4/4] hw/arm/virt: Declare fwcfg as dma cache coherent in dt, Alexander Graf, 2017/02/09
- [Qemu-devel] [PATCH v2 1/4] target-arm: Declare virtio-mmio as dma-coherent in dt, Alexander Graf, 2017/02/09
- Re: [Qemu-devel] [PATCH v2 0/4] target-arm: Add some omitted dma cache coherency flags, Laszlo Ersek, 2017/02/09
- Re: [Qemu-devel] [PATCH v2 0/4] target-arm: Add some omitted dma cache coherency flags,
Ard Biesheuvel <=
- Re: [Qemu-devel] [Qemu-arm] [PATCH v2 0/4] target-arm: Add some omitted dma cache coherency flags, Peter Maydell, 2017/02/10