mbox series

[v7,0/8] pci_expander_brdige:acpi: Support pxb-pcie for ARM

Message ID 20200520093629.1495-1-miaoyubo@huawei.com
Headers show
Series pci_expander_brdige:acpi: Support pxb-pcie for ARM | expand

Message

Yubo Miao May 20, 2020, 9:36 a.m. UTC
Changes with v6
v6->v7:
Refactor fw_cfg_write_extra_pci_roots
Add API PCI_GET_PCIE_HOST_STATE
Fix typos

I have one question for patch
[PATCH v7 8/8] unit-test: Add the binary file and clear diff.

I followed instructions in tests/qtest/bios-tables-test.c
to updated golden master binaries and empty
tests/qtest/bios-tables-test-allowed-diff.h.

However, checkpatch.pl would report the error
ERROR: Do not add expected files together with tests.

Does the error matters?

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 uefi work is updated for discussion by the following link:
https://edk2.groups.io/g/devel/message/56901?p=,,,20,0,0,0::Created,,add+extra+roots+for+Arm,20,2,0,72723351
[PATCH] ArmVirtPkg/FdtPciHostBridgeLib: add extra roots 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

Yubo Miao (8):
  acpi: Extract two APIs from acpi_dsdt_add_pci
  fw_cfg: Write the extra roots into the fw_cfg
  acpi: Extract crs build form acpi_build.c
  acpi: Refactor the source of host bridge and 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            | 275 +++++++++++++++++++++++++++++++
 hw/arm/virt-acpi-build.c       | 249 +++++++++++++++++++++-------
 hw/arm/virt.c                  |   8 +
 hw/i386/acpi-build.c           | 285 ---------------------------------
 hw/i386/pc.c                   |  18 +--
 hw/nvram/fw_cfg.c              |  20 +++
 include/hw/acpi/aml-build.h    |  25 +++
 include/hw/nvram/fw_cfg.h      |   2 +
 include/hw/pci/pcie_host.h     |   4 +
 tests/data/acpi/virt/DSDT.pxb  | Bin 0 -> 7802 bytes
 tests/qtest/bios-tables-test.c |  58 ++++++-
 11 files changed, 579 insertions(+), 365 deletions(-)
 create mode 100644 tests/data/acpi/virt/DSDT.pxb

Comments

no-reply@patchew.org May 20, 2020, noon UTC | #1
Patchew URL: https://patchew.org/QEMU/20200520093629.1495-1-miaoyubo@huawei.com/



Hi,

This series failed the docker-quick@centos7 build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

=== TEST SCRIPT BEGIN ===
#!/bin/bash
make docker-image-centos7 V=1 NETWORK=1
time make docker-test-quick@centos7 SHOW_ENV=1 J=14 NETWORK=1
=== TEST SCRIPT END ===

  CC      aarch64-softmmu/hw/virtio/virtio-balloon-pci.o
  CC      aarch64-softmmu/hw/virtio/virtio-iommu-pci.o
/tmp/qemu-test/src/hw/i386/pc.c: In function 'pc_machine_done':
/tmp/qemu-test/src/hw/i386/pc.c:845:30: error: 'PCMachineState' has no member named 'fw_cfg'
     FWCfgState *fw_cfg = pcms->fw_cfg;
                              ^
make[1]: *** [hw/i386/pc.o] Error 1
make[1]: *** Waiting for unfinished jobs....
  CC      aarch64-softmmu/hw/virtio/virtio-scsi-pci.o
  CC      aarch64-softmmu/hw/virtio/virtio-blk-pci.o
---
  CC      aarch64-softmmu/hw/arm/fsl-imx31.o
  CC      aarch64-softmmu/hw/arm/kzm.o
  CC      aarch64-softmmu/hw/arm/fsl-imx6.o
make: *** [x86_64-softmmu/all] Error 2
make: *** Waiting for unfinished jobs....
  CC      aarch64-softmmu/hw/arm/aspeed_soc.o
  CC      aarch64-softmmu/hw/arm/aspeed.o
---
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=1a6eb762aa244679b2d8bb5e94ab78c2', '-u', '1001', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=1', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-bb9qg_qh/src/docker-src.2020-05-20-07.57.18.11203:/var/tmp/qemu:z,ro', 'qemu:centos7', '/var/tmp/qemu/run', 'test-quick']' returned non-zero exit status 2.
filter=--filter=label=com.qemu.instance.uuid=1a6eb762aa244679b2d8bb5e94ab78c2
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-bb9qg_qh/src'
make: *** [docker-run-test-quick@centos7] Error 2

real    2m53.790s
user    0m8.665s


