[PATCH v10 0/9] pci_expander_brdige:acpi: Support pxb-pcie for ARM

Jiahui Cen posted 9 patches 3 years, 5 months ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20201119014841.7298-1-cenjiahui@huawei.com
Maintainers: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Paolo Bonzini <pbonzini@redhat.com>, "Philippe Mathieu-Daudé" <philmd@redhat.com>, Igor Mammedov <imammedo@redhat.com>, Laszlo Ersek <lersek@redhat.com>, Gerd Hoffmann <kraxel@redhat.com>, Shannon Zhao <shannon.zhaosl@gmail.com>, Eduardo Habkost <ehabkost@redhat.com>, "Michael S. Tsirkin" <mst@redhat.com>, Peter Maydell <peter.maydell@linaro.org>, Richard Henderson <richard.henderson@linaro.org>
hw/acpi/aml-build.c            | 285 +++++++++++++++++++
hw/arm/virt-acpi-build.c       |  31 ++-
hw/arm/virt.c                  |   7 +-
hw/i386/acpi-build.c           | 293 --------------------
hw/i386/pc.c                   |  18 +-
hw/nvram/fw_cfg.c              |  23 ++
hw/pci-host/gpex-acpi.c        | 166 +++++++----
include/hw/acpi/aml-build.h    |  22 ++
include/hw/arm/virt.h          |   1 +
include/hw/nvram/fw_cfg.h      |   9 +
include/hw/pci-host/gpex.h     |   1 +
tests/data/acpi/virt/DSDT.pxb  | Bin 0 -> 7802 bytes
tests/qtest/bios-tables-test.c |  58 +++-
13 files changed, 545 insertions(+), 369 deletions(-)
create mode 100644 tests/data/acpi/virt/DSDT.pxb
[PATCH v10 0/9] pci_expander_brdige:acpi: Support pxb-pcie for ARM
Posted by Jiahui Cen 3 years, 5 months ago
Changes with v9
v9->v10:
Refactor patch2 to drop useless macros and variables.
Split patch2 into two patches.

Changes with v8
v8->v9:
Rebase to master

Changes with v7
v7->v8:
Fix the error:no member named 'fw_cfg' in 'struct PCMachineState'

Changes with v6
v6->v7:
Refactor fw_cfg_write_extra_pci_roots
Add API PCI_GET_PCIE_HOST_STATE
Fix typos

Changes with v5
v5->v6: stat crs_range_insert in aml_build.h

Changes with v4
v4->v5: Not using specific resources for PXB.
Instead, the resources for pxb are composed of the bar space of the
pci-bridge/pcie-root-port behined it and the config space of devices
behind it.

Only if the bios(uefi for arm) support multiple roots,
configure space of devices behind pxbs could be obtained.
The newest uefi work is updated for discussion by the following link:
https://edk2.groups.io/g/devel/topic/78135572#67173
[PATCH v2 0/4] Add extra pci roots support for Arm

Currently pxb-pcie is not supported by arm,
the reason for it is pxb-pcie is not described in DSDT table
and only one main host bridge is described in acpi tables,
which means it is not impossible to present different io numas
for different devices.

This series of patches make arm to support PXB-PCIE.

Users can configure pxb-pcie with certain numa, Example command
is:

   -device pxb-pcie,id=pci.7,bus_nr=128,numa_node=0,bus=pcie.0,addr=0x9

Jiahui Cen (2):
  fw_cfg: Refactor extra pci roots addition
  hw/arm/virt: Write extra pci roots into fw_cfg

