From: Bogdan Purcareata <bogdan.purcareata@nxp.com>
To: Peter Maydell <peter.maydell@linaro.org>,
Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Alexander Graf <agraf@suse.de>,
Eric Auger <eric.auger@linaro.org>,
Peter Crosthwaite <crosthwaite.peter@gmail.com>,
qemu-arm <qemu-arm@nongnu.org>,
QEMU Developers <qemu-devel@nongnu.org>,
Will Deacon <will.deacon@arm.com>
Subject: Re: [Qemu-devel] [PATCH 2/2] arm/virt: Mark pcie controller node as dma-coherent
Date: Wed, 29 Jun 2016 07:52:03 +0000 [thread overview]
Message-ID: <18bc82a0-f985-566f-c7cf-b5baaa73857d@nxp.com> (raw)
In-Reply-To: <CAFEAcA-p9K+Xzp2KuqTKsP__ph9ZaXNG-pfGDGTyREJEBikDaQ@mail.gmail.com>
On 28.06.2016 17:16, Peter Maydell wrote:
> On 16 June 2016 at 14:58, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
>> On 2 June 2016 at 14:45, Alexander Graf <agraf@suse.de> wrote:
>>> On 02.06.16 14:32, Peter Maydell wrote:
>>>> 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)
>
> So the consensus seems to be that:
> * emulated PCI devices definitely need dma-coherent
> * passthrough devices where the host controller is dma-coherent
> also need dma-coherent
> * passthrough devices where the host controller is not dma-coherent
> don't want dma-coherent, but we have to set things per-PCI-controller
>
> Would somebody like to write a patch which just unconditionally
> sets the dma-coherent property on our PCI controller dt node?
I will send this patch later today.
Best regards,
Bogdan P.
> That seems a clear improvement on what we have at the moment.
> We can look at whether we want to support passthrough from a
> non-dma-coherent host pci controller (via a 2nd guest pci controller?)
> later...
>
> thanks
> -- PMM
>
next prev parent reply other threads:[~2016-06-29 7:52 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-02 12:26 [Qemu-devel] [PATCH 0/2] arm/virt: Propagate pcie DMA coherency Bogdan Purcareata
2016-06-02 12:26 ` [Qemu-devel] [PATCH 1/2] device_tree: introduce qemu_fdt_node_path_prop Bogdan Purcareata
2016-06-02 12:26 ` [Qemu-devel] [PATCH 2/2] arm/virt: Mark pcie controller node as dma-coherent Bogdan Purcareata
2016-06-02 12:32 ` Peter Maydell
2016-06-02 12:45 ` Alexander Graf
2016-06-07 7:58 ` Auger Eric
2016-06-16 13:58 ` Ard Biesheuvel
2016-06-28 14:16 ` Peter Maydell
2016-06-29 7:52 ` Bogdan Purcareata [this message]
2016-06-03 14:22 ` Mihai Claudiu Caraman
2016-06-03 14:37 ` Peter Maydell
2016-06-03 15:02 ` agraf
2016-06-03 15:16 ` Mihai Claudiu Caraman
2016-06-03 15:25 ` Alexander Graf
2016-06-03 16:44 ` Mihai Claudiu Caraman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=18bc82a0-f985-566f-c7cf-b5baaa73857d@nxp.com \
--to=bogdan.purcareata@nxp.com \
--cc=agraf@suse.de \
--cc=ard.biesheuvel@linaro.org \
--cc=crosthwaite.peter@gmail.com \
--cc=eric.auger@linaro.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=will.deacon@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).