The full log is available at
http://patchew.org/logs/20200520093629.1495-1-miaoyubo@huawei.com/testing.docker-quick@centos7/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
no-reply@patchew.org May 20, 2020, 12:01 p.m. UTC | #2
Patchew URL: https://patchew.org/QEMU/20200520093629.1495-1-miaoyubo@huawei.com/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Message-id: 20200520093629.1495-1-miaoyubo@huawei.com
Subject: [PATCH v7 0/8] pci_expander_brdige:acpi: Support pxb-pcie for ARM
Type: series

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
 - [tag update]      patchew/alpine.DEB.2.21.2005191651130.27502@sstabellini-ThinkPad-T480s -> patchew/alpine.DEB.2.21.2005191651130.27502@sstabellini-ThinkPad-T480s
Switched to a new branch 'test'
84397ea unit-test: Add the binary file and clear diff.h
ef9b291 unit-test: Add testcase for pxb
805bbf9 unit-test: The files changed.
54022fa acpi: Align the size to 128k
7e884d5 acpi: Refactor the source of host bridge and build tables for pxb
71d7108 acpi: Extract crs build form acpi_build.c
9b18cc8 fw_cfg: Write the extra roots into the fw_cfg
f9e853c acpi: Extract two APIs from acpi_dsdt_add_pci

=== OUTPUT BEGIN ===
1/8 Checking commit f9e853c1a311 (acpi: Extract two APIs from acpi_dsdt_add_pci)
2/8 Checking commit 9b18cc86db52 (fw_cfg: Write the extra roots into the fw_cfg)
3/8 Checking commit 71d7108f79a7 (acpi: Extract crs build form acpi_build.c)
4/8 Checking commit 7e884d5e9f2b (acpi: Refactor the source of host bridge and build tables for pxb)
5/8 Checking commit 54022fad15e2 (acpi: Align the size to 128k)
6/8 Checking commit 805bbf9ca12a (unit-test: The files changed.)
7/8 Checking commit ef9b2917b712 (unit-test: Add testcase for pxb)
8/8 Checking commit 84397ea64edc (unit-test: Add the binary file and clear diff.h)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#13: 
new file mode 100644

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/virt/DSDT.pxb and tests/qtest/bios-tables-test-allowed-diff.h found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/virt/DSDT.pxb and tests/qtest/bios-tables-test-allowed-diff.h found

total: 2 errors, 1 warnings, 1 lines checked

Patch 8/8 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

=== OUTPUT END ===

Test command exited with code: 1


The full log is available at
http://patchew.org/logs/20200520093629.1495-1-miaoyubo@huawei.com/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
no-reply@patchew.org May 20, 2020, 12:02 p.m. UTC | #3
Patchew URL: https://patchew.org/QEMU/20200520093629.1495-1-miaoyubo@huawei.com/



Hi,

This series failed the asan build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

=== TEST SCRIPT BEGIN ===
#!/bin/bash
export ARCH=x86_64
make docker-image-fedora V=1 NETWORK=1
time make docker-test-debug@fedora TARGET_LIST=x86_64-softmmu J=14 NETWORK=1
=== TEST SCRIPT END ===

  CC      x86_64-softmmu/hw/i386/kvm/ioapic.o
  CC      x86_64-softmmu/hw/i386/kvm/i8254.o
  CC      x86_64-softmmu/hw/i386/kvm/i8259.o
/tmp/qemu-test/src/hw/i386/pc.c:845:32: error: no member named 'fw_cfg' in 'struct PCMachineState'
    FWCfgState *fw_cfg = pcms->fw_cfg;
                         ~~~~  ^
1 error generated.
make[1]: *** [/tmp/qemu-test/src/rules.mak:69: hw/i386/pc.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:527: x86_64-softmmu/all] Error 2
Traceback (most recent call last):
  File "./tests/docker/docker.py", line 664, in <module>
    sys.exit(main())
---
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=55401257581546a78f69f7b6cff4508d', '-u', '1003', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=x86_64-softmmu', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew2/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-_ysgb8em/src/docker-src.2020-05-20-07.57.38.12231:/var/tmp/qemu:z,ro', 'qemu:fedora', '/var/tmp/qemu/run', 'test-debug']' returned non-zero exit status 2.
filter=--filter=label=com.qemu.instance.uuid=55401257581546a78f69f7b6cff4508d
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-_ysgb8em/src'
make: *** [docker-run-test-debug@fedora] Error 2

real    4m38.428s
user    0m7.997s


The full log is available at
http://patchew.org/logs/20200520093629.1495-1-miaoyubo@huawei.com/testing.asan/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
no-reply@patchew.org May 20, 2020, 12:04 p.m. UTC | #4
Patchew URL: https://patchew.org/QEMU/20200520093629.1495-1-miaoyubo@huawei.com/



