[PATCH v8 5/8] acpi: Align the size to 128k

2020-05-20 Thread Yubo Miao
If table size is changed between virt_acpi_build and virt_acpi_build_update, the table size would not be updated to UEFI, therefore, just align the size to 128kb, which is enough and same with x86. It would warn if 64k is not enough and the align size should be updated. Signed-off-by: Yubo Miao

[PATCH v8 4/8] acpi: Refactor the source of host bridge and build tables for pxb

2020-05-20 Thread Yubo Miao
it. Signed-off-by: Yubo Miao --- hw/arm/virt-acpi-build.c | 127 +-- 1 file changed, 110 insertions(+), 17 deletions(-) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index 24ebc06a9f..14fcabd197 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw

[PATCH v8 6/8] unit-test: The files changed.

2020-05-20 Thread Yubo Miao
0x, // Translation Offset -0x0100, // Length +0x0080, // Length Signed-off-by: Yubo Miao --- tests/qtest/bios-tables-test-allowed-diff.h | 1 + 1 file changed, 1 insertion(+) diff --git a/te

[PATCH v8 3/8] acpi: Extract crs build form acpi_build.c

2020-05-20 Thread Yubo Miao
config via two APIs: pci_bridge_get_base and pci_bridge_get_limit Signed-off-by: Yubo Miao --- hw/acpi/aml-build.c | 275 ++ hw/i386/acpi-build.c| 285 include/hw/acpi/aml-build.h | 25 3 files changed, 300

[PATCH v8 8/8] unit-test: Add the binary file and clear diff.h

2020-05-20 Thread Yubo Miao
Add the binary file DSDT.pxb and clear bios-tables-test-allowed-diff.h Signed-off-by: Yubo Miao --- tests/data/acpi/virt/DSDT.pxb | Bin 0 -> 7802 bytes tests/qtest/bios-tables-test-allowed-diff.h | 1 - 2 files changed, 1 deletion(-) create mode 100644 tests/data/acpi/v

[PATCH v8 7/8] unit-test: Add testcase for pxb

2020-05-20 Thread Yubo Miao
Add testcase for pxb to make sure the ACPI table is correct for guest. Signed-off-by: Yubo Miao --- tests/qtest/bios-tables-test.c | 58 ++ 1 file changed, 52 insertions(+), 6 deletions(-) diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables

[PATCH v8 2/8] fw_cfg: Write the extra roots into the fw_cfg

2020-05-20 Thread Yubo Miao
Write the extra roots into the fw_cfg, therefore the uefi could get the extra roots. Only if the uefi knows there are extra roots, the config space of devices behind the root could be obtained. Signed-off-by: Yubo Miao --- hw/arm/virt.c | 8 hw/i386/pc.c

[PATCH v8 1/8] acpi: Extract two APIs from acpi_dsdt_add_pci

2020-05-20 Thread Yubo Miao
-by: Yubo Miao --- hw/arm/virt-acpi-build.c | 129 ++- 1 file changed, 72 insertions(+), 57 deletions(-) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index 1b0a584c7b..24ebc06a9f 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi

[PATCH v8 0/8] pci_expander_brdige:acpi: Support pxb-pcie for ARM

2020-05-20 Thread Yubo Miao
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 cr

[PATCH v7 7/8] unit-test: Add testcase for pxb

2020-05-20 Thread Yubo Miao
Add testcase for pxb to make sure the ACPI table is correct for guest. Signed-off-by: Yubo Miao --- tests/qtest/bios-tables-test.c | 58 ++ 1 file changed, 52 insertions(+), 6 deletions(-) diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables

[PATCH v7 8/8] unit-test: Add the binary file and clear diff.h

2020-05-20 Thread Yubo Miao
Add the binary file DSDT.pxb and clear bios-tables-test-allowed-diff.h Signed-off-by: Yubo Miao --- tests/data/acpi/virt/DSDT.pxb | Bin 0 -> 7802 bytes tests/qtest/bios-tables-test-allowed-diff.h | 1 - 2 files changed, 1 deletion(-) create mode 100644 tests/data/acpi/v

[PATCH v7 1/8] acpi: Extract two APIs from acpi_dsdt_add_pci

2020-05-20 Thread Yubo Miao
-by: Yubo Miao --- hw/arm/virt-acpi-build.c | 129 ++- 1 file changed, 72 insertions(+), 57 deletions(-) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index 1b0a584c7b..24ebc06a9f 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi

