[PATCH 4/4] ich9: Enable root PCI hotplug by default

Thierry Escande posted 4 patches 1 year ago
Maintainers: "Michael S. Tsirkin" <mst@redhat.com>, Igor Mammedov <imammedo@redhat.com>, Ani Sinha <anisinha@redhat.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
[PATCH 4/4] ich9: Enable root PCI hotplug by default
Posted by Thierry Escande 1 year ago
This patch initializes use_acpi_root_pci_hotplug to true and enables
device PCI hotplug on q35 machine by default.

Signed-off-by: Thierry Escande <thierry.escande@vates.tech>
---
 hw/acpi/ich9.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c
index e38c9bb998..ad2c8ad8ed 100644
--- a/hw/acpi/ich9.c
+++ b/hw/acpi/ich9.c
@@ -450,6 +450,7 @@ void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm)
     pm->disable_s4 = 0;
     pm->s4_val = 2;
     pm->acpi_pci_hotplug.use_acpi_hotplug_bridge = true;
+    pm->acpi_pci_hotplug.use_acpi_root_pci_hotplug = true;
     pm->keep_pci_slot_hpc = true;
     pm->enable_tco = true;
 
-- 
2.42.0



Thierry Escande | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech
Re: [PATCH 4/4] ich9: Enable root PCI hotplug by default
Posted by Igor Mammedov 1 year ago
On Wed, 15 Nov 2023 17:18:54 +0000
Thierry Escande <thierry.escande@vates.tech> wrote:

> This patch initializes use_acpi_root_pci_hotplug to true and enables
> device PCI hotplug on q35 machine by default.
> 
> Signed-off-by: Thierry Escande <thierry.escande@vates.tech>
> ---
>  hw/acpi/ich9.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c
> index e38c9bb998..ad2c8ad8ed 100644
> --- a/hw/acpi/ich9.c
> +++ b/hw/acpi/ich9.c
> @@ -450,6 +450,7 @@ void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm)
>      pm->disable_s4 = 0;
>      pm->s4_val = 2;
>      pm->acpi_pci_hotplug.use_acpi_hotplug_bridge = true;
> +    pm->acpi_pci_hotplug.use_acpi_root_pci_hotplug = true;
>      pm->keep_pci_slot_hpc = true;
>      pm->enable_tco = true;
>  

PS: also you'd need to add compat logic to preserve
disabled state for already existing machine types
Re: [PATCH 4/4] ich9: Enable root PCI hotplug by default
Posted by Igor Mammedov 1 year ago
On Wed, 15 Nov 2023 17:18:54 +0000
Thierry Escande <thierry.escande@vates.tech> wrote:

> This patch initializes use_acpi_root_pci_hotplug to true and enables
> device PCI hotplug on q35 machine by default.
> 
> Signed-off-by: Thierry Escande <thierry.escande@vates.tech>
> ---
>  hw/acpi/ich9.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c
> index e38c9bb998..ad2c8ad8ed 100644
> --- a/hw/acpi/ich9.c
> +++ b/hw/acpi/ich9.c
> @@ -450,6 +450,7 @@ void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm)
>      pm->disable_s4 = 0;
>      pm->s4_val = 2;
>      pm->acpi_pci_hotplug.use_acpi_hotplug_bridge = true;
> +    pm->acpi_pci_hotplug.use_acpi_root_pci_hotplug = true;
>      pm->keep_pci_slot_hpc = true;
>      pm->enable_tco = true;
>  

That probably is not enough,
due to:
        if (pm->pcihp_bridge_en) {                                               
            build_x86_acpi_pci_hotplug(dsdt, pm->pcihp_io_base);                 
        }                                                                        
        build_q35_pci0_int(dsdt);