From: Alexander Graf <agraf@suse.de>
To: qemu-devel@nongnu.org
Cc: qemu-arm@nongnu.org, mst@redhat.com
Subject: [Qemu-devel] [PATCH] target-arm: Declare virtio-mmio as dma-coherent in dt
Date: Wed, 8 Feb 2017 14:31:52 +0100 [thread overview]
Message-ID: <1486560712-44171-1-git-send-email-agraf@suse.de> (raw)
QEMU emulated hardware is always dma coherent with its guest. We do
annotate that correctly on the PCI host controller, but left out
virtio-mmio.
Recent kernels have started to interpret that flag rather than take
dma coherency as granted with virtio-mmio. While that is considered
a kernel bug, as it breaks previously working systems, it showed that
our dt description is incomplete.
This patch adds the respective marker that allows guest OSs to evaluate
that our virtio-mmio devices are indeed cache coherent.
Signed-off-by: Alexander Graf <agraf@suse.de>
---
hw/arm/vexpress.c | 1 +
hw/arm/virt.c | 1 +
2 files changed, 2 insertions(+)
diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c
index 58760f4..e057568 100644
--- a/hw/arm/vexpress.c
+++ b/hw/arm/vexpress.c
@@ -452,6 +452,7 @@ static int add_virtio_mmio_node(void *fdt, uint32_t acells, uint32_t scells,
acells, addr, scells, size);
qemu_fdt_setprop_cells(fdt, nodename, "interrupt-parent", intc);
qemu_fdt_setprop_cells(fdt, nodename, "interrupts", 0, irq, 1);
+ qemu_fdt_setprop(fdt, nodename, "dma-coherent", NULL, 0);
g_free(nodename);
if (rc) {
return -1;
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 1f216cf..14881fa 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -797,6 +797,7 @@ static void create_virtio_devices(const VirtMachineState *vms, qemu_irq *pic)
qemu_fdt_setprop_cells(vms->fdt, nodename, "interrupts",
GIC_FDT_IRQ_TYPE_SPI, irq,
GIC_FDT_IRQ_FLAGS_EDGE_LO_HI);
+ qemu_fdt_setprop(vms->fdt, nodename, "dma-coherent", NULL, 0);
g_free(nodename);
}
}
--
2.10.0
next reply other threads:[~2017-02-08 13:31 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-08 13:31 Alexander Graf [this message]
2017-02-08 15:29 ` [Qemu-devel] [PATCH] target-arm: Declare virtio-mmio as dma-coherent in dt Laszlo Ersek
2017-02-08 16:12 ` Alexander Graf
2017-02-08 16:17 ` Laszlo Ersek
2017-02-08 16:27 ` Ard Biesheuvel
2017-02-08 18:23 ` [Qemu-devel] [Qemu-arm] " Peter Maydell
2017-02-08 18:47 ` Laszlo Ersek
2017-02-09 12:04 ` Heyi Guo
2017-02-10 1:40 ` Alex Hung
2017-02-09 10:35 ` Ard Biesheuvel
2017-02-09 12:24 ` [Qemu-devel] " Alexander Graf
2017-02-09 12:30 ` Ard Biesheuvel
2017-02-09 12:43 ` Alexander Graf
2017-02-09 12:41 ` Andrew Jones
2017-02-09 12:29 ` Alexander Graf
2017-02-09 12:31 ` Ard Biesheuvel
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=1486560712-44171-1-git-send-email-agraf@suse.de \
--to=agraf@suse.de \
--cc=mst@redhat.com \
--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).