qemu-arm.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Bogdan Purcareata <bogdan.purcareata@nxp.com>
To: <eric.auger@linaro.org>, <crosthwaite.peter@gmail.com>,
	<agraf@suse.de>, <peter.maydell@linaro.org>
Cc: qemu-arm@nongnu.org, qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 0/2] arm/virt: Propagate pcie DMA coherency
Date: Thu, 2 Jun 2016 12:26:20 +0000	[thread overview]
Message-ID: <1464870382-385-1-git-send-email-bogdan.purcareata@nxp.com> (raw)

A PCI device is marked as coherent according to the "dma-coherent"
attribute of itself or of the associated controller. This property will
determine how it will issue DMA transactions, and how it will map its DMA
memory. When passing the PCI device to the guest using VFIO PCI, this
isn't taken into account. QEMU emulates a single generic pcie controller,
regardless of how many PCI devices are passed to the guest and to which host
controllers they are attached to. Also, the device need not be described in
the device tree at all (e.g. e1000e).

In a scenario involving aarch64 and ARM SMMU v2, I noticed that without the
dma-coherent property of the guest pcie controller, the eth interface
descriptor rings read stale data without explicit flushes - hence causing
VFIO PCI to not work. Since the host pcie controllers and interconnect are
coherent and described in the host device tree accordingly, this needs to
be passed to the guest as well.

Add a routine and device tree helper to configure the guest pcie controller
based on the host device tree.

Bogdan Purcareata (2):
  device_tree: introduce qemu_fdt_node_path_prop
  arm/virt: Mark pcie controller node as dma-coherent

 device_tree.c                | 59 ++++++++++++++++++++++++++++++++++++++++++++
 hw/arm/virt.c                | 31 +++++++++++++++++++++++
 include/sysemu/device_tree.h | 20 +++++++++++++++
 3 files changed, 110 insertions(+)

-- 
1.9.1


             reply	other threads:[~2016-06-02 14:12 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-02 12:26 Bogdan Purcareata [this message]
2016-06-02 12:26 ` [Qemu-arm] [PATCH 1/2] device_tree: introduce qemu_fdt_node_path_prop Bogdan Purcareata
2016-06-02 12:26 ` [Qemu-arm] [PATCH 2/2] arm/virt: Mark pcie controller node as dma-coherent Bogdan Purcareata
2016-06-02 12:32   ` [Qemu-devel] " Peter Maydell
2016-06-02 12:45     ` Alexander Graf
2016-06-07  7:58       ` [Qemu-arm] " Auger Eric
2016-06-16 13:58       ` [Qemu-devel] " Ard Biesheuvel
2016-06-28 14:16         ` [Qemu-arm] " Peter Maydell
2016-06-29  7:52           ` Bogdan Purcareata
2016-06-03 14:22     ` [Qemu-arm] [Qemu-devel] " 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=1464870382-385-1-git-send-email-bogdan.purcareata@nxp.com \
    --to=bogdan.purcareata@nxp.com \
    --cc=agraf@suse.de \
    --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 \
    /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).