From nobody Sun Feb 8 16:30:57 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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.129.124]) by mx.zohomail.com with SMTPS id 164562256983951.9212961688487; Wed, 23 Feb 2022 05:22:49 -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-295-UhpOtADIPQqqlmvyVGORWw-1; Wed, 23 Feb 2022 08:22:45 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 364D48145FF; Wed, 23 Feb 2022 13:22:39 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 132BB7A525; Wed, 23 Feb 2022 13:22:39 +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 D42AB44A5F; Wed, 23 Feb 2022 13:22:38 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 21NDKGq8029728 for ; Wed, 23 Feb 2022 08:20:16 -0500 Received: by smtp.corp.redhat.com (Postfix) id 9D886492D4F; Wed, 23 Feb 2022 13:20:16 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 98FF1492D4D for ; Wed, 23 Feb 2022 13:20:16 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.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 80A3A85A5BC for ; Wed, 23 Feb 2022 13:20:16 +0000 (UTC) Received: from mail-oi1-f179.google.com (mail-oi1-f179.google.com [209.85.167.179]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-532-d56dj2wAOj2bhksilFGfXw-2; Wed, 23 Feb 2022 08:20:14 -0500 Received: by mail-oi1-f179.google.com with SMTP id p15so18210018oip.3 for ; Wed, 23 Feb 2022 05:20:14 -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.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Feb 2022 05:20:14 -0800 (PST) X-MC-Unique: UhpOtADIPQqqlmvyVGORWw-1 X-MC-Unique: d56dj2wAOj2bhksilFGfXw-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=0ZUwk/rhuWdncF1gCoT/4y6kzTIosA6ZxhlVjgx8Qls=; b=x15BESu+Y7x0JalPI5mF6Al6dkq9jKgTT9h/TsNfOPIyG6OLIFgGuTb8ZHipDQLZAl a60OFSiWG20yi4FvkedjytS2quC1JTeN/Ovsut3dkXROAfGcTWWEFz2jfccKTZ8bAKx0 ACZR7RiqLwfp7L4TgIs2iYNY6hrUtHgYDgi2FMYXgyApkoE2DWSU4K241AilH7M2pH/O 28wZS/WMQXUivPPHVXf9z6v8fC77I+DU50qzOreTmUKTdA9fX7cx2YwxQgNAFfqlVkf/ 60j+f658qo8ZMostN31/5sGa/kwIUwzcuPamIlkqEFZpsY4JhGkvR47wsjhvT5oqsjZ/ x/ow== X-Gm-Message-State: AOAM533XztgFynQkcv7HQG09myuSmv88E9CR4/UwZHVbbzk4NagHyJFD Z8gDCCCDy9CKLa+8LWpjok5aQ4mcT/4= X-Google-Smtp-Source: ABdhPJzPGMgkNMB3DAxquM6pg6zAsGeLR55MfqojdnOZYkYsEKt4qGDD29nszRYBBvX4Ad08lMu2Yg== X-Received: by 2002:a05:6808:1b27:b0:2d5:38fc:26f with SMTP id bx39-20020a0568081b2700b002d538fc026fmr4621389oib.42.1645622414384; Wed, 23 Feb 2022 05:20:14 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH v3 09/29] qemu: introduce QEMU_CAPS_DEVICE_PNV_PHB3 Date: Wed, 23 Feb 2022 10:19:32 -0300 Message-Id: <20220223131952.922228-10-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.85 on 10.11.54.9 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.79 on 10.5.11.11 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: 1645622571436100003 QEMU_CAPS_DEVICE_PNV_PHB3 indicates binary support for the pnv-phb3 device, the pcie-root controller for PowerNV8 domains, and also the pnv-phb3-root-port device, its pcie-root-port device. This capability is present in QEMU since 5.0.0 but these devices are user-creatable only after QEMU 6.2.0. This means that probing it as default will be misleading for users. Instead, let's use virQEMUCapsInitQMPVersionCaps() to check for the adequate QEMU version and arch, clearing the capability if necessary. Suggested-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko Signed-off-by: Daniel Henrique Barboza --- src/qemu/qemu_capabilities.c | 11 +++++++++++ src/qemu/qemu_capabilities.h | 3 +++ tests/qemucapabilitiesdata/caps_5.0.0.ppc64.xml | 1 + tests/qemucapabilitiesdata/caps_5.2.0.ppc64.xml | 1 + tests/qemucapabilitiesdata/caps_6.2.0.ppc64.xml | 1 + tests/qemucapabilitiesdata/caps_7.0.0.ppc64.xml | 1 + 6 files changed, 18 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 28e7820d0e..dbd9065a99 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -665,6 +665,9 @@ VIR_ENUM_IMPL(virQEMUCaps, "virtio-mem-pci.prealloc", /* QEMU_CAPS_DEVICE_VIRTIO_MEM_PC= I_PREALLOC */ "calc-dirty-rate", /* QEMU_CAPS_CALC_DIRTY_RATE */ "dirtyrate-param.mode", /* QEMU_CAPS_DIRTYRATE_MODE */ + + /* 425 */ + "pnv-phb3", /* QEMU_CAPS_DEVICE_PNV_PHB3 */ ); =20 =20 @@ -1401,6 +1404,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[= ] =3D { { "virtio-vga-gl", QEMU_CAPS_VIRTIO_VGA_GL }, { "s390-pv-guest", QEMU_CAPS_S390_PV_GUEST }, { "virtio-mem-pci", QEMU_CAPS_DEVICE_VIRTIO_MEM_PCI }, + { "pnv-phb3", QEMU_CAPS_DEVICE_PNV_PHB3 }, }; =20 =20 @@ -5243,6 +5247,13 @@ virQEMUCapsInitQMPVersionCaps(virQEMUCaps *qemuCaps) */ if (qemuCaps->version < 5002000) virQEMUCapsSet(qemuCaps, QEMU_CAPS_ENABLE_FIPS); + + /* PowerNV pnv-phb devices weren't user creatable up to + * QEMU 6.2.0. The version value set here was taken from a + * binary post 6.2.0 release that has user creatable pnv-phb + * support. */ + if (qemuCaps->version <=3D 6002000 && ARCH_IS_PPC64(qemuCaps->arch)) + virQEMUCapsClear(qemuCaps, QEMU_CAPS_DEVICE_PNV_PHB3); } =20 =20 diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index f6188b42de..47845fbc59 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -641,6 +641,9 @@ typedef enum { /* virQEMUCapsFlags grouping marker for = syntax-check */ QEMU_CAPS_CALC_DIRTY_RATE, /* accepts calc-dirty-rate */ QEMU_CAPS_DIRTYRATE_MODE , /* calc-dirty-rate accepts mode parameter */ =20 + /* 425 */ + QEMU_CAPS_DEVICE_PNV_PHB3, /* devices pnv-phb3 and pnv-phb3-root-port = */ + QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; =20 diff --git a/tests/qemucapabilitiesdata/caps_5.0.0.ppc64.xml b/tests/qemuca= pabilitiesdata/caps_5.0.0.ppc64.xml index 070d0f2982..adaa13f6e1 100644 --- a/tests/qemucapabilitiesdata/caps_5.0.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_5.0.0.ppc64.xml @@ -186,6 +186,7 @@ + 5000000 0 42900241 diff --git a/tests/qemucapabilitiesdata/caps_5.2.0.ppc64.xml b/tests/qemuca= pabilitiesdata/caps_5.2.0.ppc64.xml index e050514fc1..4c3526f499 100644 --- a/tests/qemucapabilitiesdata/caps_5.2.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_5.2.0.ppc64.xml @@ -190,6 +190,7 @@ + 5002000 0 42900243 diff --git a/tests/qemucapabilitiesdata/caps_6.2.0.ppc64.xml b/tests/qemuca= pabilitiesdata/caps_6.2.0.ppc64.xml index 9fe9c27d14..7dfe86ba30 100644 --- a/tests/qemucapabilitiesdata/caps_6.2.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_6.2.0.ppc64.xml @@ -201,6 +201,7 @@ + 6002000 0 42900244 diff --git a/tests/qemucapabilitiesdata/caps_7.0.0.ppc64.xml b/tests/qemuca= pabilitiesdata/caps_7.0.0.ppc64.xml index 5d7f283a73..57c5ead7a4 100644 --- a/tests/qemucapabilitiesdata/caps_7.0.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_7.0.0.ppc64.xml @@ -202,6 +202,7 @@ + 6002050 0 42900243 --=20 2.35.1