[PATCH v7 5/8] acpi: Align the size to 128k

2020-05-20 Thread Yubo Miao
If table size is changed between virt_acpi_build and virt_acpi_build_update, the table size would not be updated to UEFI, therefore, just align the size to 128kb, which is enough and same with x86. It would warn if 64k is not enough and the align size should be updated. Signed-off-by: Yubo Miao

[PATCH v7 6/8] unit-test: The files changed.

2020-05-20 Thread Yubo Miao
0x, // Translation Offset -0x0100, // Length +0x0080, // Length Signed-off-by: Yubo Miao --- tests/qtest/bios-tables-test-allowed-diff.h | 1 + 1 file changed, 1 insertion(+) diff --git a/te

[PATCH v7 3/8] acpi: Extract crs build form acpi_build.c

2020-05-20 Thread Yubo Miao
config via two APIs: pci_bridge_get_base and pci_bridge_get_limit Signed-off-by: Yubo Miao --- hw/acpi/aml-build.c | 275 ++ hw/i386/acpi-build.c| 285 include/hw/acpi/aml-build.h | 25 3 files changed, 300

[PATCH v7 4/8] acpi: Refactor the source of host bridge and build tables for pxb

2020-05-20 Thread Yubo Miao
. Signed-off-by: Yubo Miao --- hw/arm/virt-acpi-build.c | 127 +-- 1 file changed, 110 insertions(+), 17 deletions(-) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index 24ebc06a9f..14fcabd197 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw

[PATCH v7 2/8] fw_cfg: Write the extra roots into the fw_cfg

2020-05-20 Thread Yubo Miao
Write the extra roots into the fw_cfg, therefore the uefi could get the extra roots. Only if the uefi knows there are extra roots, the config space of devices behind the root could be obtained. Signed-off-by: Yubo Miao --- hw/arm/virt.c | 8 hw/i386/pc.c

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

2020-05-20 Thread Yubo Miao
,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 siz

[PATCH v6 5/8] acpi: Align the size to 128k

2020-04-08 Thread Yubo Miao
From: miaoyubo If table size is changed between virt_acpi_build and virt_acpi_build_update, the table size would not be updated to UEFI, therefore, just align the size to 128kb, which is enough and same with x86. It would warn if 64k is not enough and the align size should be updated. Signed-off

[PATCH v6 0/8] pci_expander_brdige:acpi:Support pxb-pcie for ARM

2020-04-08 Thread Yubo Miao
From: miaoyubo 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 t

[PATCH v6 8/8] unit-test: Add the binary file and clear diff.h

2020-04-08 Thread Yubo Miao
From: miaoyubo Add the binary file DSDT.pxb and clear bios-tables-test-allowed-diff.h Signed-off-by: miaoyubo --- tests/data/acpi/virt/DSDT.pxb | Bin 0 -> 7802 bytes tests/qtest/bios-tables-test-allowed-diff.h | 1 - 2 files changed, 1 deletion(-) create mode 100644 tests/dat

[PATCH v6 4/8] acpi: Refactor the source of host bridge and build tables for pxb

2020-04-08 Thread Yubo Miao
From: miaoyubo The resources of pxbs and obtained by crs_build and the resources used by pxbs would be moved form the resources defined for host-bridge. 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. Sig

[PATCH v6 7/8] unit-test: Add testcase for pxb

2020-04-08 Thread Yubo Miao
From: miaoyubo Add testcase for pxb to make sure the ACPI table is correct for guest. Signed-off-by: miaoyubo --- tests/qtest/bios-tables-test.c | 58 ++ 1 file changed, 52 insertions(+), 6 deletions(-) diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/

[PATCH v6 1/8] acpi: Extract two APIs from acpi_dsdt_add_pci

2020-04-08 Thread Yubo Miao
From: miaoyubo Extract two APIs acpi_dsdt_add_pci_route_table and acpi_dsdt_add_pci_osc form acpi_dsdt_add_pci. The first API is used to specify the pci route table and the second API is used to declare the operation system capabilities. These two APIs would be used to specify the pxb-pcie in DSD

[PATCH v6 2/8] fw_cfg: Write the extra roots into the fw_cfg

2020-04-08 Thread Yubo Miao
From: miaoyubo Write the extra roots into the fw_cfg therefore the uefi could get the extra roots. Only if the uefi know there are extra roots, the config space of devices behind the root could be obtained. Signed-off-by: miaoyubo --- hw/arm/virt.c | 23 +++ 1 file changed,

