qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

tests/bios-tables-test: add test cases for DIMM proximity

QEMU now builds one SRAT memory affinity structure for each PC-DIMM
and NVDIMM device presented at boot time with the proximity domain
specified in the device option 'node', rather than only one SRAT
memory affinity structure covering the entire hotpluggable address
space with the proximity domain of the last node.

Add test cases on PC and Q35 machines with 4 proximity domains, and
one PC-DIMM and one NVDIMM attached to the 2nd and 3rd proximity
domains respectively. Check whether the QEMU-built SRAT tables match
with the expected ones.

The following ACPI tables need to be added for this test:
tests/acpi-test-data/pc/APIC.dimmpxm
tests/acpi-test-data/pc/DSDT.dimmpxm
tests/acpi-test-data/pc/NFIT.dimmpxm
tests/acpi-test-data/pc/SRAT.dimmpxm
tests/acpi-test-data/pc/SSDT.dimmpxm
tests/acpi-test-data/q35/APIC.dimmpxm
tests/acpi-test-data/q35/DSDT.dimmpxm
tests/acpi-test-data/q35/NFIT.dimmpxm
tests/acpi-test-data/q35/SRAT.dimmpxm
tests/acpi-test-data/q35/SSDT.dimmpxm
New APIC and DSDT are needed because of the multiple processors
configuration. New NFIT and SSDT are needed because of NVDIMM.

Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>
Suggested-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

authored by

Haozhong Zhang and committed by
Michael S. Tsirkin
adae91ce 848a1cc1

+38
+38
tests/bios-tables-test.c
··· 823 823 free_test_data(&data); 824 824 } 825 825 826 + static void test_acpi_tcg_dimm_pxm(const char *machine) 827 + { 828 + test_data data; 829 + 830 + memset(&data, 0, sizeof(data)); 831 + data.machine = machine; 832 + data.variant = ".dimmpxm"; 833 + test_acpi_one(" -machine nvdimm=on" 834 + " -smp 4,sockets=4" 835 + " -m 128M,slots=3,maxmem=1G" 836 + " -numa node,mem=32M,nodeid=0" 837 + " -numa node,mem=32M,nodeid=1" 838 + " -numa node,mem=32M,nodeid=2" 839 + " -numa node,mem=32M,nodeid=3" 840 + " -numa cpu,node-id=0,socket-id=0" 841 + " -numa cpu,node-id=1,socket-id=1" 842 + " -numa cpu,node-id=2,socket-id=2" 843 + " -numa cpu,node-id=3,socket-id=3" 844 + " -object memory-backend-ram,id=ram0,size=128M" 845 + " -object memory-backend-ram,id=nvm0,size=128M" 846 + " -device pc-dimm,id=dimm0,memdev=ram0,node=1" 847 + " -device nvdimm,id=dimm1,memdev=nvm0,node=2", 848 + &data); 849 + free_test_data(&data); 850 + } 851 + 852 + static void test_acpi_q35_tcg_dimm_pxm(void) 853 + { 854 + test_acpi_tcg_dimm_pxm(MACHINE_Q35); 855 + } 856 + 857 + static void test_acpi_piix4_tcg_dimm_pxm(void) 858 + { 859 + test_acpi_tcg_dimm_pxm(MACHINE_PC); 860 + } 861 + 826 862 int main(int argc, char *argv[]) 827 863 { 828 864 const char *arch = qtest_get_arch(); ··· 847 883 qtest_add_func("acpi/q35/memhp", test_acpi_q35_tcg_memhp); 848 884 qtest_add_func("acpi/piix4/numamem", test_acpi_piix4_tcg_numamem); 849 885 qtest_add_func("acpi/q35/numamem", test_acpi_q35_tcg_numamem); 886 + qtest_add_func("acpi/piix4/dimmpxm", test_acpi_piix4_tcg_dimm_pxm); 887 + qtest_add_func("acpi/q35/dimmpxm", test_acpi_q35_tcg_dimm_pxm); 850 888 } 851 889 ret = g_test_run(); 852 890 boot_sector_cleanup(disk);