From nobody Sun May 19 05:22:43 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1632975023732958.4509566085351; Wed, 29 Sep 2021 21:10:23 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-401-gz3t15daMTGAoemvKXCuDg-1; Thu, 30 Sep 2021 00:10:21 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id EA0B5801E72; Thu, 30 Sep 2021 04:10:15 +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 C6DD960BE5; Thu, 30 Sep 2021 04:10:15 +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 97B9D4EA38; Thu, 30 Sep 2021 04:10:15 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 18U49xZH016466 for ; Thu, 30 Sep 2021 00:10:00 -0400 Received: by smtp.corp.redhat.com (Postfix) id D49692094D37; Thu, 30 Sep 2021 04:09:59 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CDF692094D20 for ; Thu, 30 Sep 2021 04:09:57 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (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 32542185A79C for ; Thu, 30 Sep 2021 04:09:57 +0000 (UTC) Received: from mail-pg1-f175.google.com (mail-pg1-f175.google.com [209.85.215.175]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-271-FiTjzZb6M3ah6ijCi1XYeg-1; Thu, 30 Sep 2021 00:09:54 -0400 Received: by mail-pg1-f175.google.com with SMTP id s75so4917594pgs.5 for ; Wed, 29 Sep 2021 21:09:53 -0700 (PDT) Received: from anisinha-lenovo.ba.nuagenetworks.net ([115.96.130.103]) by smtp.googlemail.com with ESMTPSA id b5sm1007239pjq.2.2021.09.29.21.09.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Sep 2021 21:09:52 -0700 (PDT) X-MC-Unique: gz3t15daMTGAoemvKXCuDg-1 X-MC-Unique: FiTjzZb6M3ah6ijCi1XYeg-1 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=9hfWom6ugB741SxlqSQ6mcZP11AoaQgztUKk1BjsxKg=; b=vpE01gmwraLCTIy1rTS285tmm8Ojwwoz/QgLuQZNt2MkSCK1gRLHSI7Bs83C/9FlpZ 0ZNgiTRyXo7HcW2JJXScWPjuuYkC1lLe3c8Lj85gykWVHG6XZefQSAeVCb+tH2sopVvb wugZCShXrLh6Bo9LjtMwe2rmchPRFT2F5Zap4/TS0twJN/7SRA8JmUtDvdoOVieflsX3 ctqjOBwL8NJA0O6EaFZVPrCesR96F+lvyidnyZlwb7a++1SjH4sKW2MXbc+UAqeOfVkz Hh3807m4ZhFCRfPxQ14xinvu8Vpr693Iwy+eyOy3WwM4w1EkyBptkxaL0pHjKU6J77ue z9kw== X-Gm-Message-State: AOAM530OAMjltwEBxPgwTImFY8oe+QbVYcu21nJ2W0XTayyVQI2Ev2VT zpFsIS1JXXrJ/7qvqSrXQDzeTq4HiXEUJQ== X-Google-Smtp-Source: ABdhPJxTwFrlasdJV/HhUP4pW/wNw7I/T5IqzaY5SeAn2ybnUQMUB3htz3cohoQDNg34owXXa3Q9vw== X-Received: by 2002:a62:1b92:0:b0:3eb:3f92:724 with SMTP id b140-20020a621b92000000b003eb3f920724mr2288929pfb.3.1632974992521; Wed, 29 Sep 2021 21:09:52 -0700 (PDT) From: Ani Sinha To: libvir-list@redhat.com Subject: [PATCH v4 1/4] qemu: capablities: detect presence of acpi-pci-hotplug-with-bridge-support Date: Thu, 30 Sep 2021 09:39:37 +0530 Message-Id: <20210930040940.742809-2-ani@anisinha.ca> In-Reply-To: <20210930040940.742809-1-ani@anisinha.ca> References: <20210930040940.742809-1-ani@anisinha.ca> 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.4 X-loop: libvir-list@redhat.com Cc: Ani Sinha , jusual@redhat.com, laine@redhat.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.12 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-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1632975024491100001 Content-Type: text/plain; charset="utf-8" qemu added support for i440fx specific global boolean flag PIIX4_PM.acpi-pci-hotplug-with-bridge-support around version 2.1. This flag is enabled by default. When disabled, it turns off acpi pci hotplug for cold plugged pci bridges in i440fx machine types. Very recently, in qemu version 6.1, the same global option was also added f= or q35 machine types as well. ICH9-LPC.acpi-pci-hotplug-with-bridge-support This option turns on or off acpi based hotplug for cold plugged pcie bridges like pcie root ports. This flag is also enabled by default. Please refer to the following qemu changes: c0e427d6eb5fef ("hw/acpi/ich9: Enable ACPI PCI hot-plug") 17858a16950860 ("hw/acpi/ich9: Set ACPI PCI hot-plug as default on Q35") This patch adds the corresponding qemu capabilities in libvirt. For i440fx, the capability is detected as QEMU_CAPS_PIIX_ACPI_HOTPLUG_BRIDGE. For q35, the capability is detected as QEMU_CAPS_ICH9_ACPI_HOTPLUG_BRIDGE. Please note that the test specific qemu capabilities .replies files has alr= eady been updated as a part of regular refreshing them when a new qemu version is released. Hence, no updates to those files are required. Signed-off-by: Ani Sinha Reviewed-by: Laine Stump --- src/qemu/qemu_capabilities.c | 6 ++++++ src/qemu/qemu_capabilities.h | 4 ++++ tests/qemucapabilitiesdata/caps_2.11.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_4.1.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_5.2.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_6.0.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml | 2 ++ 14 files changed, 23 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index db5432c9fc..23ff1c6a08 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -639,6 +639,10 @@ VIR_ENUM_IMPL(virQEMUCaps, "s390-pv-guest", /* QEMU_CAPS_S390_PV_GUEST */ "set-action", /* QEMU_CAPS_SET_ACTION */ "virtio-blk.queue-size", /* QEMU_CAPS_VIRTIO_BLK_QUEUE_SIZE = */ + + /* 410 */ + "piix4-acpi-hotplug-bridge", /* QEMU_CAPS_PIIX_ACPI_HOTPLUG_= BRIDGE */ + "ich9-acpi-hotplug-bridge", /* QEMU_CAPS_ICH9_ACPI_HOTPLUG_B= RIDGE */ ); =20 =20 @@ -1465,6 +1469,7 @@ static struct virQEMUCapsDevicePropsFlags virQEMUCaps= DevicePropsIDEDrive[] =3D { static struct virQEMUCapsDevicePropsFlags virQEMUCapsDevicePropsPiix4PM[] = =3D { { "disable_s3", QEMU_CAPS_PIIX_DISABLE_S3, NULL }, { "disable_s4", QEMU_CAPS_PIIX_DISABLE_S4, NULL }, + { "acpi-pci-hotplug-with-bridge-support", QEMU_CAPS_PIIX_ACPI_HOTPLUG_= BRIDGE, NULL }, }; =20 static struct virQEMUCapsDevicePropsFlags virQEMUCapsDevicePropsUSBRedir[]= =3D { @@ -1517,6 +1522,7 @@ static struct virQEMUCapsDevicePropsFlags virQEMUCaps= DevicePropsVirtioGpu[] =3D { static struct virQEMUCapsDevicePropsFlags virQEMUCapsDevicePropsICH9[] =3D= { { "disable_s3", QEMU_CAPS_ICH9_DISABLE_S3, NULL }, { "disable_s4", QEMU_CAPS_ICH9_DISABLE_S4, NULL }, + { "acpi-pci-hotplug-with-bridge-support", QEMU_CAPS_ICH9_ACPI_HOTPLUG_= BRIDGE, NULL }, }; =20 static struct virQEMUCapsDevicePropsFlags virQEMUCapsDevicePropsUSBNECXHCI= [] =3D { diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 097f28bd40..1c169ce0c1 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -620,6 +620,10 @@ typedef enum { /* virQEMUCapsFlags grouping marker for= syntax-check */ QEMU_CAPS_SET_ACTION, /* 'set-action' QMP command */ QEMU_CAPS_VIRTIO_BLK_QUEUE_SIZE, /* virtio-blk-*.queue-size */ =20 + /* 410 */ + QEMU_CAPS_PIIX_ACPI_HOTPLUG_BRIDGE, /* -M pc PIIX4_PM.acpi-pci-hotplug= -with-bridge-support */ + QEMU_CAPS_ICH9_ACPI_HOTPLUG_BRIDGE, /* -M q35 ICH9-LPC.acpi-pci-hotplu= g-with-bridge-support */ + QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; =20 diff --git a/tests/qemucapabilitiesdata/caps_2.11.0.x86_64.xml b/tests/qemu= capabilitiesdata/caps_2.11.0.x86_64.xml index 1e08a04c82..af06a36bed 100644 --- a/tests/qemucapabilitiesdata/caps_2.11.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.11.0.x86_64.xml @@ -175,6 +175,7 @@ + 2011000 0 43100288 diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml b/tests/qemu= capabilitiesdata/caps_2.12.0.x86_64.xml index 43060efbac..b2694226b1 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml @@ -187,6 +187,7 @@ + 2011090 0 43100289 diff --git a/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_3.0.0.x86_64.xml index 35284d476d..207b63a28f 100644 --- a/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml @@ -193,6 +193,7 @@ + 3000000 0 43100239 diff --git a/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_3.1.0.x86_64.xml index b1f326c32b..7182daf8fd 100644 --- a/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml @@ -197,6 +197,7 @@ + 3000092 0 43100240 diff --git a/tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_4.0.0.x86_64.xml index 512239c6c8..abaf2fbb3a 100644 --- a/tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml @@ -205,6 +205,7 @@ + 4000000 0 43100240 diff --git a/tests/qemucapabilitiesdata/caps_4.1.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_4.1.0.x86_64.xml index 2f7f9caf0c..afc644d410 100644 --- a/tests/qemucapabilitiesdata/caps_4.1.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_4.1.0.x86_64.xml @@ -212,6 +212,7 @@ + 4001000 0 43100241 diff --git a/tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_4.2.0.x86_64.xml index b8d53e0db1..b1e26a33ce 100644 --- a/tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml @@ -223,6 +223,7 @@ + 4002000 0 43100242 diff --git a/tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_5.0.0.x86_64.xml index c8934543bd..872848738b 100644 --- a/tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml @@ -230,6 +230,7 @@ + 5000000 0 43100241 diff --git a/tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_5.1.0.x86_64.xml index f17e502f75..d8c1b242e3 100644 --- a/tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml @@ -232,6 +232,7 @@ + 5001000 0 43100242 diff --git a/tests/qemucapabilitiesdata/caps_5.2.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_5.2.0.x86_64.xml index e09880e937..c7d92dc8a8 100644 --- a/tests/qemucapabilitiesdata/caps_5.2.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_5.2.0.x86_64.xml @@ -233,6 +233,7 @@ + 5002000 0 43100243 diff --git a/tests/qemucapabilitiesdata/caps_6.0.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_6.0.0.x86_64.xml index 571336c1fa..56233acbbf 100644 --- a/tests/qemucapabilitiesdata/caps_6.0.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_6.0.0.x86_64.xml @@ -241,6 +241,7 @@ + 6000000 0 43100242 diff --git a/tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_6.1.0.x86_64.xml index 74b87847d0..58643f02a6 100644 --- a/tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml @@ -243,6 +243,8 @@ + + 6001000 0 43100243 --=20 2.25.1 From nobody Sun May 19 05:22:43 2024 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 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 1632975018984166.1738115256045; Wed, 29 Sep 2021 21:10:18 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-582-5-9vleAxNu6p3TUr2Lkkzg-1; Thu, 30 Sep 2021 00:10:10 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 077735074B; Thu, 30 Sep 2021 04:10:05 +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 47CFE60877; Thu, 30 Sep 2021 04:10:04 +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 3C8044E590; Thu, 30 Sep 2021 04:10:02 +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 18U49xQ6016459 for ; Thu, 30 Sep 2021 00:09:59 -0400 Received: by smtp.corp.redhat.com (Postfix) id 02A1E20B1DB6; Thu, 30 Sep 2021 04:09:59 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EF4BC2166BA4 for ; Thu, 30 Sep 2021 04:09:58 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (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 CFA16811E78 for ; Thu, 30 Sep 2021 04:09:58 +0000 (UTC) Received: from mail-pg1-f178.google.com (mail-pg1-f178.google.com [209.85.215.178]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-581--C3WAUccPrCgura-M8gIAg-1; Thu, 30 Sep 2021 00:09:56 -0400 Received: by mail-pg1-f178.google.com with SMTP id h3so4905194pgb.7 for ; Wed, 29 Sep 2021 21:09:56 -0700 (PDT) Received: from anisinha-lenovo.ba.nuagenetworks.net ([115.96.130.103]) by smtp.googlemail.com with ESMTPSA id b5sm1007239pjq.2.2021.09.29.21.09.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Sep 2021 21:09:54 -0700 (PDT) X-MC-Unique: 5-9vleAxNu6p3TUr2Lkkzg-1 X-MC-Unique: -C3WAUccPrCgura-M8gIAg-1 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=+eeK3Fc77UWD3gIr/6Z7ZCpeUBNwrSEY76jW00piEY8=; b=aTCBs6DcV+0Mxt+h/jXSrNsjM9yrLOs6JKigvpKPebiC0Jv0ClZs4etMNW03198QpU h5Jp7lb29dFvmFHq9Xh3oAizvi+inj4pztC7qy97kBgwjzqa8A5MfYYKllFFsGigVl29 64fwg/KkGpRvUfKTt5lJCF2ZtDTQStcY6vnoDHAWQHIqeDtHH8BuCkxuNwAd3tblIqWi oX1kdAe3HXPE/QSKMPh1ZANivJbaSxLpO2LjKBEss/BhiRwbYuXCkSvmQdISxqwcDqUp /ZXre51YdTxCFZ9w9ILpgcMs5WdkKXVZbvKQqTwanEGsQSEV1dcEfo2jKDddXUmr2jDC 5LWw== X-Gm-Message-State: AOAM5335m4Hx0T41Itn4gPdLQLCGy87elQPNzrNy5y6ZVGAqJXf5wCap WiK0j4ob22fuH0y4AaVS9DBuL8iF+fQhmg== X-Google-Smtp-Source: ABdhPJweLPUjKSiOJQVx2XXI0UorlhMmua+7Y2AB4kAWA+RmKp44CUzVtGvdX2D2nwVHFDivXzi7hQ== X-Received: by 2002:a63:b349:: with SMTP id x9mr3043192pgt.139.1632974994969; Wed, 29 Sep 2021 21:09:54 -0700 (PDT) From: Ani Sinha To: libvir-list@redhat.com Subject: [PATCH v4 2/4] conf: introduce support for acpi-bridge-hotplug feature Date: Thu, 30 Sep 2021 09:39:38 +0530 Message-Id: <20210930040940.742809-3-ani@anisinha.ca> In-Reply-To: <20210930040940.742809-1-ani@anisinha.ca> References: <20210930040940.742809-1-ani@anisinha.ca> 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: Ani Sinha , jusual@redhat.com, laine@redhat.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.13 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-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1632975020266100001 Content-Type: text/plain; charset="utf-8" This change introduces a new libvirt sub-element under that can be used to configure all pci related features. Currently the only sub-sub element supported by this sub-element is 'acpi-bridge-hotplug' as shown below: The above option is only available for qemu driver and that too for x86 gue= sts only. It is a global option. 'acpi-bridge-hotplug' option enables or disables ACPI hotplug support for cold-plugged pci bridges. Examples of bridges include PCI-PCI bridge (pci-bridge controller) or PCIe-PCI bridges for pc machines and pcie-root-port controller for q35 machines. Being global option, no other bridge specific option are required. For pc machine type in x86, this option is available in qemu for a long time, from version 2.1. Please see the following changes in qemu repo: 9e047b982452c6 ("piix4: add acpi pci hotplug support") 133a2da488062e ("pc: acpi: generate AML only for PCI0 devices if PCI bridge= hotplug is disabled") For q35 machine type, this was introduced in qemu 6.1 with the following changes in qemu repo: (a) c0e427d6eb5fef ("hw/acpi/ich9: Enable ACPI PCI hot-plug") (b) 17858a16950860 ("hw/acpi/ich9: Set ACPI PCI hot-plug as default on Q35") The reasons for enabling ACPI based hotplug for PCIe (q35) based machines (= as opposed to native hotplug) are outlined in (b). There are use cases where u= sers would still want to use native hotplug. Therefore, this config option enables users to choose either ACPI based hotplug or native hotplug for bri= dges (for example for pcie root port controller in q35 machines). Qemu capability validation checks have also been added along with related u= nit tests to exercise the new conf option. Signed-off-by: Ani Sinha --- docs/formatdomain.rst | 11 +++ docs/schemas/domaincommon.rng | 15 ++++ src/conf/domain_conf.c | 89 ++++++++++++++++++- src/conf/domain_conf.h | 9 ++ src/qemu/qemu_validate.c | 46 ++++++++++ .../aarch64-acpi-hotplug-bridge-disable.xml | 33 +++++++ .../pc-i440fx-acpi-hotplug-bridge-disable.xml | 33 +++++++ .../pc-i440fx-acpi-hotplug-bridge-enable.xml | 33 +++++++ .../q35-acpi-hotplug-bridge-disable.xml | 47 ++++++++++ .../q35-acpi-hotplug-bridge-enable.xml | 47 ++++++++++ .../pc-i440fx-acpi-hotplug-bridge-disable.xml | 1 + .../pc-i440fx-acpi-hotplug-bridge-enable.xml | 1 + .../q35-acpi-hotplug-bridge-disable.xml | 1 + .../q35-acpi-hotplug-bridge-enable.xml | 1 + tests/qemuxml2xmltest.c | 14 +++ 15 files changed, 380 insertions(+), 1 deletion(-) create mode 100644 tests/qemuxml2argvdata/aarch64-acpi-hotplug-bridge-disa= ble.xml create mode 100644 tests/qemuxml2argvdata/pc-i440fx-acpi-hotplug-bridge-di= sable.xml create mode 100644 tests/qemuxml2argvdata/pc-i440fx-acpi-hotplug-bridge-en= able.xml create mode 100644 tests/qemuxml2argvdata/q35-acpi-hotplug-bridge-disable.= xml create mode 100644 tests/qemuxml2argvdata/q35-acpi-hotplug-bridge-enable.x= ml create mode 120000 tests/qemuxml2xmloutdata/pc-i440fx-acpi-hotplug-bridge-= disable.xml create mode 120000 tests/qemuxml2xmloutdata/pc-i440fx-acpi-hotplug-bridge-= enable.xml create mode 120000 tests/qemuxml2xmloutdata/q35-acpi-hotplug-bridge-disabl= e.xml create mode 120000 tests/qemuxml2xmloutdata/q35-acpi-hotplug-bridge-enable= .xml diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 0f5d833521..86933f1a50 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -1847,6 +1847,9 @@ Hypervisors may allow certain CPU / machine features = to be toggled on/off. + + + @@ -1942,6 +1945,14 @@ are: passthrough Enable IOMMU mappings allowing PCI passthrough on, off; mod= e - optional string sync_pt or share_pt :since:`6.3.0` =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D =20 +``pci`` + Various PCI bus related features of the hypervisor. + =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + Feature Description = Value Since + =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + acpi-bridge-hotplug Enable ACPI based hotplug on the cold-plugged PCI = bridges (pc) and pcie-root-ports (q35) on, off :since:`7.8.0 (QEMU 6.1.0)` + =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + ``pmu`` Depending on the ``state`` attribute (values ``on``, ``off``, default `= `on``) enable or disable the performance monitoring unit for the guest. diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index fdc04f90aa..2da84895ce 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -6169,6 +6169,9 @@ + + + @@ -6400,6 +6403,18 @@ =20 + + + + + + + + + + + + diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index f7025bffe4..051ee82797 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -172,6 +172,7 @@ VIR_ENUM_IMPL(virDomainFeature, "cfpc", "sbbc", "ibs", + "pci", ); =20 VIR_ENUM_IMPL(virDomainCapabilitiesPolicy, @@ -212,6 +213,11 @@ VIR_ENUM_IMPL(virDomainXen, "passthrough", ); =20 +VIR_ENUM_IMPL(virDomainPCI, + VIR_DOMAIN_PCI_LAST, + "acpi-bridge-hotplug", +); + VIR_ENUM_IMPL(virDomainXenPassthroughMode, VIR_DOMAIN_XEN_PASSTHROUGH_MODE_LAST, "default", @@ -17451,6 +17457,36 @@ virDomainFeaturesKVMDefParse(virDomainDef *def, return 0; } =20 +static int +virDomainFeaturesPCIDefParse(virDomainDef *def, + xmlNodePtr node) +{ + def->features[VIR_DOMAIN_FEATURE_PCI] =3D VIR_TRISTATE_SWITCH_ON; + + node =3D xmlFirstElementChild(node); + while (node) { + int feature; + virTristateSwitch value; + + feature =3D virDomainPCITypeFromString((const char *)node->name); + if (feature < 0) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("unsupported PCI feature: %s"), + node->name); + return -1; + } + + if (virXMLPropTristateSwitch(node, "state", VIR_XML_PROP_REQUIRED, + &value) < 0) + return -1; + + def->pci_features[feature] =3D value; + + node =3D xmlNextElementSibling(node); + } + + return 0; +} =20 static int virDomainFeaturesXENDefParse(virDomainDef *def, @@ -17750,6 +17786,10 @@ virDomainFeaturesDefParse(virDomainDef *def, break; } =20 + case VIR_DOMAIN_FEATURE_PCI: + if (virDomainFeaturesPCIDefParse(def, nodes[i]) < 0) + return -1; + case VIR_DOMAIN_FEATURE_LAST: break; } @@ -17758,7 +17798,6 @@ virDomainFeaturesDefParse(virDomainDef *def, return 0; } =20 - static int virDomainDefMaybeAddHostdevSCSIcontroller(virDomainDef *def) { @@ -21436,6 +21475,7 @@ virDomainDefFeaturesCheckABIStability(virDomainDef = *src, case VIR_DOMAIN_FEATURE_HTM: case VIR_DOMAIN_FEATURE_NESTED_HV: case VIR_DOMAIN_FEATURE_CCF_ASSIST: + case VIR_DOMAIN_FEATURE_PCI: if (src->features[i] !=3D dst->features[i]) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("State of feature '%s' differs: " @@ -21692,6 +21732,29 @@ virDomainDefFeaturesCheckABIStability(virDomainDef= *src, } } =20 + /* pci */ + if (src->features[VIR_DOMAIN_FEATURE_PCI] =3D=3D VIR_TRISTATE_SWITCH_O= N) { + for (i =3D 0; i < VIR_DOMAIN_PCI_LAST; i++) { + switch ((virDomainPCI) i) { + case VIR_DOMAIN_PCI_ACPI_BRIDGE_HP: + if (src->pci_features[i] !=3D dst->pci_features[i]) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("State of PCI feature '%s' differs: " + "source: '%s', destination: '%s'"), + virDomainPCITypeToString(i), + virTristateSwitchTypeToString(src->pci_= features[i]), + virTristateSwitchTypeToString(dst->pci_= features[i])); + return false; + } + + break; + + case VIR_DOMAIN_PCI_LAST: + break; + } + } + } + /* smm */ if (src->features[VIR_DOMAIN_FEATURE_SMM] =3D=3D VIR_TRISTATE_SWITCH_O= N) { if (src->tseg_specified !=3D dst->tseg_specified) { @@ -27817,6 +27880,30 @@ virDomainDefFormatFeatures(virBuffer *buf, virDomainIBSTypeToString(def->features[i])); break; =20 + case VIR_DOMAIN_FEATURE_PCI: + if (def->features[i] !=3D VIR_TRISTATE_SWITCH_ON) + break; + + virBufferAddLit(&childBuf, "\n"); + virBufferAdjustIndent(&childBuf, 2); + for (j =3D 0; j < VIR_DOMAIN_PCI_LAST; j++) { + switch ((virDomainPCI) j) { + case VIR_DOMAIN_PCI_ACPI_BRIDGE_HP: + if (def->pci_features[j]) + virBufferAsprintf(&childBuf, "<%s state=3D'%s'/>\n= ", + virDomainPCITypeToString(j), + virTristateSwitchTypeToString( + def->pci_features[j])); + break; + + case VIR_DOMAIN_PCI_LAST: + break; + } + } + virBufferAdjustIndent(&childBuf, -2); + virBufferAddLit(&childBuf, "\n"); + break; + case VIR_DOMAIN_FEATURE_LAST: break; } diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 688a842660..bf762bbe75 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2043,6 +2043,7 @@ typedef enum { VIR_DOMAIN_FEATURE_CFPC, VIR_DOMAIN_FEATURE_SBBC, VIR_DOMAIN_FEATURE_IBS, + VIR_DOMAIN_FEATURE_PCI, =20 VIR_DOMAIN_FEATURE_LAST } virDomainFeature; @@ -2068,6 +2069,12 @@ typedef enum { VIR_DOMAIN_HYPERV_LAST } virDomainHyperv; =20 +typedef enum { + VIR_DOMAIN_PCI_ACPI_BRIDGE_HP =3D 0, + + VIR_DOMAIN_PCI_LAST +} virDomainPCI; + typedef enum { VIR_DOMAIN_KVM_HIDDEN =3D 0, VIR_DOMAIN_KVM_DEDICATED, @@ -2794,6 +2801,7 @@ struct _virDomainDef { int features[VIR_DOMAIN_FEATURE_LAST]; int caps_features[VIR_DOMAIN_PROCES_CAPS_FEATURE_LAST]; int hyperv_features[VIR_DOMAIN_HYPERV_LAST]; + int pci_features[VIR_DOMAIN_PCI_LAST]; int kvm_features[VIR_DOMAIN_KVM_LAST]; int msrs_features[VIR_DOMAIN_MSRS_LAST]; int xen_features[VIR_DOMAIN_XEN_LAST]; @@ -3907,6 +3915,7 @@ VIR_ENUM_DECL(virDomainGraphicsSpiceStreamingMode); VIR_ENUM_DECL(virDomainGraphicsSpiceMouseMode); VIR_ENUM_DECL(virDomainGraphicsVNCSharePolicy); VIR_ENUM_DECL(virDomainHyperv); +VIR_ENUM_DECL(virDomainPCI); VIR_ENUM_DECL(virDomainKVM); VIR_ENUM_DECL(virDomainXen); VIR_ENUM_DECL(virDomainXenPassthroughMode); diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 13fbfd01b2..45cb800350 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -173,6 +173,48 @@ qemuValidateDomainDefPSeriesFeature(const virDomainDef= *def, return 0; } =20 +static int +qemuValidateDomainDefPCIFeature(const virDomainDef *def, + virQEMUCaps *qemuCaps, + int feature) +{ + size_t i; + bool q35Dom =3D qemuDomainIsQ35(def); + bool q35cap =3D q35Dom && virQEMUCapsGet(qemuCaps, + QEMU_CAPS_ICH9_ACPI_HOTPLUG_BRI= DGE); + + if (def->features[feature] =3D=3D VIR_TRISTATE_SWITCH_ABSENT) + return 0; + + for (i =3D 0; i < VIR_DOMAIN_PCI_LAST; i++) { + if (def->pci_features[i] =3D=3D VIR_TRISTATE_SWITCH_ABSENT) + continue; + + switch ((virDomainPCI) i) { + case VIR_DOMAIN_PCI_ACPI_BRIDGE_HP: + if (!ARCH_IS_X86(def->os.arch)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("acpi-bridge-hotplug is not available= " + "for architecture '%s'"), + virArchToString(def->os.arch)); + return -1; + } + if (!q35cap && + !virQEMUCapsGet(qemuCaps, + QEMU_CAPS_PIIX_ACPI_HOTPLUG_BRIDGE)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("acpi-bridge-hotplug is not available= " + "with this QEMU binary")); + return -1; + } + break; + + case VIR_DOMAIN_PCI_LAST: + break; + } + } + return 0; +} =20 static int qemuValidateDomainDefFeatures(const virDomainDef *def, @@ -301,6 +343,10 @@ qemuValidateDomainDefFeatures(const virDomainDef *def, } break; =20 + case VIR_DOMAIN_FEATURE_PCI: + if (qemuValidateDomainDefPCIFeature(def, qemuCaps, i) < 0) + return -1; + break; case VIR_DOMAIN_FEATURE_SMM: case VIR_DOMAIN_FEATURE_KVM: case VIR_DOMAIN_FEATURE_XEN: diff --git a/tests/qemuxml2argvdata/aarch64-acpi-hotplug-bridge-disable.xml= b/tests/qemuxml2argvdata/aarch64-acpi-hotplug-bridge-disable.xml new file mode 100644 index 0000000000..0d5f945bd7 --- /dev/null +++ b/tests/qemuxml2argvdata/aarch64-acpi-hotplug-bridge-disable.xml @@ -0,0 +1,33 @@ + + i440fx + 56f5055c-1b8d-490c-844a-ad646a1caaaa + 1048576 + 1048576 + 1 + + hvm + + + + + + + + + destroy + restart + destroy + + /usr/bin/qemu-system-aarch64 + +
+ + + + +