From nobody Mon Feb 9 10:12:40 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 155385478694264.37780505155547; Fri, 29 Mar 2019 03:19:46 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3A7AC88AB2; Fri, 29 Mar 2019 10:19:45 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B9BDD619AE; Fri, 29 Mar 2019 10:19:44 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 9899D1803389; Fri, 29 Mar 2019 10:19:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x2TAJfE3018205 for ; Fri, 29 Mar 2019 06:19:41 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5B4DB6A6B9; Fri, 29 Mar 2019 10:19:41 +0000 (UTC) Received: from kinshicho.brq.redhat.com (unknown [10.43.2.212]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D72BF5E99D for ; Fri, 29 Mar 2019 10:19:38 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Fri, 29 Mar 2019 11:19:31 +0100 Message-Id: <20190329101934.27926-2-abologna@redhat.com> In-Reply-To: <20190329101934.27926-1-abologna@redhat.com> References: <20190329101934.27926-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/4] qemu: Require PCIe Root Port for PCI by default on ARM virt X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 29 Mar 2019 10:19:46 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Our PCIe topology depends on the availability of PCIe Root Ports, so if none of the suitable devices (pcie-root-port, ioh3420) is compiled into QEMU we should fall back to virtio-mmio rather than trying to use PCI addresses only to fail immediately afterwards when we realize we can't use the necessary controllers. Note that this additional check is basically moot for ARM virt guests, because PCIe Root Ports were enabled in QEMU builds for the architecture well before guest OS support had been widely available; however, the opposite is true for RISC-V, and tweaking the code this way will allow us to share it between architectures. Signed-off-by: Andrea Bolognani --- src/qemu/qemu_domain_address.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index 28e79af7b1..9592dbfa60 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -473,9 +473,12 @@ qemuDomainAssignARMVirtioMMIOAddresses(virDomainDefPtr= def, return; =20 /* We use virtio-mmio by default on mach-virt guests only if they alre= ady - * have at least one virtio-mmio device: in all other cases, we prefer - * virtio-pci */ + * have at least one virtio-mmio device: in all other cases, assuming + * the QEMU binary supports all necessary capabilities (PCIe Root plus + * some kind of PCIe Root Port), we prefer virtio-pci */ if (qemuDomainHasPCIeRoot(def) && + (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_PCIE_ROOT_PORT) || + virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_IOH3420)) && !qemuDomainHasVirtioMMIODevices(def)) { qemuDomainPrimeVirtioDeviceAddresses(def, VIR_DOMAIN_DEVICE_ADDRESS_TYP= E_PCI); --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list