qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/2] arm/virt: Propagate pcie DMA coherency
@ 2016-06-02 12:26 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
  0 siblings, 2 replies; 15+ messages in thread
From: Bogdan Purcareata @ 2016-06-02 12:26 UTC (permalink / raw)
  To: eric.auger, crosthwaite.peter, agraf, peter.maydell; +Cc: qemu-arm, qemu-devel

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

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2016-06-29  7:52 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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).