Yubo Miao (7):
  acpi/gpex: Extract two APIs from acpi_dsdt_add_pci
  acpi: Extract crs build form acpi_build.c
  acpi/gpex: Build tables for pxb
  acpi: Align the size to 128k
  unit-test: The files changed.
  unit-test: Add testcase for pxb
  unit-test: Add the binary file and clear diff.h

 hw/acpi/aml-build.c            | 285 +++++++++++++++++++
 hw/arm/virt-acpi-build.c       |  31 ++-
 hw/arm/virt.c                  |   7 +-
 hw/i386/acpi-build.c           | 293 --------------------
 hw/i386/pc.c                   |  18 +-
 hw/nvram/fw_cfg.c              |  23 ++
 hw/pci-host/gpex-acpi.c        | 166 +++++++----
 include/hw/acpi/aml-build.h    |  22 ++
 include/hw/arm/virt.h          |   1 +
 include/hw/nvram/fw_cfg.h      |   9 +
 include/hw/pci-host/gpex.h     |   1 +
 tests/data/acpi/virt/DSDT.pxb  | Bin 0 -> 7802 bytes
 tests/qtest/bios-tables-test.c |  58 +++-
 13 files changed, 545 insertions(+), 369 deletions(-)
 create mode 100644 tests/data/acpi/virt/DSDT.pxb

-- 
2.28.0


Re: [PATCH v10 0/9] pci_expander_brdige:acpi: Support pxb-pcie for ARM
Posted by Michael S. Tsirkin 3 years, 4 months ago
On Thu, Nov 19, 2020 at 09:48:32AM +0800, Jiahui Cen wrote:
> Changes with v9
> v9->v10:
> Refactor patch2 to drop useless macros and variables.
> Split patch2 into two patches.

I tagged this for after the release. To help make sure this is
not lost pls ping me after the release.

Thanks!

> Changes with v8
> v8->v9:
> Rebase to master
> 
> Changes with v7
> v7->v8:
> Fix the error:no member named 'fw_cfg' in 'struct PCMachineState'
> 
> Changes with v6
> v6->v7:
> Refactor fw_cfg_write_extra_pci_roots
> Add API PCI_GET_PCIE_HOST_STATE
> Fix typos
> 
> Changes with v5
> v5->v6: stat crs_range_insert in aml_build.h
> 
> Changes with v4
> v4->v5: Not using specific resources for PXB.
> Instead, the resources for pxb are composed of the bar space of the
> pci-bridge/pcie-root-port behined it and the config space of devices
> behind it.
> 
> Only if the bios(uefi for arm) support multiple roots,
> configure space of devices behind pxbs could be obtained.
> The newest uefi work is updated for discussion by the following link:
> https://edk2.groups.io/g/devel/topic/78135572#67173
> [PATCH v2 0/4] Add extra pci roots support for Arm
> 
> Currently pxb-pcie is not supported by arm,
> the reason for it is pxb-pcie is not described in DSDT table
> and only one main host bridge is described in acpi tables,
> which means it is not impossible to present different io numas
> for different devices.
> 
> This series of patches make arm to support PXB-PCIE.
> 
> Users can configure pxb-pcie with certain numa, Example command
> is:
> 
>    -device pxb-pcie,id=pci.7,bus_nr=128,numa_node=0,bus=pcie.0,addr=0x9
> 
> Jiahui Cen (2):
>   fw_cfg: Refactor extra pci roots addition
>   hw/arm/virt: Write extra pci roots into fw_cfg
> 
> Yubo Miao (7):
>   acpi/gpex: Extract two APIs from acpi_dsdt_add_pci
>   acpi: Extract crs build form acpi_build.c
>   acpi/gpex: Build tables for pxb
>   acpi: Align the size to 128k
>   unit-test: The files changed.
>   unit-test: Add testcase for pxb
>   unit-test: Add the binary file and clear diff.h
> 
>  hw/acpi/aml-build.c            | 285 +++++++++++++++++++
>  hw/arm/virt-acpi-build.c       |  31 ++-
>  hw/arm/virt.c                  |   7 +-
>  hw/i386/acpi-build.c           | 293 --------------------
>  hw/i386/pc.c                   |  18 +-
>  hw/nvram/fw_cfg.c              |  23 ++
>  hw/pci-host/gpex-acpi.c        | 166 +++++++----
>  include/hw/acpi/aml-build.h    |  22 ++
>  include/hw/arm/virt.h          |   1 +
>  include/hw/nvram/fw_cfg.h      |   9 +
>  include/hw/pci-host/gpex.h     |   1 +
>  tests/data/acpi/virt/DSDT.pxb  | Bin 0 -> 7802 bytes
>  tests/qtest/bios-tables-test.c |  58 +++-
>  13 files changed, 545 insertions(+), 369 deletions(-)
>  create mode 100644 tests/data/acpi/virt/DSDT.pxb
> 
> -- 
> 2.28.0


