[PATCH v3 18/29] hw/acpi/ged: Add a bus link property

Eric Auger posted 29 patches 5 months ago
Maintainers: "Michael S. Tsirkin" <mst@redhat.com>, Igor Mammedov <imammedo@redhat.com>, Ani Sinha <anisinha@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Peter Maydell <peter.maydell@linaro.org>, Shannon Zhao <shannon.zhaosl@gmail.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Eduardo Habkost <eduardo@habkost.net>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Richard Henderson <richard.henderson@linaro.org>
There is a newer version of this series
[PATCH v3 18/29] hw/acpi/ged: Add a bus link property
Posted by Eric Auger 5 months ago
This property will be set by the machine code on the object
creation. It will be used by acpi pcihp hotplug code.

Signed-off-by: Eric Auger <eric.auger@redhat.com>
---
 hw/acpi/generic_event_device.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/hw/acpi/generic_event_device.c b/hw/acpi/generic_event_device.c
index 7831db412b..ef1c1ec51f 100644
--- a/hw/acpi/generic_event_device.c
+++ b/hw/acpi/generic_event_device.c
@@ -13,6 +13,7 @@
 #include "qapi/error.h"
 #include "hw/acpi/acpi.h"
 #include "hw/acpi/generic_event_device.h"
+#include "hw/pci/pci.h"
 #include "hw/irq.h"
 #include "hw/mem/pc-dimm.h"
 #include "hw/mem/nvdimm.h"
@@ -320,6 +321,8 @@ static const Property acpi_ged_properties[] = {
     DEFINE_PROP_UINT32("ged-event", AcpiGedState, ged_event_bitmap, 0),
     DEFINE_PROP_BOOL(ACPI_PM_PROP_ACPI_PCIHP_BRIDGE, AcpiGedState,
                      pcihp_state.use_acpi_hotplug_bridge, 0),
+    DEFINE_PROP_LINK("bus", AcpiGedState, pcihp_state.root,
+                     TYPE_PCI_BUS, PCIBus *),
 };
 
 static const VMStateDescription vmstate_memhp_state = {
-- 
2.49.0
Re: [PATCH v3 18/29] hw/acpi/ged: Add a bus link property
Posted by Igor Mammedov 4 months, 4 weeks ago
On Mon, 16 Jun 2025 11:46:47 +0200
Eric Auger <eric.auger@redhat.com> wrote:

> This property will be set by the machine code on the object
> creation. It will be used by acpi pcihp hotplug code.
> 
> Signed-off-by: Eric Auger <eric.auger@redhat.com>

Reviewed-by: Igor Mammedov <imammedo@redhat.com>


also with that it's possible to end up with NULL root
if someone forgets to wire it up.

I'd add assert somewhere in pcihp.c
so that we wouldn't end up with wounds from too much head scratching
if it fails somewhere during runtime.

> ---
>  hw/acpi/generic_event_device.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/hw/acpi/generic_event_device.c b/hw/acpi/generic_event_device.c
> index 7831db412b..ef1c1ec51f 100644
> --- a/hw/acpi/generic_event_device.c
> +++ b/hw/acpi/generic_event_device.c
> @@ -13,6 +13,7 @@
>  #include "qapi/error.h"
>  #include "hw/acpi/acpi.h"
>  #include "hw/acpi/generic_event_device.h"
> +#include "hw/pci/pci.h"
>  #include "hw/irq.h"
>  #include "hw/mem/pc-dimm.h"
>  #include "hw/mem/nvdimm.h"
> @@ -320,6 +321,8 @@ static const Property acpi_ged_properties[] = {
>      DEFINE_PROP_UINT32("ged-event", AcpiGedState, ged_event_bitmap, 0),
>      DEFINE_PROP_BOOL(ACPI_PM_PROP_ACPI_PCIHP_BRIDGE, AcpiGedState,
>                       pcihp_state.use_acpi_hotplug_bridge, 0),
> +    DEFINE_PROP_LINK("bus", AcpiGedState, pcihp_state.root,
> +                     TYPE_PCI_BUS, PCIBus *),
>  };
>  
>  static const VMStateDescription vmstate_memhp_state = {
Re: [PATCH v3 18/29] hw/acpi/ged: Add a bus link property
Posted by Jonathan Cameron via 4 months, 4 weeks ago
On Mon, 16 Jun 2025 11:46:47 +0200
Eric Auger <eric.auger@redhat.com> wrote:

> This property will be set by the machine code on the object
> creation. It will be used by acpi pcihp hotplug code.
> 
> Signed-off-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>