From nobody Mon Feb 9 08:29:41 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.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1489684463673745.7513684888207; Thu, 16 Mar 2017 10:14:23 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BD069C0467CB; Thu, 16 Mar 2017 17:14:22 +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 8B9BB60A99; Thu, 16 Mar 2017 17:14:22 +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 41B6C1853D03; Thu, 16 Mar 2017 17:14:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v2GHEKP5018185 for ; Thu, 16 Mar 2017 13:14:20 -0400 Received: by smtp.corp.redhat.com (Postfix) id F3A4317103; Thu, 16 Mar 2017 17:14:19 +0000 (UTC) Received: from inaba.usersys.redhat.com (unknown [10.34.129.229]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 793A85C551 for ; Thu, 16 Mar 2017 17:14:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com BD069C0467CB Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com BD069C0467CB From: Andrea Bolognani To: libvir-list@redhat.com Date: Thu, 16 Mar 2017 18:14:09 +0100 Message-Id: <1489684451-9274-3-git-send-email-abologna@redhat.com> In-Reply-To: <1489684451-9274-1-git-send-email-abologna@redhat.com> References: <1489684451-9274-1-git-send-email-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 2/4] qemu: Use generic PCIe Root Ports by default when available 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: , MIME-Version: 1.0 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 16 Mar 2017 17:14:23 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" ioh3420 is emulated Intel hardware, so it always looked quite out of place in aarch64/virt guests. Even for x86/q35 guests, the recently-introduced pcie-root-port is a better choice because, unlike ioh3420, it doesn't require IO space (a farily constrained resource) to work. If pcie-root-port is available in QEMU, use it; ioh3420 is still used as fallback for when pcie-root-port is not available. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D1408808 --- Changes from v1: * Always use pcie-root-port if available, regardless of machine type. src/qemu/qemu_domain_address.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index 64aa4ef..6d3a627 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -1846,13 +1846,15 @@ qemuDomainSupportsPCI(virDomainDefPtr def, =20 =20 static void -qemuDomainPCIControllerSetDefaultModelName(virDomainControllerDefPtr cont) +qemuDomainPCIControllerSetDefaultModelName(virDomainControllerDefPtr cont, + virQEMUCapsPtr qemuCaps) { int *modelName =3D &cont->opts.pciopts.modelName; =20 /* make sure it's not already set */ if (*modelName !=3D VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_NONE) return; + switch ((virDomainControllerModelPCI)cont->model) { case VIR_DOMAIN_CONTROLLER_MODEL_PCI_BRIDGE: *modelName =3D VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PCI_BRIDGE; @@ -1861,7 +1863,12 @@ qemuDomainPCIControllerSetDefaultModelName(virDomain= ControllerDefPtr cont) *modelName =3D VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_I82801B11_BRID= GE; break; case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT_PORT: - *modelName =3D VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_IOH3420; + /* Use generic PCIe Root Ports if available, falling back to + * ioh3420 otherwise */ + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_PCIE_ROOT_PORT)) + *modelName =3D VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PCIE_ROOT_= PORT; + else + *modelName =3D VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_IOH3420; break; case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_SWITCH_UPSTREAM_PORT: *modelName =3D VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_X3130_UPSTREAM; @@ -2143,7 +2150,7 @@ qemuDomainAssignPCIAddresses(virDomainDefPtr def, * device in qemu) for any controller that doesn't yet * have it set. */ - qemuDomainPCIControllerSetDefaultModelName(cont); + qemuDomainPCIControllerSetDefaultModelName(cont, qemuCaps); =20 /* set defaults for any other auto-generated config * options for this controller that haven't been --=20 2.7.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list