diff options
author | Eric Auger <eric.auger@redhat.com> | 2025-07-14 10:05:16 +0200 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2025-07-15 02:56:40 -0400 |
commit | 6af97d127eb40bd8a3b25db86d3644b25287be51 (patch) | |
tree | 735b8c012908c752c0f027d1f77fd2fc94767ff5 | |
parent | cfd4ace6e5faf3064defa559e1b5fd674109186f (diff) | |
download | qemu-6af97d127eb40bd8a3b25db86d3644b25287be51.zip qemu-6af97d127eb40bd8a3b25db86d3644b25287be51.tar.gz qemu-6af97d127eb40bd8a3b25db86d3644b25287be51.tar.bz2 |
hw/arm/virt: Let virt support pci hotplug/unplug GED event
Set up the IO registers used to communicate between QEMU
and ACPI.
Signed-off-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Message-Id: <20250714080639.2525563-33-eric.auger@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
-rw-r--r-- | hw/arm/virt.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/hw/arm/virt.c b/hw/arm/virt.c index f127a66..ef6be36 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -691,6 +691,7 @@ static inline DeviceState *create_acpi_ged(VirtMachineState *vms) SysBusDevice *sbdev; int irq = vms->irqmap[VIRT_ACPI_GED]; uint32_t event = ACPI_GED_PWR_DOWN_EVT; + bool acpi_pcihp; if (ms->ram_slots) { event |= ACPI_GED_MEM_HOTPLUG_EVT; @@ -709,6 +710,18 @@ static inline DeviceState *create_acpi_ged(VirtMachineState *vms) sysbus_mmio_map_name(sbdev, TYPE_ACPI_GED, vms->memmap[VIRT_ACPI_GED].base); sysbus_mmio_map_name(sbdev, ACPI_MEMHP_REGION_NAME, vms->memmap[VIRT_PCDIMM_ACPI].base); + + acpi_pcihp = object_property_get_bool(OBJECT(dev), + ACPI_PM_PROP_ACPI_PCIHP_BRIDGE, NULL); + + if (acpi_pcihp) { + int pcihp_region_index; + + pcihp_region_index = sysbus_mmio_map_name(sbdev, ACPI_PCIHP_REGION_NAME, + vms->memmap[VIRT_ACPI_PCIHP].base); + assert(pcihp_region_index >= 0); + } + sysbus_connect_irq(sbdev, 0, qdev_get_gpio_in(vms->gic, irq)); return dev; |