@samitouri / QOSamiQemu / commits / ff1d11b7bf

tests/acpi: add bios-tables-test case for sp-mem

Add a q35 bios-tables-test case that boots two sp-mem devices on distinct NUMA nodes within the device_memory window, exercising the per-kind SRAT partition (per-device ENABLED entries plus HOTPLUGGABLE placeholders for the remaining sub-ranges). Signed-off-by: FangSheng Huang <FangSheng.Huang@amd.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Message-ID: <20260623075051.3797975-8-FangSheng.Huang@amd.com>

fanhuang committed Jun 23, 2026 at 15:50 UTC ff1d11b7bfb34941c13cd70668f4f9e253c588ba
1 file changed +21
tests/qtest/bios-tables-test.c
+21
@@ -1416,6 +1416,26 @@ static void test_acpi_q35_tcg_numamem(void)
1416 free_test_data(&data);
1417 }
1418
1419 +static void test_acpi_q35_tcg_sp_mem(void)
1420 +{
1421 + test_data data = {};
1422 +
1423 + data.machine = MACHINE_Q35;
1424 + data.arch = "x86",
1425 + data.variant = ".spmem";
1426 + test_acpi_one(" -m 128M,slots=4,maxmem=1G"
1427 + " -object memory-backend-ram,id=ram0,size=128M"
1428 + " -numa node,nodeid=0,memdev=ram0"
1429 + " -numa node,nodeid=1"
1430 + " -numa node,nodeid=2"
1431 + " -object memory-backend-ram,id=spm0,size=128M"
1432 + " -object memory-backend-ram,id=spm1,size=128M"
1433 + " -device sp-mem,id=sp0,memdev=spm0,node=1"
1434 + " -device sp-mem,id=sp1,memdev=spm1,node=2",
1435 + &data);
1436 + free_test_data(&data);
1437 +}
1438 +
1439 static void test_acpi_q35_kvm_xapic(void)
1440 {
1441 test_data data = {};
@@ -2807,6 +2827,7 @@ int main(int argc, char *argv[])
2827 if (strcmp(arch, "i386")) {
2828 qtest_add_func("acpi/q35/memhp", test_acpi_q35_tcg_memhp);
2829 qtest_add_func("acpi/q35/dimmpxm", test_acpi_q35_tcg_dimm_pxm);
2830 + qtest_add_func("acpi/q35/sp-mem", test_acpi_q35_tcg_sp_mem);
2831 qtest_add_func("acpi/q35/acpihmat",
2832 test_acpi_q35_tcg_acpi_hmat);
2833 qtest_add_func("acpi/q35/mmio64", test_acpi_q35_tcg_mmio64);