[PATCH v6 3/8] acpi: Extract crs build form acpi_build.c

2020-04-08 Thread Yubo Miao
From: miaoyubo Extract crs build form acpi_build.c, the function could also be used to build the crs for pxbs for arm. The resources are composed by two parts: 1. The bar space of pci-bridge/pcie-root-ports 2. The resources devices behind PXBs need. The base and limit of memory/io are obtained fr

[PATCH v6 6/8] unit-test: The files changed.

2020-04-08 Thread Yubo Miao
From: miaoyubo The unit-test is seperated into three patches: 1. The files changed and list in bios-tables-test-allowed-diff.h 2. The unit-test 3. The binary file and clear bios-tables-test-allowed-diff.h The ASL diff would also be listed. Sice there are 1000+lines diff, some changes would be om

[PATCH v5 8/8] unit-test: add the binary file and clear diff.h

2020-04-07 Thread Yubo Miao
From: miaoyubo Add the binary file DSDT.pxb and clear bios-tables-test-allowed-diff.h Signed-off-by: miaoyubo --- tests/data/acpi/virt/DSDT.pxb | Bin 0 -> 7802 bytes tests/qtest/bios-tables-test-allowed-diff.h | 1 - 2 files changed, 1 deletion(-) create mode 100644 tests/dat

[PATCH v5 2/8] fw_cfg: Write the extra roots into the fw_cfg

2020-04-07 Thread Yubo Miao
From: miaoyubo Write the extra roots into the fw_cfg therefore the uefi could get the extra roots. Only if the uefi know there are extra roots, the config space of devices behind the root could be obtained. Signed-off-by: miaoyubo --- hw/arm/virt.c | 23 +++ 1 file changed,

[PATCH v5 3/8] acpi:Extract crs build form acpi_build.c

2020-04-07 Thread Yubo Miao
From: miaoyubo Extract crs build form acpi_build.c, the function could also be used to build the crs for pxbs for arm. The resources are composed by two parts: 1. The bar space of pci-bridge/pcie-root-ports 2. The resources devices behind PXBs need. The base and limit of memory/io are obtained fr

[PATCH v5 7/8] unit-test: Add testcase for pxb

2020-04-07 Thread Yubo Miao
From: miaoyubo Add testcase for pxb to make sure the ACPI table is correct for guest. Signed-off-by: miaoyubo --- tests/qtest/bios-tables-test.c | 58 ++ 1 file changed, 52 insertions(+), 6 deletions(-) diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/

[PATCH v5 6/8] unit-test: The files changed.

2020-04-07 Thread Yubo Miao
From: miaoyubo The unit-test is seperated into three patches: 1. The files changed and list in bios-tables-test-allowed-diff.h 2. The unit-test 3. The binary file and clear bios-tables-test-allowed-diff.h The ASL diff would also be listed. Sice there are 1000+lines diff, some changes would be om

[PATCH v5 4/8] acpi: Refactor the source of host bridge and build tables for pxb

2020-04-07 Thread Yubo Miao
From: miaoyubo The resources of pxbs and obtained by crs_build and the resources used by pxbs would be moved form the resources defined for host-bridge. 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. Sig

[PATCH v5 5/8] acpi: align the size to 128k

2020-04-07 Thread Yubo Miao
From: miaoyubo If table size is changed between virt_acpi_build and virt_acpi_build_update, the table size would not be updated to UEFI, therefore, just align the size to 128kb, which is enough and same with x86. It would warn if 64k is not enough and the align size should be updated. Signed-off

[PATCH v5 1/8] acpi:Extract two APIs from acpi_dsdt_add_pci

2020-04-07 Thread Yubo Miao
From: miaoyubo Extract two APIs acpi_dsdt_add_pci_route_table and acpi_dsdt_add_pci_osc form acpi_dsdt_add_pci. The first API is used to specify the pci route table and the second API is used to declare the operation system capabilities. These two APIs would be used to specify the pxb-pcie in DSD

[PATCH v5 0/8] pci_expander_brdige:acpi:Support pxb-pcie for ARM

2020-04-07 Thread Yubo Miao
From: miaoyubo Changes with v4 v5->v4: 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

[PATCH v4 3/3] ACPI/unit-test: Add a new test for pxb-pcie for arm

