aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Murphy <robin.murphy@arm.com>2017-01-31 18:45:42 +0000
committerWill Deacon <will.deacon@arm.com>2017-02-01 15:31:46 +0000
commit9a8af7e39000d99fcf661a8bbac38d9ba770cf16 (patch)
tree6d632ab9efe01726bf78b00feeb268092884af94
parentcfae4d64482ed745214e3c62dd84b79c2ae0f325 (diff)
downloadkvmtool-9a8af7e39000d99fcf661a8bbac38d9ba770cf16.tar.gz
virtio: Describe virtio coherency in DT
We use cacheable accesses on our end of the virtio ring, so make sure the guest is aware of that, and thus doesn't try to use non-cacheable DMA buffers, by including the dma-coherent property on its DT node. Signed-off-by: Robin Murphy <robin.murphy@arm.com> [will: do the same for the PCI node for virtio-pci devices] Signed-off-by: Will Deacon <will.deacon@arm.com>
-rw-r--r--arm/pci.c1
-rw-r--r--virtio/mmio.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/arm/pci.c b/arm/pci.c
index 99a81308..86f4a15f 100644
--- a/arm/pci.c
+++ b/arm/pci.c
@@ -60,6 +60,7 @@ void pci__generate_fdt_nodes(void *fdt, u32 gic_phandle)
_FDT(fdt_property_cell(fdt, "#size-cells", 0x2));
_FDT(fdt_property_cell(fdt, "#interrupt-cells", 0x1));
_FDT(fdt_property_string(fdt, "compatible", "pci-host-cam-generic"));
+ _FDT(fdt_property(fdt, "dma-coherent", NULL, 0));
_FDT(fdt_property(fdt, "bus-range", bus_range, sizeof(bus_range)));
_FDT(fdt_property(fdt, "reg", &cfg_reg_prop, sizeof(cfg_reg_prop)));
diff --git a/virtio/mmio.c b/virtio/mmio.c
index 5174455c..f0af4bd1 100644
--- a/virtio/mmio.c
+++ b/virtio/mmio.c
@@ -252,6 +252,7 @@ void generate_virtio_mmio_fdt_node(void *fdt,
_FDT(fdt_begin_node(fdt, dev_name));
_FDT(fdt_property_string(fdt, "compatible", "virtio,mmio"));
_FDT(fdt_property(fdt, "reg", reg_prop, sizeof(reg_prop)));
+ _FDT(fdt_property(fdt, "dma-coherent", NULL, 0));
generate_irq_prop(fdt, vmmio->irq, IRQ_TYPE_EDGE_RISING);
_FDT(fdt_end_node(fdt));
}