aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGustavo Romero <gustavo.romero@linaro.org>2025-07-14 10:05:18 +0200
committerMichael S. Tsirkin <mst@redhat.com>2025-07-15 02:56:40 -0400
commit72140ff2a14545f3c7835c8531cb51255b652d2e (patch)
tree10e739d3762f5a53ae56abe02f8e922fa5391991
parent099ea5daeae0b1acb386b9e3c99838798cb0f690 (diff)
downloadqemu-72140ff2a14545f3c7835c8531cb51255b652d2e.zip
qemu-72140ff2a14545f3c7835c8531cb51255b652d2e.tar.gz
qemu-72140ff2a14545f3c7835c8531cb51255b652d2e.tar.bz2
tests/qtest/bios-tables-test: Add aarch64 ACPI PCI hotplug test
Add 2 new tests: - test_acpi_aarch64_virt_acpi_pci_hotplug tests the acpi pci hotplug using -global acpi-ged.acpi-pci-hotplug-with-bridge-support=on - test_acpi_aarch64_virt_pcie_root_port_hpoff tests static-acpi index on a root port with disabled hotplug Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org> 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-35-eric.auger@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
-rw-r--r--tests/qtest/bios-tables-test.c52
1 files changed, 52 insertions, 0 deletions
diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c
index 4701975..6aec68d 100644
--- a/tests/qtest/bios-tables-test.c
+++ b/tests/qtest/bios-tables-test.c
@@ -1643,6 +1643,54 @@ static void test_acpi_aarch64_virt_tcg_memhp(void)
}
+static void test_acpi_aarch64_virt_acpi_pci_hotplug(void)
+{
+ test_data data = {
+ .machine = "virt",
+ .arch = "aarch64",
+ .tcg_only = true,
+ .uefi_fl1 = "pc-bios/edk2-aarch64-code.fd",
+ .uefi_fl2 = "pc-bios/edk2-arm-vars.fd",
+ .cd = "tests/data/uefi-boot-images/bios-tables-test.aarch64.iso.qcow2",
+ .ram_start = 0x40000000ULL,
+ .scan_len = 256ULL * MiB,
+ .variant = ".acpipcihp",
+ };
+
+ /* Use ACPI PCI Hotplug */
+ test_acpi_one(" -global acpi-ged.acpi-pci-hotplug-with-bridge-support=on"
+ " -cpu cortex-a57"
+ " -device pcie-root-port,id=pcie.1,bus=pcie.0,chassis=0,slot=1,addr=7.0"
+ " -device pci-testdev,bus=pcie.1",
+ &data);
+
+ free_test_data(&data);
+}
+
+static void test_acpi_aarch64_virt_pcie_root_port_hpoff(void)
+{
+ test_data data = {
+ .machine = "virt",
+ .arch = "aarch64",
+ .tcg_only = true,
+ .uefi_fl1 = "pc-bios/edk2-aarch64-code.fd",
+ .uefi_fl2 = "pc-bios/edk2-arm-vars.fd",
+ .cd = "tests/data/uefi-boot-images/bios-tables-test.aarch64.iso.qcow2",
+ .ram_start = 0x40000000ULL,
+ .scan_len = 256ULL * MiB,
+ .variant = ".hpoffacpiindex",
+ };
+
+ /* turn hotplug off on the pcie-root-port and use static acpi-index*/
+ test_acpi_one(" -device pcie-root-port,id=pcie.1,chassis=0,"
+ "slot=1,hotplug=off,addr=7.0"
+ " -device pci-testdev,bus=pcie.1,acpi-index=12"
+ " -cpu cortex-a57",
+ &data);
+
+ free_test_data(&data);
+}
+
static void test_acpi_microvm_prepare(test_data *data)
{
data->machine = "microvm";
@@ -2708,6 +2756,10 @@ int main(int argc, char *argv[])
qtest_add_func("acpi/virt/numamem",
test_acpi_aarch64_virt_tcg_numamem);
qtest_add_func("acpi/virt/memhp", test_acpi_aarch64_virt_tcg_memhp);
+ qtest_add_func("acpi/virt/acpipcihp",
+ test_acpi_aarch64_virt_acpi_pci_hotplug);
+ qtest_add_func("acpi/virt/hpoffacpiindex",
+ test_acpi_aarch64_virt_pcie_root_port_hpoff);
qtest_add_func("acpi/virt/pxb", test_acpi_aarch64_virt_tcg_pxb);
qtest_add_func("acpi/virt/oem-fields",
test_acpi_aarch64_virt_oem_fields);