Re: [PATCH v10 0/9] pci_expander_brdige:acpi: Support pxb-pcie for ARM
Posted by Jiahui Cen 3 years, 4 months ago
Hi Michael,

On 2020/12/2 17:53, Michael S. Tsirkin wrote:
> On Thu, Nov 19, 2020 at 09:48:32AM +0800, Jiahui Cen wrote:
>> Changes with v9
>> v9->v10:
>> Refactor patch2 to drop useless macros and variables.
>> Split patch2 into two patches.
> 
> I tagged this for after the release. To help make sure this is
> not lost pls ping me after the release.

OK. I'll ping you after the release.

Thanks,
Jiahui.

>> Changes with v8
>> v8->v9:
>> Rebase to master
>>
>> Changes with v7
>> v7->v8:
>> Fix the error:no member named 'fw_cfg' in 'struct PCMachineState'
>>
>> Changes with v6
>> v6->v7:
>> Refactor fw_cfg_write_extra_pci_roots
>> Add API PCI_GET_PCIE_HOST_STATE
>> Fix typos
>>
>> Changes with v5
>> v5->v6: stat crs_range_insert in aml_build.h
>>
>> Changes with v4
>> v4->v5: Not using specific resources for PXB.
>> Instead, the resources for pxb are composed of the bar space of the
>> pci-bridge/pcie-root-port behined it and the config space of devices
>> behind it.
>>
>> Only if the bios(uefi for arm) support multiple roots,
>> configure space of devices behind pxbs could be obtained.
>> The newest uefi work is updated for discussion by the following link:
>> https://edk2.groups.io/g/devel/topic/78135572#67173
>> [PATCH v2 0/4] Add extra pci roots support for Arm
>>
>> Currently pxb-pcie is not supported by arm,
>> the reason for it is pxb-pcie is not described in DSDT table
>> and only one main host bridge is described in acpi tables,
>> which means it is not impossible to present different io numas
>> for different devices.
>>
>> This series of patches make arm to support PXB-PCIE.
>>
>> Users can configure pxb-pcie with certain numa, Example command
>> is:
>>
>>    -device pxb-pcie,id=pci.7,bus_nr=128,numa_node=0,bus=pcie.0,addr=0x9
>>
>> Jiahui Cen (2):
>>   fw_cfg: Refactor extra pci roots addition
>>   hw/arm/virt: Write extra pci roots into fw_cfg
>>
>> Yubo Miao (7):
>>   acpi/gpex: Extract two APIs from acpi_dsdt_add_pci
>>   acpi: Extract crs build form acpi_build.c
>>   acpi/gpex: Build tables for pxb
>>   acpi: Align the size to 128k
>>   unit-test: The files changed.
>>   unit-test: Add testcase for pxb
>>   unit-test: Add the binary file and clear diff.h
>>
>>  hw/acpi/aml-build.c            | 285 +++++++++++++++++++
>>  hw/arm/virt-acpi-build.c       |  31 ++-
>>  hw/arm/virt.c                  |   7 +-
>>  hw/i386/acpi-build.c           | 293 --------------------
>>  hw/i386/pc.c                   |  18 +-
>>  hw/nvram/fw_cfg.c              |  23 ++
>>  hw/pci-host/gpex-acpi.c        | 166 +++++++----
>>  include/hw/acpi/aml-build.h    |  22 ++
>>  include/hw/arm/virt.h          |   1 +
>>  include/hw/nvram/fw_cfg.h      |   9 +
>>  include/hw/pci-host/gpex.h     |   1 +
>>  tests/data/acpi/virt/DSDT.pxb  | Bin 0 -> 7802 bytes
>>  tests/qtest/bios-tables-test.c |  58 +++-
>>  13 files changed, 545 insertions(+), 369 deletions(-)
>>  create mode 100644 tests/data/acpi/virt/DSDT.pxb
>>
>> -- 
>> 2.28.0
> 
> .
>