From nobody Sat Apr 20 08:11:37 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 1633145321644813.9225859794029; Fri, 1 Oct 2021 20:28:41 -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-288-Qr4JNRWAPSWVKDs5Ew3LDQ-1; Fri, 01 Oct 2021 23:28:35 -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 DF1B68145E5; Sat, 2 Oct 2021 03:28:30 +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 98D2760C05; Sat, 2 Oct 2021 03:28:30 +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 68D534E58F; Sat, 2 Oct 2021 03:28:30 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1923RWXE013996 for ; Fri, 1 Oct 2021 23:27:32 -0400 Received: by smtp.corp.redhat.com (Postfix) id 26418214DDD; Sat, 2 Oct 2021 03:27:32 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 20CA2214DDB for ; Sat, 2 Oct 2021 03:27:32 +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 048EA800883 for ; Sat, 2 Oct 2021 03:27:32 +0000 (UTC) Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-445-YGZS560MOl2_G8ymcpZQTA-1; Fri, 01 Oct 2021 23:27:28 -0400 Received: by mail-pf1-f170.google.com with SMTP id h1so5487941pfv.12 for ; Fri, 01 Oct 2021 20:27:28 -0700 (PDT) Received: from anisinha-lenovo.ba.nuagenetworks.net ([115.96.132.98]) by smtp.googlemail.com with ESMTPSA id s10sm8875926pjn.38.2021.10.01.20.27.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Oct 2021 20:27:26 -0700 (PDT) X-MC-Unique: Qr4JNRWAPSWVKDs5Ew3LDQ-1 X-MC-Unique: YGZS560MOl2_G8ymcpZQTA-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=d6jZEtGDEFeLtkCkbHchPcwbjzUTNU7X8rL5pC6A9Xk=; b=wTBKXxw5IEaCtra7wNxRqs/4o0s0C9mCzlgZdUtnKYbyClEdtNW69Q9NzwUi6ihAxQ oiFzwp/RmDJQro7lh8LDetycMpmQAOa+tW+oYGL+0P+Voo3GyUziiNwIcCRXzb6/s4+a ulymRMAe8b3GWasSUQxVbLYSUY11pp1bVuZbE8jHuuSrdf6s2v+TkLoRGBrCTfpuPngg 3yjne4dpcSsaM6ezizmgNbeJpZzuCVEpmqqgyJw/wK6zonEzxYLsQ1tZNFCJHjMRklcs NOSwYuzPMbyHwFJQIPu9Ae6FTlgGL5hc+aYOiqIjG1NpZz+tod1y0ZxrEGNJNM8SM2VX BZ5g== X-Gm-Message-State: AOAM530JOrHSs+Mry3xCLQSCuUHUyCcNVtuzb3CaUPbF+cNiSGSHCj8s C9VbZLujs/If97mPrl3SgSpIHq6rHVKXtw== X-Google-Smtp-Source: ABdhPJyNDI2NHL2+Jq0VWMmhtDP2Wd3/Dam9yi7BhQNF5vJH1VRx8MN9vlaG2houLPnHXo/nsrTIWg== X-Received: by 2002:a63:514e:: with SMTP id r14mr1288290pgl.282.1633145246980; Fri, 01 Oct 2021 20:27:26 -0700 (PDT) From: Ani Sinha To: libvir-list@redhat.com Subject: [PATCH v5 1/4] qemu: capablities: detect presence of acpi-pci-hotplug-with-bridge-support Date: Sat, 2 Oct 2021 08:57:04 +0530 Message-Id: <20211002032707.820361-2-ani@anisinha.ca> In-Reply-To: <20211002032707.820361-1-ani@anisinha.ca> References: <20211002032707.820361-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.79 on 10.11.54.5 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: 1633145322367100001 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 | 4 ++++ src/qemu/qemu_capabilities.h | 2 ++ 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, 19 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 6d1389af87..4b93ae7791 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -644,6 +644,8 @@ VIR_ENUM_IMPL(virQEMUCaps, "virtio-mem-pci", /* QEMU_CAPS_DEVICE_VIRTIO_MEM_PCI */ "memory-backend-file.reserve", /* QEMU_CAPS_MEMORY_BACKEND_R= ESERVE */ "piix4-acpi-root-hotplug-en", /* QEMU_CAPS_PIIX_ACPI_ROOT_PC= I_HOTPLUG */ + "piix4-acpi-hotplug-bridge", /* QEMU_CAPS_PIIX_ACPI_HOTPLUG_= BRIDGE */ + "ich9-acpi-hotplug-bridge", /* QEMU_CAPS_ICH9_ACPI_HOTPLUG_B= RIDGE */ ); =20 =20 @@ -1472,6 +1474,7 @@ static struct virQEMUCapsDevicePropsFlags virQEMUCaps= DevicePropsPiix4PM[] =3D { { "disable_s3", QEMU_CAPS_PIIX_DISABLE_S3, NULL }, { "disable_s4", QEMU_CAPS_PIIX_DISABLE_S4, NULL }, { "acpi-root-pci-hotplug", QEMU_CAPS_PIIX_ACPI_ROOT_PCI_HOTPLUG, NULL = }, + { "acpi-pci-hotplug-with-bridge-support", QEMU_CAPS_PIIX_ACPI_HOTPLUG_= BRIDGE, NULL }, }; =20 static struct virQEMUCapsDevicePropsFlags virQEMUCapsDevicePropsUSBRedir[]= =3D { @@ -1524,6 +1527,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 867c94cb3d..721cfa732e 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -624,6 +624,8 @@ typedef enum { /* virQEMUCapsFlags grouping marker for = syntax-check */ QEMU_CAPS_DEVICE_VIRTIO_MEM_PCI, /* -device virtio-mem-pci */ QEMU_CAPS_MEMORY_BACKEND_RESERVE, /* -object memory-backend-*.reserve= =3D */ QEMU_CAPS_PIIX_ACPI_ROOT_PCI_HOTPLUG, /* -M pc PIIX4_PM.acpi-root-pci-= hotplug */ + 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 */ =20 QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/tests/qemucapabilitiesdata/caps_2.11.0.x86_64.xml b/tests/qemu= capabilitiesdata/caps_2.11.0.x86_64.xml index d6549d6440..0f20a9b5b0 100644 --- a/tests/qemucapabilitiesdata/caps_2.11.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.11.0.x86_64.xml @@ -172,6 +172,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 354a95cebc..e5efd97203 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml @@ -184,6 +184,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 cffe482bf6..713752f8f2 100644 --- a/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml @@ -190,6 +190,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 514e5985ac..4cdba06edb 100644 --- a/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml @@ -194,6 +194,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 5e733fec13..5b9c59cfa7 100644 --- a/tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml @@ -202,6 +202,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 ba9ee0dd96..5bb3856918 100644 --- a/tests/qemucapabilitiesdata/caps_4.1.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_4.1.0.x86_64.xml @@ -209,6 +209,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 034a770b08..77c95496e0 100644 --- a/tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml @@ -220,6 +220,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 aae5fe018f..bf679a715c 100644 --- a/tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml @@ -227,6 +227,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 e9ae3c5abb..8bc898e4db 100644 --- a/tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml @@ -230,6 +230,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 79d36bf19f..5071bcc293 100644 --- a/tests/qemucapabilitiesdata/caps_5.2.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_5.2.0.x86_64.xml @@ -232,6 +232,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 0d8edef6a1..267ccd73a0 100644 --- a/tests/qemucapabilitiesdata/caps_6.0.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_6.0.0.x86_64.xml @@ -240,6 +240,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 7ba3b328ca..8fd236d08c 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 Sat Apr 20 08:11:37 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 1633145339687968.5078269639014; Fri, 1 Oct 2021 20:28:59 -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-546-Scrq2pslM8C-xZMICud0GA-1; Fri, 01 Oct 2021 23:28:57 -0400 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 643E51006AA3; Sat, 2 Oct 2021 03:28:52 +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 410181972D; Sat, 2 Oct 2021 03:28:52 +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 149631800B8B; Sat, 2 Oct 2021 03:28:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1923Rb4D014010 for ; Fri, 1 Oct 2021 23:27:37 -0400 Received: by smtp.corp.redhat.com (Postfix) id A532A10BFD73; Sat, 2 Oct 2021 03:27:37 +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 9EA0F117C2E0 for ; Sat, 2 Oct 2021 03:27:33 +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 DF98B100B8DC for ; Sat, 2 Oct 2021 03:27:32 +0000 (UTC) Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-416-cD8mFDjdMiS1Kk1QbMZ6sw-1; Fri, 01 Oct 2021 23:27:31 -0400 Received: by mail-pj1-f41.google.com with SMTP id me5-20020a17090b17c500b0019af76b7bb4so544544pjb.2 for ; Fri, 01 Oct 2021 20:27:31 -0700 (PDT) Received: from anisinha-lenovo.ba.nuagenetworks.net ([115.96.132.98]) by smtp.googlemail.com with ESMTPSA id s10sm8875926pjn.38.2021.10.01.20.27.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Oct 2021 20:27:29 -0700 (PDT) X-MC-Unique: Scrq2pslM8C-xZMICud0GA-1 X-MC-Unique: cD8mFDjdMiS1Kk1QbMZ6sw-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=Yh9LKFclHFTnlBVgbZkoW34IPMOcS1ZVMuM07tJZeWs=; b=Ey5TlUQb5uzgi50j0gXzrD1Zg9d0uqBbThVIBP1Yqpa6eGZiyTzmh/bEGpbq2kaIMP GQw+AvFTYQt0nB6QPzyZyjGzWShNb0mnF4fnomOhPEJZiLApR/XUV3B7/2tiLDagCEKY XOKeL7HPTK54yzQKfxbdaSS6Z2ETVQ3lEOuaVBLZb0hjo0X1LaPpxm+a7GjW09kFk/dq 0FADHe9hqLrBgkwRnBR0IsdGdqyA4JnupbMb/Trh8TOdv/P+VEANpvBNwiB/plp64OcN L877QnURE3ofv1Gpq2lmzWJ83/o5mCLnv4uZ1lMTBxu1RkclbQgV8wAzwxxcOqmIBuvH DRLw== X-Gm-Message-State: AOAM533GRX8zqaTomcIJ+k6Ql2q5hzSfEgqpkC34jpRwbIhQeX3EGHBu cZid7miz4PlrFR+wJcnW9RnQ8uD5V2B7PA== X-Google-Smtp-Source: ABdhPJwS5HRdzLSRU02YdE2/D4Na5/ZSVVP2wqPjYi563tbAioSbiUimNky8Hw2u75DU1D6a81ZA5A== X-Received: by 2002:a17:90b:1c11:: with SMTP id oc17mr10374143pjb.52.1633145249773; Fri, 01 Oct 2021 20:27:29 -0700 (PDT) From: Ani Sinha To: libvir-list@redhat.com Subject: [PATCH v5 2/4] conf: introduce support for acpi-bridge-hotplug feature Date: Sat, 2 Oct 2021 08:57:05 +0530 Message-Id: <20211002032707.820361-3-ani@anisinha.ca> In-Reply-To: <20211002032707.820361-1-ani@anisinha.ca> References: <20211002032707.820361-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.3 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.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-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1633145340854100001 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 a02802a954..8d916eefa6 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 ec5bd91740..6f33d1e774 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 b8370f6950..229b75fecc 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", @@ -17536,6 +17542,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, @@ -17835,6 +17871,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; } @@ -17843,7 +17883,6 @@ virDomainFeaturesDefParse(virDomainDef *def, return 0; } =20 - static int virDomainDefMaybeAddHostdevSCSIcontroller(virDomainDef *def) { @@ -21521,6 +21560,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: " @@ -21777,6 +21817,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) { @@ -27932,6 +27995,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 e054c1508e..e9902a473d 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, @@ -2800,6 +2807,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]; @@ -3923,6 +3931,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 717b97bf3a..5ef54d437b 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, @@ -294,6 +336,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 + +
+ + + + +