[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-arm] [PATCH 2/2] arm/virt: Mark pcie controller node as dma-co

From: Ard Biesheuvel
Subject: Re: [Qemu-arm] [PATCH 2/2] arm/virt: Mark pcie controller node as dma-coherent
Date: Thu, 16 Jun 2016 15:58:46 +0200

On 2 June 2016 at 14:45, Alexander Graf <address@hidden> wrote:
> On 02.06.16 14:32, Peter Maydell wrote:
>> On 2 June 2016 at 13:26, Bogdan Purcareata <address@hidden> wrote:
>>> A PCI device is marked either as coherent or non-coherent based on the pcie
>>> controller "dma-coherent" property. This is further used when configuring 
>>> the
>>> IOMMU ops for the device DMA resources (e.g. descriptor rings, for e1000e).
>>> This dma-coherent property needs to be configured in the guest environment,
>>> in case there's a directly assigned VFIO PCI device. Since the guest only
>>> receives one emulated pcie controller bus - regardless of the host
>>> configuration - add this property if there's at least one host pcie host
>>> controller that is DMA coherent (this implies that the host interconnect
>>> is coherent as well).
>> This patch seems to change the property of the emulated PCIe controller
>> based on the host PCIe controller even if we're not doing any PCIe
>> passthrough at all. That seems definitely wrong to me.
>> (Should the purely-emulated case be marked DMA-coherent anyway?
>> I forget the fiddly details...)
> I do too, let's involve a few people who know :). Not exposing it as
> coherent is definitely wrong, but whether "dma-coherent" is the right
> choice I don't know.

As far as I understand it, the purely emulated case should be marked
DMA coherent, since otherwise, guest drivers may perform cache
maintenance that the host is not expecting. This is especially harmful
if the guest invalidates the caches after a device to memory transfer,
which may result in data being lost if the data was only present in
the caches to begin with (which is the case for devices that are
emulated by the host)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]