From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53322) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHwbC-0001Dm-Sc for qemu-devel@nongnu.org; Tue, 28 Jun 2016 13:14:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bHwb9-00062X-Ko for qemu-devel@nongnu.org; Tue, 28 Jun 2016 13:14:58 -0400 Received: from mail-wm0-x22d.google.com ([2a00:1450:400c:c09::22d]:33546) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHwb9-00062Q-57 for qemu-devel@nongnu.org; Tue, 28 Jun 2016 13:14:55 -0400 Received: by mail-wm0-x22d.google.com with SMTP id r190so28551951wmr.0 for ; Tue, 28 Jun 2016 10:14:54 -0700 (PDT) From: Ard Biesheuvel Date: Tue, 28 Jun 2016 19:14:50 +0200 Message-Id: <1467134090-5099-1-git-send-email-ard.biesheuvel@linaro.org> Subject: [Qemu-devel] [PATCH] hw/arm/virt: mark the PCIe host controller as DMA coherent in the DT List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, peter.maydell@linaro.org Cc: agraf@suse.de, bogdan.purcareata@nxp.com, eric.auger@linaro.org, crosthwaite.peter@gmail.com, Ard Biesheuvel Since QEMU performs cacheable accesses to guest memory when doing DMA as part of the implementation of emulated PCI devices, guest drivers should use cacheable accesses as well when running under KVM. Since this essentially means that emulated PCI devices are DMA coherent, set the 'dma-coherent' DT property on the PCIe host controller DT node. Signed-off-by: Ard Biesheuvel --- hw/arm/virt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index c5c125e9204a..6e098afd1fe5 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -1021,6 +1021,7 @@ static void create_pcie(const VirtBoardInfo *vbi, qemu_irq *pic, qemu_fdt_setprop_cell(vbi->fdt, nodename, "#size-cells", 2); qemu_fdt_setprop_cells(vbi->fdt, nodename, "bus-range", 0, nr_pcie_buses - 1); + qemu_fdt_setprop(vbi->fdt, nodename, "dma-coherent", NULL, 0); if (vbi->v2m_phandle) { qemu_fdt_setprop_cells(vbi->fdt, nodename, "msi-parent", -- 2.7.4