2020-02-24 Thread Yubo Miao
From: miaoyubo Currently, pxb-pcie could be defined by the cmdline like --device pxb-pcie,id=pci.9,bus_nr=128 However pxb-pcie is not described in acpi tables for arm. The formal two patches support pxb-pcie for arm, escpcially the specification for pxb-pcie in DSDT table. Add a testcase to

[PATCH v4 1/3] acpi:Extract two APIs from acpi_dsdt_add_pci

2020-02-24 Thread Yubo Miao
From: miaoyubo Extract two APIs acpi_dsdt_add_pci_route_table and acpi_dsdt_add_pci_osc form acpi_dsdt_add_pci. The first API is used to specify the pci route table and the second API is used to declare the operation system capabilities. These two APIs would be used to specify the pxb-pcie in DSD

[PATCH v4 2/3] acpi:pci-expender-bus: Add pxb support for arm

2020-02-24 Thread Yubo Miao
From: miaoyubo Currently virt machine is not supported by pxb-pcie, and only one main host bridge described in ACPI tables. In this patch,PXB-PCIE is supproted by arm and certain resource is allocated for each pxb-pcie in acpi table. The resource for the main host bridge is also reallocated. Sig

[PATCH v4 0/3] pci_expander_brdige:acpi:Support pxb-pcie for ARM

2020-02-24 Thread Yubo Miao
From: miaoyubo 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, especially host-passthrough devi

[RFC v3 2/3] acpi:pci-expender-bus: Add pxb support for arm

2020-02-20 Thread Yubo Miao
From: miaoyubo Currently virt machine is not supported by pxb-pcie, and only one main host bridge described in ACPI tables. In this patch,PXB-PCIE is supproted by arm and certain resource is allocated for each pxb-pcie in acpi table. The resource for the main host bridge is also reallocated. Sig

[RFC v3 0/3] pci_expander_brdige:acpi:Support pxb-pcie for ARM

2020-02-20 Thread Yubo Miao
From: miaoyubo 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, especially host-passthrough devi

[RFC v3 3/3] ACPI/unit-test: Add a new test for pxb-pcie for arm

2020-02-20 Thread Yubo Miao
From: miaoyubo Currently, pxb-pcie could be defined by the cmdline like --device pxb-pcie,id=pci.9,bus_nr=128 However pxb-pcie is not described in acpi tables for arm. The formal two patches support pxb-pcie for arm, escpcially the specification for pxb-pcie in DSDT table. Add a testcase to

[RFC v3 1/3] acpi:Extract two APIs from acpi_dsdt_add_pci

2020-02-20 Thread Yubo Miao
From: miaoyubo Extract two APIs acpi_dsdt_add_pci_route_table and acpi_dsdt_add_pci_osc form acpi_dsdt_add_pci. The first API is used to specify the pci route table and the second API is used to declare the operation system capabilities. These two APIs would be used to specify the pxb-pcie in DSD

[RFC v2 0/1] pci_expander_brdige:acpi:Support pxb-pcie for ARM

2020-02-17 Thread Yubo Miao
From: miaoyubo Currently pxb-pcie is not supported by arm 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 certai

[RFC v2 1/1] arm: acpi: pci-expender-bus: Make arm to support PXB-PCIE

2020-02-17 Thread Yubo Miao
From: miaoyubo Currently virt machine is not supported by pxb-pcie, and only one main host bridge described in ACPI tables. Under this circumstance, different io numas for differnt devices is not possible, in order to present io numas to the guest, especially for host pssthrough devices. PXB-PCIE

[RFC 1/2] arm: acpi: pci-expender-bus: Make arm to support PXB-PCIE

2020-02-13 Thread Yubo Miao
From: miaoyubo Currently virt machine is not supported by pxb-pcie, and only one main host bridge described in ACPI tables. Under this circumstance, different io numas for differnt devices is not possible, in order to present io numas to the guest, especially for host pssthrough devices. PXB-PCIE

[RFC 2/2] pci-expender-bus:Add pcie-root-port to pxb-pcie under arm.

2020-02-13 Thread Yubo Miao
From: miaoyubo Since devices could not directly plugged into pxb-pcie, under arm, one pcie-root port is plugged into pxb-pcie. Due to the bus for each pxb-pcie is defined as 2 in acpi dsdt tables(one for pxb-pcie, one for pcie-root-port), only one device could be plugged into one pxb-pcie. Signe

[RFC 0/2] pci_expander_brdige:acpi:Support pxb-pcie for ARM

2020-02-13 Thread Yubo Miao
From: miaoyubo Currently pxb-pcie is not supported by arm 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 certai