<div dir="auto">Ping again </div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Sep 20, 2021 at 21:25 Ani Sinha <<a href="mailto:ani@anisinha.ca">ani@anisinha.ca</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto">Ping </div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Sep 13, 2021 at 1:39 PM Ani Sinha <<a href="mailto:ani@anisinha.ca" target="_blank">ani@anisinha.ca</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)"><br>
<br>
On Sun, 12 Sep 2021, Ani Sinha wrote:<br>
<br>
> Hi all:<br>
><br>
> This patchset introduces libvirt xml support for the following two pm conf<br>
> options:<br>
><br>
> <pm><br>
>   <acpi-hotplug-bridge enabled='no'/><br>
>   <acpi-root-hotplug enabled='yes'/><br>
> </pm><br>
><br>
<br>
Another option is to create a new xml tag and add these under that tag.<br>
Something like:<br>
<br>
+   <acpi-hotplug><br>
+     <acpi-hotplug-bridge enabled='no'/><br>
+     <acpi-root-hotplug enabled='yes'/><br>
+   </acpi-hotplug><br>
<br>
These are not exactly power management options. So putting them under <pm><br>
may not be correct.<br>
If this is a better approach I will resend the patchset with the changes<br>
along with addressing other review comments.<br>
<br>
<br>
> The above two options are only available for qemu driver and that too for x86<br>
> guests only. Both of them are global options.<br>
><br>
> ``acpi-hotplug-bridge`` option enables or disables ACPI hotplug support for cold<br>
> plugged bridges. Examples of cold plugged bridges include PCI-PCI bridge<br>
> (pci-bridge controller) for pc machines and pcie-root-port controller for q35<br>
> machines. The corresponding commandline options to qemu for x86 guests are:<br>
><br>
> (pc machines): -global PIIX4_PM.acpi-pci-hotplug-with-bridge-support=<off/on><br>
> (q35 machines): -global ICH9-LPC.acpi-pci-hotplug-with-bridge-support=<off/on><br>
><br>
> Being global options, no other bridge specific options for pci-bridge<br>
> controller or pcie-root-port controllers are required. For pc machine type in<br>
> x86, this option is available in qemu for a long time, from version 2.1.<br>
> Please see the changes in qemu.git:<br>
><br>
> 9e047b982452c6 ("piix4: add acpi pci hotplug support")<br>
> 133a2da488062e ("pc: acpi: generate AML only for PCI0 devices if PCI bridge hotplug is disabled")<br>
><br>
> For q35 machine type, this was introduced in qemu 6.1 with the following<br>
> changes in qemu.git:<br>
><br>
> (a) c0e427d6eb5fef ("hw/acpi/ich9: Enable ACPI PCI hot-plug")<br>
> (b) 17858a16950860 ("hw/acpi/ich9: Set ACPI PCI hot-plug as default on Q35")<br>
><br>
> The reasons for enabling ACPI based hotplug for PCIe (q35) based machines (as<br>
> opposed to native hotplug) for bridges are outlined in (b). It is possible that<br>
> some users might still want to use native hotplug on PCIe [1]. Therefore,<br>
> this conf option enables users to choose either ACPI based hotplug or native<br>
> hotplug for cold plugged bridges (for example for pcie root port controller<br>
> in q35 machines).<br>
><br>
> ``acpi-root-hotplug`` option enables or disables ACPI based hotplug for PCI root<br>
> bus (pci-root controller). This option is only available for pc machine type.<br>
> The corresponding commandline option to qemu for x86 guests is:<br>
><br>
> -global PIIX4_PM.acpi-root-pci-hotplug=<off/on><br>
><br>
> This additional option enables users to disable hotplug for all devices in the<br>
> system without adding an additional PCI-PCI bridge, putting the devices behind<br>
> the bridge and using the existing ``acpi-hotplug-bridge`` option to disable<br>
> hotplug on that bridge. This feature was introduced from qemu version 5.2 with<br>
> the following change in qemu.git:<br>
><br>
> 3d7e78aa7777f ("Introduce a new flag for i440fx to disable PCI hotplug on the root bus")<br>
><br>
> The above qemu commit describes some compelling reasons why users might to<br>
> disable hotplug on PCI root buses [2].<br>
><br>
> A brief summary of the patches:<br>
><br>
> >[PATCH v3 1/5] qemu: capablities: detect presence of<br>
> >[PATCH v3 2/5] qemu: capablities: detect presence of<br>
> Patches 1 and 2 implement support for qemu capability checks for the above<br>
> config options.<br>
><br>
> >[PATCH v3 3/5] conf: introduce acpi-hotplug-bridge and<br>
> Patch 3 actually adds the config option to the schema and adds related unit<br>
> tests.<br>
><br>
> >[PATCH v3 4/5] qemu: command: add support for qemu options that<br>
> Patch 4 adds the backend qemu commandline support for the options. It also adds<br>
> relevant unit tests for the same.<br>
><br>
> >[PATCH v3 5/5] NEWS: add new acpi pci hotplug options in the release<br>
> Patch 5 adds the release notes for the next libvirt release.<br>
><br>
><br>
> Changelog:<br>
> v1: initial implementation. Had some bugs and missed some unit tests.<br>
> v2: fixed bugs and added additional missing unit tests.<br>
> v3: reorganized the patches as per Laine's suggestion. Added more<br>
>     details in commit messages. Added conf description in formatdomain.rst.<br>
>     Added changelog for next release.<br>
><br>
><br>
> Notes:<br>
><br>
> [1] One concrete example of why one might still want to use native hotplug with<br>
> pcie-root-port controller is the fact that we are still discovering issues with<br>
> acpi hotplug on PCIE. One such issue is:<br>
> <a href="https://lists.gnu.org/archive/html/qemu-devel/2021-09/msg02146.html" rel="noreferrer" target="_blank">https://lists.gnu.org/archive/html/qemu-devel/2021-09/msg02146.html</a><br>
> Another reason is that users have been using native hotplug on pcie root ports<br>
> up until now. They have built and tested their systems based on native hotplug.<br>
> They may not want to suddenly move to acpi based hotplug just because it is now<br>
> the default in qemu. Supporting the option to chose one or the other through<br>
> libvirt makes things simpler for end users.<br>
><br>
> [2] The use case scenario described by Laine in<br>
> <a href="https://listman.redhat.com/archives/libvir-list/2020-February/msg00110.html" rel="noreferrer" target="_blank">https://listman.redhat.com/archives/libvir-list/2020-February/msg00110.html</a><br>
> intentionally does not discuss i440fx and focusses solely on q35. I do realize<br>
> that redhat has moved on from i440fx and currently efforts for new features<br>
> are concentrated on q35 machines only. We have had some hard debates on this<br>
> on the qemu mailing list before. The fact of the matter is that i440fx is<br>
> not at 1-1 parity with q35. There are many users who are currenly using i440fx<br>
> and are simply not ready to move to q35 without sacrificing some<br>
> existing features they support today. For example<br>
> <a href="https://wiki.qemu.org/images/4/4e/Q35.pdf" rel="noreferrer" target="_blank">https://wiki.qemu.org/images/4/4e/Q35.pdf</a> lists some of q35 limitations.<br>
> <a href="https://www.linux-kvm.org/images/0/06/2012-forum-Q35.pdf" rel="noreferrer" target="_blank">https://www.linux-kvm.org/images/0/06/2012-forum-Q35.pdf</a> provides more<br>
> information on the differences. Hence we need to solve the issue Laine has<br>
> described in the above email for i440fx without adding additional bridges.<br>
><br>
> Further, in  Daniel Berrange's words from :<br>
> <a href="https://lists.gnu.org/archive/html/qemu-devel/2020-04/msg03012.html" rel="noreferrer" target="_blank">https://lists.gnu.org/archive/html/qemu-devel/2020-04/msg03012.html</a><br>
><br>
> "From the upstream POV, there's been no decision / agreement to phase<br>
> out PIIX, this is purely a RHEL downstream decision & plan. If other<br>
> distros / users have a different POV, and find the feature useful, we<br>
> should accept the patch if it meets the normal QEMU patch requirements.<br>
> "<br>
><br>
> Also to be noted that I have already experimented this qemu commandline option<br>
> using libvirt passthrough feature as has been documented in<br>
> <a href="http://blog.vmsplice.net/2011/04/how-to-pass-qemu-command-line-options.html" rel="noreferrer" target="_blank">http://blog.vmsplice.net/2011/04/how-to-pass-qemu-command-line-options.html</a><br>
> This was only meant to be a short term solution until libvirt started<br>
> supporting this natively. Supporting this option through libvirt would simplify<br>
> their use case as well as add capability validations<br>
> and graceful failure scenarios in case qemu did not support the option.<br>
><br>
> [3] Finally, I implemented support for ``acpi-root-hotplug`` option in Qemu.<br>
> Since adding the support for this option, I have not run away :-) I am still<br>
> around, fixing other issues in the same subsystem in qemu and also now I have<br>
> added myself as a reviewer of patches in this area. I will also be trying to<br>
> support/maintain this new xml conf option in libvirt to the extent I can in<br>
> future with the help of other experienced maintainers. Obviously this is all<br>
> freelance work at this moment and is highly dependent on available free time.<br>
><br>
><br>
><br>
</blockquote></div></div>
</blockquote></div></div>