Hi,

This series failed the docker-mingw@fedora build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

=== TEST SCRIPT BEGIN ===
#! /bin/bash
export ARCH=x86_64
make docker-image-fedora V=1 NETWORK=1
time make docker-test-mingw@fedora J=14 NETWORK=1
=== TEST SCRIPT END ===

  CC      aarch64-softmmu/hw/arm/netduinoplus2.o
  CC      x86_64-softmmu/hw/i386/intel_iommu.o
/tmp/qemu-test/src/hw/i386/pc.c: In function 'pc_machine_done':
/tmp/qemu-test/src/hw/i386/pc.c:845:30: error: 'PCMachineState' {aka 'struct PCMachineState'} has no member named 'fw_cfg'
     FWCfgState *fw_cfg = pcms->fw_cfg;
                              ^~
make[1]: *** [/tmp/qemu-test/src/rules.mak:69: hw/i386/pc.o] Error 1
make[1]: *** Waiting for unfinished jobs....
  CC      aarch64-softmmu/hw/arm/nseries.o
  CC      aarch64-softmmu/hw/arm/omap_sx1.o
---
  CC      aarch64-softmmu/target/arm/cpu.o
  CC      aarch64-softmmu/target/arm/gdbstub.o
  CC      aarch64-softmmu/target/arm/cpu64.o
make: *** [Makefile:527: x86_64-softmmu/all] Error 2
make: *** Waiting for unfinished jobs....
  CC      aarch64-softmmu/target/arm/gdbstub64.o
  CC      aarch64-softmmu/target/arm/machine.o
---
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=3ef4ac9914c04d8697026de95a63768e', '-u', '1001', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-kp7ad4i2/src/docker-src.2020-05-20-08.01.51.26842:/var/tmp/qemu:z,ro', 'qemu:fedora', '/var/tmp/qemu/run', 'test-mingw']' returned non-zero exit status 2.
filter=--filter=label=com.qemu.instance.uuid=3ef4ac9914c04d8697026de95a63768e
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-kp7ad4i2/src'
make: *** [docker-run-test-mingw@fedora] Error 2

real    3m7.160s
user    0m9.046s


The full log is available at
http://patchew.org/logs/20200520093629.1495-1-miaoyubo@huawei.com/testing.docker-mingw@fedora/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
Michael S. Tsirkin June 9, 2020, 4:38 p.m. UTC | #5
On Wed, May 20, 2020 at 05:36:21PM +0800, Yubo Miao wrote:
> Changes with v6
> v6->v7:
> Refactor fw_cfg_write_extra_pci_roots
> Add API PCI_GET_PCIE_HOST_STATE
> Fix typos
> 
> I have one question for patch
> [PATCH v7 8/8] unit-test: Add the binary file and clear diff.
> 
> I followed instructions in tests/qtest/bios-tables-test.c
> to updated golden master binaries and empty
> tests/qtest/bios-tables-test-allowed-diff.h.
> 
> However, checkpatch.pl would report the error
> ERROR: Do not add expected files together with tests.
> 
> Does the error matters?

It doesn't - should be fixed on master.
But I see other checkpatch errors.
Can you address them and repost pls?

> 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 uefi work is updated for discussion by the following link:
> https://edk2.groups.io/g/devel/message/56901?p=,,,20,0,0,0::Created,,add+extra+roots+for+Arm,20,2,0,72723351
> [PATCH] ArmVirtPkg/FdtPciHostBridgeLib: add extra roots 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
> 
> Yubo Miao (8):
>   acpi: Extract two APIs from acpi_dsdt_add_pci
>   fw_cfg: Write the extra roots into the fw_cfg
>   acpi: Extract crs build form acpi_build.c
>   acpi: Refactor the source of host bridge and 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            | 275 +++++++++++++++++++++++++++++++
>  hw/arm/virt-acpi-build.c       | 249 +++++++++++++++++++++-------
>  hw/arm/virt.c                  |   8 +
>  hw/i386/acpi-build.c           | 285 ---------------------------------
>  hw/i386/pc.c                   |  18 +--
>  hw/nvram/fw_cfg.c              |  20 +++
>  include/hw/acpi/aml-build.h    |  25 +++
>  include/hw/nvram/fw_cfg.h      |   2 +
>  include/hw/pci/pcie_host.h     |   4 +
>  tests/data/acpi/virt/DSDT.pxb  | Bin 0 -> 7802 bytes
>  tests/qtest/bios-tables-test.c |  58 ++++++-
>  11 files changed, 579 insertions(+), 365 deletions(-)
>  create mode 100644 tests/data/acpi/virt/DSDT.pxb
> 
> -- 
> 2.19.1
>