Hi Eric,
On 5/14/25 14:00, Eric Auger wrote:
> On ARM we will put the operation regions in AML_SYSTEM_MEMORY.
> So let's allow this configuration.
>
> Signed-off-by: Eric Auger <eric.auger@redhat.com>
> ---
> include/hw/acpi/pcihp.h | 3 ++-
> hw/acpi/pcihp.c | 8 ++++----
> hw/i386/acpi-build.c | 4 ++--
> 3 files changed, 8 insertions(+), 7 deletions(-)
Reviewed-by: Gustavo Romero <gustavo.romero@linaro.org>
Cheers,
Gustavo
> diff --git a/include/hw/acpi/pcihp.h b/include/hw/acpi/pcihp.h
> index ec9b010e4a..525e61a2a9 100644
> --- a/include/hw/acpi/pcihp.h
> +++ b/include/hw/acpi/pcihp.h
> @@ -28,6 +28,7 @@
> #define HW_ACPI_PCIHP_H
>
> #include "hw/acpi/acpi.h"
> +#include "hw/acpi/aml-build.h"
> #include "hw/hotplug.h"
>
> #define ACPI_PCIHP_IO_BASE_PROP "acpi-pcihp-io-base"
> @@ -73,7 +74,7 @@ void acpi_pcihp_device_unplug_request_cb(HotplugHandler *hotplug_dev,
> AcpiPciHpState *s, DeviceState *dev,
> Error **errp);
>
> -void build_acpi_pci_hotplug(Aml *table, uint64_t pcihp_addr);
> +void build_acpi_pci_hotplug(Aml *table, AmlRegionSpace rs, uint64_t pcihp_addr);
> void build_append_pci_dsm_func0_common(Aml *ctx, Aml *retvar);
> void build_append_pcihp_resources(Aml *table,
> uint64_t io_addr, uint64_t io_len);
> diff --git a/hw/acpi/pcihp.c b/hw/acpi/pcihp.c
> index fb54c31f77..310a5c54bd 100644
> --- a/hw/acpi/pcihp.c
> +++ b/hw/acpi/pcihp.c
> @@ -629,7 +629,7 @@ static Aml *aml_pci_pdsm(void)
> return method;
> }
>
> -void build_acpi_pci_hotplug(Aml *table, uint64_t pcihp_addr)
> +void build_acpi_pci_hotplug(Aml *table, AmlRegionSpace rs, uint64_t pcihp_addr)
> {
> Aml *scope;
> Aml *field;
> @@ -638,21 +638,21 @@ void build_acpi_pci_hotplug(Aml *table, uint64_t pcihp_addr)
> scope = aml_scope("_SB.PCI0");
>
> aml_append(scope,
> - aml_operation_region("PCST", AML_SYSTEM_IO, aml_int(pcihp_addr), 0x08));
> + aml_operation_region("PCST", rs, aml_int(pcihp_addr), 0x08));
> field = aml_field("PCST", AML_DWORD_ACC, AML_NOLOCK, AML_WRITE_AS_ZEROS);
> aml_append(field, aml_named_field("PCIU", 32));
> aml_append(field, aml_named_field("PCID", 32));
> aml_append(scope, field);
>
> aml_append(scope,
> - aml_operation_region("SEJ", AML_SYSTEM_IO,
> + aml_operation_region("SEJ", rs,
> aml_int(pcihp_addr + ACPI_PCIHP_SEJ_BASE), 0x04));
> field = aml_field("SEJ", AML_DWORD_ACC, AML_NOLOCK, AML_WRITE_AS_ZEROS);
> aml_append(field, aml_named_field("B0EJ", 32));
> aml_append(scope, field);
>
> aml_append(scope,
> - aml_operation_region("BNMR", AML_SYSTEM_IO,
> + aml_operation_region("BNMR", rs,
> aml_int(pcihp_addr + ACPI_PCIHP_BNMR_BASE), 0x08));
> field = aml_field("BNMR", AML_DWORD_ACC, AML_NOLOCK, AML_WRITE_AS_ZEROS);
> aml_append(field, aml_named_field("BNUM", 32));
> diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
> index ca59185aac..87bb3d5cee 100644
> --- a/hw/i386/acpi-build.c
> +++ b/hw/i386/acpi-build.c
> @@ -1172,7 +1172,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
> aml_append(dsdt, sb_scope);
>
> if (pm->pcihp_bridge_en || pm->pcihp_root_en) {
> - build_acpi_pci_hotplug(dsdt, pm->pcihp_io_base);
> + build_acpi_pci_hotplug(dsdt, AML_SYSTEM_IO, pm->pcihp_io_base);
> }
> build_piix4_pci0_int(dsdt);
> } else if (q35) {
> @@ -1216,7 +1216,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
> aml_append(dsdt, sb_scope);
>
> if (pm->pcihp_bridge_en) {
> - build_acpi_pci_hotplug(dsdt, pm->pcihp_io_base);
> + build_acpi_pci_hotplug(dsdt, AML_SYSTEM_IO, pm->pcihp_io_base);
> }
> build_q35_pci0_int(dsdt);
> }