qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PULL 05/12] target-arm: Declare virtio-mmio as dma-coherent in dt
Date: Fri, 10 Feb 2017 18:07:55 +0000	[thread overview]
Message-ID: <1486750082-12324-6-git-send-email-peter.maydell@linaro.org> (raw)
In-Reply-To: <1486750082-12324-1-git-send-email-peter.maydell@linaro.org>

From: Alexander Graf <agraf@suse.de>

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>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Message-id: 1486644810-33181-2-git-send-email-agraf@suse.de
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 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 8eef143..d20e627 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.7.4

  parent reply	other threads:[~2017-02-10 18:08 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-10 18:07 [Qemu-devel] [PULL 00/12] target-arm queue Peter Maydell
2017-02-10 18:07 ` [Qemu-devel] [PULL 01/12] target-arm: Add support for PMU register PMSELR_EL0 Peter Maydell
2017-02-10 18:07 ` [Qemu-devel] [PULL 02/12] target-arm: Add support for AArch64 PMU register PMXEVTYPER_EL0 Peter Maydell
2017-02-10 18:07 ` [Qemu-devel] [PULL 03/12] target-arm: Add support for PMU register PMINTENSET_EL1 Peter Maydell
2017-02-23 13:58   ` Aaron Lindsay
2017-02-23 14:49     ` Peter Maydell
2017-02-10 18:07 ` [Qemu-devel] [PULL 04/12] target-arm: Enable vPMU support under TCG mode Peter Maydell
2017-02-10 18:07 ` Peter Maydell [this message]
2017-02-10 18:07 ` [Qemu-devel] [PULL 06/12] hw/arm/virt: Declare virtio-mmio as dma cache coherent in ACPI Peter Maydell
2017-02-10 18:07 ` [Qemu-devel] [PULL 07/12] hw/arm/virt: Declare fwcfg " Peter Maydell
2017-02-10 18:07 ` [Qemu-devel] [PULL 08/12] hw/arm/virt: Declare fwcfg as dma cache coherent in dt Peter Maydell
2017-02-10 18:07 ` [Qemu-devel] [PULL 09/12] aspeed: check for negative values returned by blk_getlength() Peter Maydell
2017-02-10 18:08 ` [Qemu-devel] [PULL 10/12] aspeed: remove useless comment on controller segment size Peter Maydell
2017-02-10 18:08 ` [Qemu-devel] [PULL 11/12] aspeed/smc: handle dummies only in fast read mode Peter Maydell
2017-02-10 18:08 ` [Qemu-devel] [PULL 12/12] aspeed/smc: use a modulo to check segment limits Peter Maydell
2017-02-13  9:30 ` [Qemu-devel] [PULL 00/12] target-arm queue Peter Maydell

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=1486750082-12324-6-git-send-email-peter.maydell@linaro.org \
    --to=peter.maydell@linaro.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).