From nobody Mon Feb 9 22:38:48 2026 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 1631417284277488.65896442653843; Sat, 11 Sep 2021 20:28:04 -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-51-cDaiREivNJCd0r0qYvMh3w-1; Sat, 11 Sep 2021 23:27:29 -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 8CD57362FC; Sun, 12 Sep 2021 03:27:24 +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 6C72119C59; Sun, 12 Sep 2021 03:27:24 +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 378874EA29; Sun, 12 Sep 2021 03:27:24 +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 18C3QuMc032426 for ; Sat, 11 Sep 2021 23:26:56 -0400 Received: by smtp.corp.redhat.com (Postfix) id AC501202DCF2; Sun, 12 Sep 2021 03:26:56 +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 A7A8D2026D65 for ; Sun, 12 Sep 2021 03:26:53 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.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 7C39D800883 for ; Sun, 12 Sep 2021 03:26:53 +0000 (UTC) Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-196-GFRoMY_9MpGMFQ-OtVVngw-1; Sat, 11 Sep 2021 23:26:51 -0400 Received: by mail-pj1-f47.google.com with SMTP id rj12-20020a17090b3e8c00b001991428ded8so3243300pjb.1 for ; Sat, 11 Sep 2021 20:26:51 -0700 (PDT) Received: from anisinha-lenovo.ba.nuagenetworks.net ([115.96.79.166]) by smtp.googlemail.com with ESMTPSA id w5sm2854343pfu.160.2021.09.11.20.26.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Sep 2021 20:26:49 -0700 (PDT) X-MC-Unique: cDaiREivNJCd0r0qYvMh3w-1 X-MC-Unique: GFRoMY_9MpGMFQ-OtVVngw-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=OvaSdEqYiQlSMXptUFECgZEIr28T4y5TLwn2vhh1H80=; b=SapCTN+qZ+h4kLz3asVLvHDyHFm6LjyPZ4CKTcWNzrUNQtpDWr9nof1ehB3kAl8Afx tGukMp2gJHBM48AZY6CYK8Tk9Bt7s5GECdFbSzmTJRtC3a7xe5nSPdoKY+W1CC5lUDsd m9XQ63f2TifMjutKR5geHaY4uMLwICmMudPA+kLNGhCgsJc4hXLjJGrPGmuVLFDpbyQ+ ipK79zKSPr9RbFXtZUnV2rGCVrdcHdbNMxXOvhfTvNEKM+cBHkb0cLMWq/OQ28jz7wWO rqmTt8Cg4JjWXeHcm8+1Zx78iHOYkBL2Xci7MWrEHlg/cNvfYQUYhERMtdGjRF/6T6x6 yW2g== X-Gm-Message-State: AOAM532eIrnnBGQyR01CRojJcd57Sy9Mh7sMIgBhga4YA4IZ/91nKKMt 8jyI5R5Oj/7lK93Y3clfDRTpMSr4enY/Zg== X-Google-Smtp-Source: ABdhPJwhyd/cn5SrC54AgCggRzmf8dLe8CWR/tNGV2kvfj9KarlZybkr/i8ELSSQifE3XMURuRBD9A== X-Received: by 2002:a17:90a:e612:: with SMTP id j18mr5420376pjy.163.1631417210162; Sat, 11 Sep 2021 20:26:50 -0700 (PDT) From: Ani Sinha To: libvir-list@redhat.com Subject: [PATCH v3 3/5] conf: introduce acpi-hotplug-bridge and acpi-root-hotplug pm options Date: Sun, 12 Sep 2021 08:56:29 +0530 Message-Id: <20210912032631.2853520-4-ani@anisinha.ca> In-Reply-To: <20210912032631.2853520-1-ani@anisinha.ca> References: <20210912032631.2853520-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@anisinha.ca, 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: 1631417285062100003 Content-Type: text/plain; charset="utf-8" This change introduces libvirt xml support for the following two pm options: The above two options are only available for qemu driver and that too for x= 86 guests only. Both of them are global options. 'acpi-hotplug-bridge' option enables or disables ACPI hotplug support for c= old plugged bridges. Examples of cold plugged bridges include PCI-PCI bridge (pci-bridge controller) for pc machines and pcie-root-port controller for q= 35 machines. Being global options, no other bridge specific options for pci-br= idge controller or pcie-root-port controllers 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 changes in qemu.git: 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.git: (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). It is possible that some us= ers might still want to use native hotplug on PCIe. Therefore, this config opti= on enables users to choose either ACPI based hotplug or native hotplug for cold plugged bridges (for example for pcie root port controller in q35 machines). 'acpi-root-hotplug' option enables or disables ACPI based hotplug for PCI r= oot bus (pci-root controller). This option is only available for pc machine typ= e. This additional option enables users to disable hotplug for all devices in = the system without adding an additional PCI-PCI bridge, putting the devices beh= ind the bridge and using the existing "acpi-hotplug-bridge" option to disable hotplug on that bridge. This feature was introduced from qemu version 5.2 w= ith the following change in qemu.git: 3d7e78aa7777f ("Introduce a new flag for i440fx to disable PCI hotplug on t= he root bus") The above qemu commit describes some compelling reasons why users might to disable hotplug on PCI root buses. This change also adds related unit tests to exercise the new conf options. Signed-off-by: Ani Sinha --- docs/formatdomain.rst | 36 ++++++++++++--- docs/schemas/domaincommon.rng | 17 +++++++ src/conf/domain_conf.c | 21 ++++++++- src/conf/domain_conf.h | 2 + .../pc-i440fx-acpi-hotplug-bridge-disable.xml | 17 +++++++ .../pc-i440fx-acpi-root-hotplug-disable.xml | 17 +++++++ .../q35-acpi-hotplug-bridge-disable.xml | 17 +++++++ .../pc-i440fx-acpi-hotplug-bridge-disable.xml | 31 +++++++++++++ .../pc-i440fx-acpi-root-hotplug-disable.xml | 31 +++++++++++++ .../q35-acpi-hotplug-bridge-disable.xml | 45 +++++++++++++++++++ tests/qemuxml2xmltest.c | 9 ++++ 11 files changed, 236 insertions(+), 7 deletions(-) create mode 100644 tests/qemuxml2argvdata/pc-i440fx-acpi-hotplug-bridge-di= sable.xml create mode 100644 tests/qemuxml2argvdata/pc-i440fx-acpi-root-hotplug-disa= ble.xml create mode 100644 tests/qemuxml2argvdata/q35-acpi-hotplug-bridge-disable.= xml create mode 100644 tests/qemuxml2xmloutdata/pc-i440fx-acpi-hotplug-bridge-= disable.xml create mode 100644 tests/qemuxml2xmloutdata/pc-i440fx-acpi-root-hotplug-di= sable.xml create mode 100644 tests/qemuxml2xmloutdata/q35-acpi-hotplug-bridge-disabl= e.xml diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index ad3b4ea92c..c8b04c625c 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -1793,16 +1793,40 @@ advertisements to the guest OS. (NB: Only qemu driv= er support) + + ... =20 ``pm`` - These elements enable ('yes') or disable ('no') BIOS support for S3 - (suspend-to-mem) and S4 (suspend-to-disk) ACPI sleep states. If nothing= is - specified, then the hypervisor will be left with its default value. - Note: This setting cannot prevent the guest OS from performing a suspen= d as - the guest OS itself can choose to circumvent the unavailability of the = sleep - states (e.g. S4 by turning off completely). + These elements enable ('yes') or disable ('no') certain BIOS advertisem= ents. + If nothing is specified, then the hypervisor will be left with its defa= ult value. + The following BIOS options are available: + +``suspend-to-mem`` + support for S3 (suspend-to-mem) ACPI sleep states. +``suspend-to-disk`` + support for S4 (suspend-to-disk) ACPI sleep states. + + Note that for the above two options, the setting cannot prevent the gue= st OS + from performing a suspend as the guest OS itself can choose to circumve= nt the + unavailability of the sleep states (e.g. S4 by turning off completely). + +``acpi-hotplug-bridge`` + :since:`Since 7.8.0` This option enables or disables BIOS ACPI based ho= tplug support + for cold plugged bridges. It is available only for x86 guests, both for= q35 and pc + machine types. For pc machines, the support is available from `QEMU 2.1= 2`. For q35 + machines, the support is available from `QEMU 6.1`. Examples of cold pl= ugged bridges + include PCI-PCI bridges for pc machine types (pci-bridge controller). F= or q35 machines, + it includes PCIE root ports (pcie-root-port controller). This is a glob= al option that + affects all bridges. No other bridge specific option is required to be = specified. + +``acpi-root-hotplug`` + :since:`Since 7.8.0 (QEMU 5.2)` This option enables or disables BIOS AC= PI based + hotplug support for PCI root bus (pci-root controller). This is availab= le only + for x86 guests, only for pc machine type. For q35 machines, PCIE root c= omplex, + the pcie-root controller, does not support hotplug capability. This is = also a global + option. =20 :anchor:`` =20 diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 11fa24f398..a51efb933d 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -4333,6 +4333,16 @@ + + + + + + + + + + @@ -4344,6 +4354,13 @@ + + + + + + +