From nobody Sun Feb 8 12:39:09 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1645622590671490.10407481253935; Wed, 23 Feb 2022 05:23:10 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-626-HiIzkJm-PfKZlRCNUIGJYA-1; Wed, 23 Feb 2022 08:23:06 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 116381006AAC; Wed, 23 Feb 2022 13:23:01 +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 DF3482B3C2; Wed, 23 Feb 2022 13:23:00 +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 AEF611807D7B; Wed, 23 Feb 2022 13:23:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 21NDKMHT029775 for ; Wed, 23 Feb 2022 08:20:22 -0500 Received: by smtp.corp.redhat.com (Postfix) id 9B9432166B2D; Wed, 23 Feb 2022 13:20:22 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 96BC52166B4C for ; Wed, 23 Feb 2022 13:20:18 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 253FD10726A6 for ; Wed, 23 Feb 2022 13:20:18 +0000 (UTC) Received: from mail-oo1-f45.google.com (mail-oo1-f45.google.com [209.85.161.45]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-102-4YFmYTlGNIW9qU-SGXzy-g-2; Wed, 23 Feb 2022 08:20:16 -0500 Received: by mail-oo1-f45.google.com with SMTP id i10-20020a4aab0a000000b002fccf890d5fso22201698oon.5 for ; Wed, 23 Feb 2022 05:20:16 -0800 (PST) Received: from rekt.ibmuc.com ([191.193.99.92]) by smtp.gmail.com with ESMTPSA id a4sm27646154oaa.42.2022.02.23.05.20.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Feb 2022 05:20:15 -0800 (PST) X-MC-Unique: HiIzkJm-PfKZlRCNUIGJYA-1 X-MC-Unique: 4YFmYTlGNIW9qU-SGXzy-g-2 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=sOKv028TgfHmN0MMZ9FinLLltTwr9Vvd43qMYScO75Q=; b=xz83sou+k98FQX6BELA7o4I1Gvd0JBxZYfp5mAAxYp55d1jchCYMYP4kvAEbViLP9Q 21pSQ7ecna0t4Eq1//L4YrI4rub6VKTbUIL9sRbpUBCDPKZGNu+X56SixaqJlAwh7yvq gp5W/fw2GsghN853v9TQiG2xc6MwMaJQLflhAAPqdy4nniti2kjXMRe007UN7ZXDT2CP nIZ/yZuRQT69HIJ0ocJZJlAtjbfbIU+GoPhMLoOHSJYbGVz1azJiDyk/8oARs2ABYvKX 6CZ/8QNVMui5S85U9A95TqQmYmtk0uecw2IEb5RSQd1krf4tpn3ey417QZ22K835SW4E ZsMA== X-Gm-Message-State: AOAM532CFMFRgNGv9Z6xQFXTD04JAhRcfdbfYsyduWBjUKDOUFLC3vn+ 1zG5kZVIEAwLK3xMAOSiNL1fqfyLTe0= X-Google-Smtp-Source: ABdhPJxyQNAEp481xIiCuZdSaDYOgI+BGsB/YxZHpfIVypNHIosasvC629A4Gzj6wRUE7KIEErtEpQ== X-Received: by 2002:a05:6870:a404:b0:cc:fa24:ca80 with SMTP id m4-20020a056870a40400b000ccfa24ca80mr3812012oal.215.1645622415898; Wed, 23 Feb 2022 05:20:15 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH v3 10/29] conf, qemu: add 'pnv-phb3-root-port' PCI controller model name Date: Wed, 23 Feb 2022 10:19:33 -0300 Message-Id: <20220223131952.922228-11-danielhb413@gmail.com> In-Reply-To: <20220223131952.922228-1-danielhb413@gmail.com> References: <20220223131952.922228-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Cc: danielhb413@gmail.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1645622591515100025 Apart from being usable only with pnv-phb3 PCIE host bridges (to be added soon), this device acts as a regular pcie-root-port but with a specific model name. No doc changes in formatdomain.rst were made because the PCI model name isn't something that users are supposed to be setting or changing. Reviewed-by: J=C3=A1n Tomko Signed-off-by: Daniel Henrique Barboza --- docs/schemas/domaincommon.rng | 1 + src/conf/domain_conf.c | 1 + src/conf/domain_conf.h | 1 + src/qemu/qemu_domain_address.c | 5 +++++ src/qemu/qemu_validate.c | 12 +++++++++++- 5 files changed, 19 insertions(+), 1 deletion(-) diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 964b0c9e2f..ad9432ea3d 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -2602,6 +2602,7 @@ ioh3420 pcie-root-port + pnv-phb3-root-port x3130-upstream diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 34fec887a3..b4f13c4b98 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -438,6 +438,7 @@ VIR_ENUM_IMPL(virDomainControllerPCIModelName, "pcie-root-port", "spapr-pci-host-bridge", "pcie-pci-bridge", + "pnv-phb3-root-port", ); =20 VIR_ENUM_IMPL(virDomainControllerModelSCSI, diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 9fcf842ee7..60be338541 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -646,6 +646,7 @@ typedef enum { VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PCIE_ROOT_PORT, VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_SPAPR_PCI_HOST_BRIDGE, VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PCIE_PCI_BRIDGE, + VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB3_ROOT_PORT, =20 VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_LAST } virDomainControllerPCIModelName; diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index dd0680f57f..56491e04fe 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -2421,6 +2421,11 @@ qemuDomainPCIControllerSetDefaultModelName(virDomain= ControllerDef *cont, *modelName =3D VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PCIE_PCI_BRIDG= E; break; case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT_PORT: + if (qemuDomainIsPowerNV(def)) { + *modelName =3D VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB3_R= OOT_PORT; + break; + } + /* Use generic PCIe Root Ports if available, falling back to * ioh3420 otherwise */ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_PCIE_ROOT_PORT)) diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index ad8f0f94ff..37dcebaca3 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -3433,6 +3433,8 @@ virValidateControllerPCIModelNameToQEMUCaps(int model= Name) return QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE; case VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PCIE_PCI_BRIDGE: return QEMU_CAPS_DEVICE_PCIE_PCI_BRIDGE; + case VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB3_ROOT_PORT: + return QEMU_CAPS_DEVICE_PNV_PHB3; case VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_NONE: return 0; case VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_LAST: @@ -3600,10 +3602,18 @@ qemuValidateDomainDeviceDefControllerPCI(const virD= omainControllerDef *cont, =20 case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT_PORT: if (pciopts->modelName !=3D VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_I= OH3420 && - pciopts->modelName !=3D VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_P= CIE_ROOT_PORT) { + pciopts->modelName !=3D VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_P= CIE_ROOT_PORT && + pciopts->modelName !=3D VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_P= NV_PHB3_ROOT_PORT) { virReportControllerInvalidValue(cont, model, modelName, "model= Name"); return -1; } + + if (pciopts->modelName =3D=3D VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME= _PNV_PHB3_ROOT_PORT && + !qemuDomainIsPowerNV(def)) { + virReportControllerInvalidValue(cont, model, modelName, "model= Name"); + return -1; + } + break; =20 case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_SWITCH_UPSTREAM_PORT: --=20 2.35.1