From nobody Wed Dec 17 21:59:24 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1486750224199630.7830243469972; Fri, 10 Feb 2017 10:10:24 -0800 (PST) Received: from localhost ([::1]:45314 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ccFeH-00038t-Ii for importer@patchew.org; Fri, 10 Feb 2017 13:10:21 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49573) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ccFc8-00021a-BO for qemu-devel@nongnu.org; Fri, 10 Feb 2017 13:08:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ccFc7-0003wq-FZ for qemu-devel@nongnu.org; Fri, 10 Feb 2017 13:08:08 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:48481) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ccFc7-0003vW-89 for qemu-devel@nongnu.org; Fri, 10 Feb 2017 13:08:07 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.84_2) (envelope-from ) id 1ccFc6-0007cL-Do for qemu-devel@nongnu.org; Fri, 10 Feb 2017 18:08:06 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 10 Feb 2017 18:07:55 +0000 Message-Id: <1486750082-12324-6-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1486750082-12324-1-git-send-email-peter.maydell@linaro.org> References: <1486750082-12324-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 05/12] target-arm: Declare virtio-mmio as dma-coherent in dt X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Alexander Graf 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 Reviewed-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Message-id: 1486644810-33181-2-git-send-email-agraf@suse.de Signed-off-by: Peter Maydell --- 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 ace= lls, 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 VirtMachineStat= e *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); } } --=20 2.7.4