Lines Matching refs:data
116 static GArray *load_expected_aml(test_data *data);
140 static void free_test_data(test_data *data) in free_test_data() argument
144 if (!data->tables) { in free_test_data()
147 for (i = 0; i < data->tables->len; ++i) { in free_test_data()
148 cleanup_table_descriptor(&g_array_index(data->tables, AcpiSdtTable, i)); in free_test_data()
151 g_array_free(data->tables, true); in free_test_data()
154 static void test_acpi_rsdp_table(test_data *data) in test_acpi_rsdp_table() argument
156 uint8_t *rsdp_table = data->rsdp_table; in test_acpi_rsdp_table()
158 acpi_fetch_rsdp_table(data->qts, data->rsdp_addr, rsdp_table); in test_acpi_rsdp_table()
175 static void test_acpi_rxsdt_table(test_data *data) in test_acpi_rxsdt_table() argument
183 if (data->rsdp_table[15 /* Revision offset */] != 0) { in test_acpi_rxsdt_table()
189 acpi_fetch_table(data->qts, &rsdt.aml, &rsdt.aml_len, in test_acpi_rxsdt_table()
190 &data->rsdp_table[addr_off], entry_size, sig, true); in test_acpi_rxsdt_table()
196 acpi_fetch_table(data->qts, &ssdt_table.aml, &ssdt_table.aml_len, ent, in test_acpi_rxsdt_table()
199 g_array_append_val(data->tables, ssdt_table); in test_acpi_rxsdt_table()
204 static void test_acpi_fadt_table(test_data *data) in test_acpi_fadt_table() argument
207 AcpiSdtTable table = g_array_index(data->tables, typeof(table), 0); in test_acpi_fadt_table()
220 acpi_fetch_table(data->qts, &table.aml, &table.aml_len, in test_acpi_fadt_table()
222 g_array_append_val(data->tables, table); in test_acpi_fadt_table()
231 acpi_fetch_table(data->qts, &table.aml, &table.aml_len, in test_acpi_fadt_table()
233 g_array_append_val(data->tables, table); in test_acpi_fadt_table()
247 static void dump_aml_files(test_data *data, bool rebuild) in dump_aml_files() argument
257 exp_data.tables = load_expected_aml(data); in dump_aml_files()
258 for (i = 0; i < data->tables->len; ++i) { in dump_aml_files()
259 const char *ext = data->variant ? data->variant : ""; in dump_aml_files()
260 sdt = &g_array_index(data->tables, AcpiSdtTable, i); in dump_aml_files()
267 data->arch, data->machine, in dump_aml_files()
382 static GArray *load_expected_aml(test_data *data) in load_expected_aml() argument
394 for (i = 0; i < data->tables->len; ++i) { in load_expected_aml()
397 const char *ext = data->variant ? data->variant : ""; in load_expected_aml()
399 sdt = &g_array_index(data->tables, AcpiSdtTable, i); in load_expected_aml()
404 aml_file = g_strdup_printf("%s/%s/%s/%.4s%s", data_dir, data->arch, in load_expected_aml()
405 data->machine, sdt->aml, ext); in load_expected_aml()
455 static void test_acpi_asl(test_data *data) in test_acpi_asl() argument
462 exp_data.tables = load_expected_aml(data); in test_acpi_asl()
463 dump_aml_files(data, false); in test_acpi_asl()
464 for (i = 0; i < data->tables->len; ++i) { in test_acpi_asl()
467 sdt = &g_array_index(data->tables, AcpiSdtTable, i); in test_acpi_asl()
494 err = load_asl(data->tables, sdt); in test_acpi_asl()
558 static bool smbios_ep2_table_ok(test_data *data, uint32_t addr) in smbios_ep2_table_ok() argument
560 struct smbios_21_entry_point *ep_table = &data->smbios_ep_table.ep21; in smbios_ep2_table_ok()
562 qtest_memread(data->qts, addr, ep_table, sizeof(*ep_table)); in smbios_ep2_table_ok()
583 static bool smbios_ep3_table_ok(test_data *data, uint64_t addr) in smbios_ep3_table_ok() argument
585 struct smbios_30_entry_point *ep_table = &data->smbios_ep_table.ep30; in smbios_ep3_table_ok()
587 qtest_memread(data->qts, addr, ep_table, sizeof(*ep_table)); in smbios_ep3_table_ok()
599 static SmbiosEntryPointType test_smbios_entry_point(test_data *data) in test_smbios_entry_point() argument
609 sig[i] = qtest_readb(data->qts, off + i); in test_smbios_entry_point()
614 if (smbios_ep2_table_ok(data, off)) { in test_smbios_entry_point()
615 data->smbios_ep_addr[SMBIOS_ENTRY_POINT_TYPE_32] = off; in test_smbios_entry_point()
620 sig3[i] = qtest_readb(data->qts, off + i); in test_smbios_entry_point()
624 if (smbios_ep3_table_ok(data, off)) { in test_smbios_entry_point()
625 data->smbios_ep_addr[SMBIOS_ENTRY_POINT_TYPE_64] = off; in test_smbios_entry_point()
633 g_assert_true(data->smbios_ep_addr[SMBIOS_ENTRY_POINT_TYPE_32] || in test_smbios_entry_point()
634 data->smbios_ep_addr[SMBIOS_ENTRY_POINT_TYPE_64]); in test_smbios_entry_point()
636 return data->smbios_ep_addr[SMBIOS_ENTRY_POINT_TYPE_64] ? in test_smbios_entry_point()
656 static void smbios_cpu_test(test_data *data, uint32_t addr, in smbios_cpu_test() argument
659 uint8_t core_count, expected_core_count = data->smbios_core_count; in smbios_cpu_test()
660 uint8_t thread_count, expected_thread_count = data->smbios_thread_count; in smbios_cpu_test()
662 uint16_t core_count2, expected_core_count2 = data->smbios_core_count2; in smbios_cpu_test()
663 uint16_t thread_count2, expected_thread_count2 = data->smbios_thread_count2; in smbios_cpu_test()
670 expected_speed[0] = data->smbios_cpu_max_speed ? : 2000; in smbios_cpu_test()
671 expected_speed[1] = data->smbios_cpu_curr_speed ? : 2000; in smbios_cpu_test()
674 speed = qtest_readw(data->qts, addr + offset[i]); in smbios_cpu_test()
678 core_count = qtest_readb(data->qts, in smbios_cpu_test()
685 thread_count = qtest_readb(data->qts, in smbios_cpu_test()
693 core_count2 = qtest_readw(data->qts, in smbios_cpu_test()
701 thread_count2 = qtest_readw(data->qts, in smbios_cpu_test()
712 static void smbios_type4_count_test(test_data *data, int type4_count) in smbios_type4_count_test() argument
714 int expected_type4_count = data->type4_count; in smbios_type4_count_test()
721 static void test_smbios_structs(test_data *data, SmbiosEntryPointType ep_type) in test_smbios_structs() argument
725 SmbiosEntryPoint *ep_table = &data->smbios_ep_table; in test_smbios_structs()
740 type = qtest_readb(data->qts, addr); in test_smbios_structs()
742 len = qtest_readb(data->qts, addr + 1); in test_smbios_structs()
751 smbios_cpu_test(data, addr, ep_type); in test_smbios_structs()
759 crt = qtest_readb(data->qts, addr + len); in test_smbios_structs()
793 for (i = 0; i < data->required_struct_types_len; i++) { in test_smbios_structs()
794 g_assert(test_bit(data->required_struct_types[i], struct_bitmap)); in test_smbios_structs()
797 smbios_type4_count_test(data, type4_count); in test_smbios_structs()
800 static void test_acpi_load_tables(test_data *data) in test_acpi_load_tables() argument
802 if (data->uefi_fl1 && data->uefi_fl2) { /* use UEFI */ in test_acpi_load_tables()
803 g_assert(data->scan_len); in test_acpi_load_tables()
804 data->rsdp_addr = acpi_find_rsdp_address_uefi(data->qts, in test_acpi_load_tables()
805 data->ram_start, data->scan_len); in test_acpi_load_tables()
807 boot_sector_test(data->qts); in test_acpi_load_tables()
808 data->rsdp_addr = acpi_find_rsdp_address(data->qts); in test_acpi_load_tables()
809 g_assert_cmphex(data->rsdp_addr, <, 0x100000); in test_acpi_load_tables()
812 data->tables = g_array_new(false, true, sizeof(AcpiSdtTable)); in test_acpi_load_tables()
813 test_acpi_rsdp_table(data); in test_acpi_load_tables()
814 test_acpi_rxsdt_table(data); in test_acpi_load_tables()
815 test_acpi_fadt_table(data); in test_acpi_load_tables()
818 static char *test_acpi_create_args(test_data *data, const char *params) in test_acpi_create_args() argument
822 if (data->uefi_fl1 && data->uefi_fl2) { /* use UEFI */ in test_acpi_create_args()
827 if (data->cd) { in test_acpi_create_args()
832 data->machine, data->machine_param ?: "", in test_acpi_create_args()
833 data->tcg_only ? "" : "-accel kvm", in test_acpi_create_args()
834 data->uefi_fl1, data->uefi_fl2, data->cd, params ? params : ""); in test_acpi_create_args()
840 data->machine, data->machine_param ?: "", in test_acpi_create_args()
841 data->tcg_only ? "" : "-accel kvm", in test_acpi_create_args()
842 data->uefi_fl1, data->uefi_fl2, params ? params : ""); in test_acpi_create_args()
849 data->machine, data->machine_param ?: "", in test_acpi_create_args()
850 data->tcg_only ? "" : "-accel kvm", in test_acpi_create_args()
852 data->blkdev ?: "ide-hd"); in test_acpi_create_args()
857 static void test_vm_prepare(const char *params, test_data *data) in test_vm_prepare() argument
859 char *args = test_acpi_create_args(data, params); in test_vm_prepare()
860 data->qts = qtest_init(args); in test_vm_prepare()
864 static void process_smbios_tables_noexit(test_data *data) in process_smbios_tables_noexit() argument
871 if (!(data->uefi_fl1 && data->uefi_fl2)) { in process_smbios_tables_noexit()
872 SmbiosEntryPointType ep_type = test_smbios_entry_point(data); in process_smbios_tables_noexit()
873 test_smbios_structs(data, ep_type); in process_smbios_tables_noexit()
877 static void test_smbios(const char *params, test_data *data) in test_smbios() argument
879 test_vm_prepare(params, data); in test_smbios()
880 boot_sector_test(data->qts); in test_smbios()
881 process_smbios_tables_noexit(data); in test_smbios()
882 qtest_quit(data->qts); in test_smbios()
885 static void process_acpi_tables_noexit(test_data *data) in process_acpi_tables_noexit() argument
887 test_acpi_load_tables(data); in process_acpi_tables_noexit()
890 dump_aml_files(data, true); in process_acpi_tables_noexit()
892 test_acpi_asl(data); in process_acpi_tables_noexit()
895 process_smbios_tables_noexit(data); in process_acpi_tables_noexit()
898 static void process_acpi_tables(test_data *data) in process_acpi_tables() argument
900 process_acpi_tables_noexit(data); in process_acpi_tables()
901 qtest_quit(data->qts); in process_acpi_tables()
904 static void test_acpi_one(const char *params, test_data *data) in test_acpi_one() argument
906 test_vm_prepare(params, data); in test_acpi_one()
907 process_acpi_tables(data); in test_acpi_one()
916 test_data data = {}; in test_acpi_piix4_tcg() local
921 data.machine = MACHINE_PC; in test_acpi_piix4_tcg()
922 data.arch = "x86"; in test_acpi_piix4_tcg()
923 data.required_struct_types = base_required_struct_types; in test_acpi_piix4_tcg()
924 data.required_struct_types_len = ARRAY_SIZE(base_required_struct_types); in test_acpi_piix4_tcg()
925 test_acpi_one(NULL, &data); in test_acpi_piix4_tcg()
926 free_test_data(&data); in test_acpi_piix4_tcg()
931 test_data data = {}; in test_acpi_piix4_tcg_bridge() local
933 data.machine = MACHINE_PC; in test_acpi_piix4_tcg_bridge()
934 data.arch = "x86"; in test_acpi_piix4_tcg_bridge()
935 data.variant = ".bridge"; in test_acpi_piix4_tcg_bridge()
936 data.required_struct_types = base_required_struct_types; in test_acpi_piix4_tcg_bridge()
937 data.required_struct_types_len = ARRAY_SIZE(base_required_struct_types); in test_acpi_piix4_tcg_bridge()
942 " -device pci-testdev,bus=pci.1", &data); in test_acpi_piix4_tcg_bridge()
945 qtest_qmp_device_add(data.qts, "pci-bridge", "hpbr", in test_acpi_piix4_tcg_bridge()
947 qtest_qmp_device_add(data.qts, "pci-bridge", "hpbr_multifunc", in test_acpi_piix4_tcg_bridge()
949 qtest_qmp_device_add(data.qts, "pci-bridge", "hpbrhost", in test_acpi_piix4_tcg_bridge()
951 qtest_qmp_device_add(data.qts, "pci-testdev", "d1", "{'bus': 'pci.0' }"); in test_acpi_piix4_tcg_bridge()
952 qtest_qmp_device_add(data.qts, "pci-testdev", "d2", "{'bus': 'pci.1' }"); in test_acpi_piix4_tcg_bridge()
953 qtest_qmp_device_add(data.qts, "pci-testdev", "d3", "{'bus': 'hpbr', " in test_acpi_piix4_tcg_bridge()
955 qtest_qmp_send(data.qts, "{'execute':'cont' }"); in test_acpi_piix4_tcg_bridge()
956 qtest_qmp_eventwait(data.qts, "RESUME"); in test_acpi_piix4_tcg_bridge()
958 process_acpi_tables_noexit(&data); in test_acpi_piix4_tcg_bridge()
959 free_test_data(&data); in test_acpi_piix4_tcg_bridge()
962 qtest_qmp_send(data.qts, "{'execute':'system_reset' }"); in test_acpi_piix4_tcg_bridge()
963 process_acpi_tables(&data); in test_acpi_piix4_tcg_bridge()
964 free_test_data(&data); in test_acpi_piix4_tcg_bridge()
969 test_data data = {}; in test_acpi_piix4_no_root_hotplug() local
971 data.machine = MACHINE_PC; in test_acpi_piix4_no_root_hotplug()
972 data.arch = "x86"; in test_acpi_piix4_no_root_hotplug()
973 data.variant = ".roothp"; in test_acpi_piix4_no_root_hotplug()
974 data.required_struct_types = base_required_struct_types; in test_acpi_piix4_no_root_hotplug()
975 data.required_struct_types_len = ARRAY_SIZE(base_required_struct_types); in test_acpi_piix4_no_root_hotplug()
980 "-device pci-testdev,bus=pci.1", &data); in test_acpi_piix4_no_root_hotplug()
981 free_test_data(&data); in test_acpi_piix4_no_root_hotplug()
986 test_data data = {}; in test_acpi_piix4_no_bridge_hotplug() local
988 data.machine = MACHINE_PC; in test_acpi_piix4_no_bridge_hotplug()
989 data.arch = "x86"; in test_acpi_piix4_no_bridge_hotplug()
990 data.variant = ".hpbridge"; in test_acpi_piix4_no_bridge_hotplug()
991 data.required_struct_types = base_required_struct_types; in test_acpi_piix4_no_bridge_hotplug()
992 data.required_struct_types_len = ARRAY_SIZE(base_required_struct_types); in test_acpi_piix4_no_bridge_hotplug()
997 "-device pci-testdev,bus=pci.1,addr=2.0", &data); in test_acpi_piix4_no_bridge_hotplug()
998 free_test_data(&data); in test_acpi_piix4_no_bridge_hotplug()
1003 test_data data = {}; in test_acpi_piix4_no_acpi_pci_hotplug() local
1005 data.machine = MACHINE_PC; in test_acpi_piix4_no_acpi_pci_hotplug()
1006 data.arch = "x86"; in test_acpi_piix4_no_acpi_pci_hotplug()
1007 data.variant = ".hpbrroot"; in test_acpi_piix4_no_acpi_pci_hotplug()
1008 data.required_struct_types = base_required_struct_types; in test_acpi_piix4_no_acpi_pci_hotplug()
1009 data.required_struct_types_len = ARRAY_SIZE(base_required_struct_types); in test_acpi_piix4_no_acpi_pci_hotplug()
1019 , &data); in test_acpi_piix4_no_acpi_pci_hotplug()
1020 free_test_data(&data); in test_acpi_piix4_no_acpi_pci_hotplug()
1025 test_data data = {}; in test_acpi_q35_tcg() local
1027 data.machine = MACHINE_Q35; in test_acpi_q35_tcg()
1028 data.arch = "x86"; in test_acpi_q35_tcg()
1029 data.required_struct_types = base_required_struct_types; in test_acpi_q35_tcg()
1030 data.required_struct_types_len = ARRAY_SIZE(base_required_struct_types); in test_acpi_q35_tcg()
1031 test_acpi_one(NULL, &data); in test_acpi_q35_tcg()
1032 free_test_data(&data); in test_acpi_q35_tcg()
1034 data.smbios_cpu_max_speed = 3000; in test_acpi_q35_tcg()
1035 data.smbios_cpu_curr_speed = 2600; in test_acpi_q35_tcg()
1036 test_acpi_one("-smbios type=4,max-speed=3000,current-speed=2600", &data); in test_acpi_q35_tcg()
1037 free_test_data(&data); in test_acpi_q35_tcg()
1042 test_data data = { in test_acpi_q35_kvm_type4_count() local
1053 "dies=2,cores=4,threads=3", &data); in test_acpi_q35_kvm_type4_count()
1054 free_test_data(&data); in test_acpi_q35_kvm_type4_count()
1059 test_data data = { in test_acpi_q35_kvm_core_count() local
1071 &data); in test_acpi_q35_kvm_core_count()
1072 free_test_data(&data); in test_acpi_q35_kvm_core_count()
1077 test_data data = { in test_acpi_q35_kvm_core_count2() local
1089 &data); in test_acpi_q35_kvm_core_count2()
1090 free_test_data(&data); in test_acpi_q35_kvm_core_count2()
1095 test_data data = { in test_acpi_q35_kvm_thread_count() local
1107 &data); in test_acpi_q35_kvm_thread_count()
1108 free_test_data(&data); in test_acpi_q35_kvm_thread_count()
1113 test_data data = { in test_acpi_q35_kvm_thread_count2() local
1125 &data); in test_acpi_q35_kvm_thread_count2()
1126 free_test_data(&data); in test_acpi_q35_kvm_thread_count2()
1131 test_data data = {}; in test_acpi_q35_tcg_bridge() local
1133 data.machine = MACHINE_Q35; in test_acpi_q35_tcg_bridge()
1134 data.arch = "x86", in test_acpi_q35_tcg_bridge()
1135 data.variant = ".bridge"; in test_acpi_q35_tcg_bridge()
1136 data.required_struct_types = base_required_struct_types; in test_acpi_q35_tcg_bridge()
1137 data.required_struct_types_len = ARRAY_SIZE(base_required_struct_types); in test_acpi_q35_tcg_bridge()
1140 " -device pci-testdev,bus=br1", &data); in test_acpi_q35_tcg_bridge()
1141 free_test_data(&data); in test_acpi_q35_tcg_bridge()
1146 test_data data = {}; in test_acpi_q35_tcg_no_acpi_hotplug() local
1148 data.machine = MACHINE_Q35; in test_acpi_q35_tcg_no_acpi_hotplug()
1149 data.arch = "x86", in test_acpi_q35_tcg_no_acpi_hotplug()
1150 data.variant = ".noacpihp"; in test_acpi_q35_tcg_no_acpi_hotplug()
1151 data.required_struct_types = base_required_struct_types; in test_acpi_q35_tcg_no_acpi_hotplug()
1152 data.required_struct_types_len = ARRAY_SIZE(base_required_struct_types); in test_acpi_q35_tcg_no_acpi_hotplug()
1170 , &data); in test_acpi_q35_tcg_no_acpi_hotplug()
1171 free_test_data(&data); in test_acpi_q35_tcg_no_acpi_hotplug()
1176 test_data data = { in test_acpi_q35_multif_bridge() local
1199 , &data); in test_acpi_q35_multif_bridge()
1202 qtest_qmp_device_add(data.qts, "pci-bridge", "hpbr1", in test_acpi_q35_multif_bridge()
1204 qtest_qmp_device_add(data.qts, "pci-bridge", "hpbr2-multiif", in test_acpi_q35_multif_bridge()
1206 qtest_qmp_device_add(data.qts, "pcie-pci-bridge", "hpbr3", in test_acpi_q35_multif_bridge()
1208 qtest_qmp_device_add(data.qts, "pcie-root-port", "hprp", in test_acpi_q35_multif_bridge()
1210 qtest_qmp_device_add(data.qts, "pci-testdev", "hpnic", in test_acpi_q35_multif_bridge()
1212 qtest_qmp_send(data.qts, "{'execute':'cont' }"); in test_acpi_q35_multif_bridge()
1213 qtest_qmp_eventwait(data.qts, "RESUME"); in test_acpi_q35_multif_bridge()
1215 process_acpi_tables_noexit(&data); in test_acpi_q35_multif_bridge()
1216 free_test_data(&data); in test_acpi_q35_multif_bridge()
1219 qtest_qmp_send(data.qts, "{'execute':'system_reset' }"); in test_acpi_q35_multif_bridge()
1220 process_acpi_tables(&data); in test_acpi_q35_multif_bridge()
1221 free_test_data(&data); in test_acpi_q35_multif_bridge()
1226 test_data data = { in test_acpi_q35_tcg_mmio64() local
1240 &data); in test_acpi_q35_tcg_mmio64()
1241 free_test_data(&data); in test_acpi_q35_tcg_mmio64()
1246 test_data data = {}; in test_acpi_piix4_tcg_cphp() local
1248 data.machine = MACHINE_PC; in test_acpi_piix4_tcg_cphp()
1249 data.arch = "x86"; in test_acpi_piix4_tcg_cphp()
1250 data.variant = ".cphp"; in test_acpi_piix4_tcg_cphp()
1256 &data); in test_acpi_piix4_tcg_cphp()
1257 free_test_data(&data); in test_acpi_piix4_tcg_cphp()
1262 test_data data = {}; in test_acpi_q35_tcg_cphp() local
1264 data.machine = MACHINE_Q35; in test_acpi_q35_tcg_cphp()
1265 data.arch = "x86", in test_acpi_q35_tcg_cphp()
1266 data.variant = ".cphp"; in test_acpi_q35_tcg_cphp()
1272 &data); in test_acpi_q35_tcg_cphp()
1273 free_test_data(&data); in test_acpi_q35_tcg_cphp()
1282 test_data data = {}; in test_acpi_q35_tcg_ipmi() local
1284 data.machine = MACHINE_Q35; in test_acpi_q35_tcg_ipmi()
1285 data.arch = "x86", in test_acpi_q35_tcg_ipmi()
1286 data.variant = ".ipmibt"; in test_acpi_q35_tcg_ipmi()
1287 data.required_struct_types = ipmi_required_struct_types; in test_acpi_q35_tcg_ipmi()
1288 data.required_struct_types_len = ARRAY_SIZE(ipmi_required_struct_types); in test_acpi_q35_tcg_ipmi()
1291 &data); in test_acpi_q35_tcg_ipmi()
1292 free_test_data(&data); in test_acpi_q35_tcg_ipmi()
1297 test_data data = {}; in test_acpi_q35_tcg_smbus_ipmi() local
1299 data.machine = MACHINE_Q35; in test_acpi_q35_tcg_smbus_ipmi()
1300 data.arch = "x86", in test_acpi_q35_tcg_smbus_ipmi()
1301 data.variant = ".ipmismbus"; in test_acpi_q35_tcg_smbus_ipmi()
1302 data.required_struct_types = ipmi_required_struct_types; in test_acpi_q35_tcg_smbus_ipmi()
1303 data.required_struct_types_len = ARRAY_SIZE(ipmi_required_struct_types); in test_acpi_q35_tcg_smbus_ipmi()
1306 &data); in test_acpi_q35_tcg_smbus_ipmi()
1307 free_test_data(&data); in test_acpi_q35_tcg_smbus_ipmi()
1312 test_data data = {}; in test_acpi_piix4_tcg_ipmi() local
1317 data.machine = MACHINE_PC; in test_acpi_piix4_tcg_ipmi()
1318 data.arch = "x86"; in test_acpi_piix4_tcg_ipmi()
1319 data.variant = ".ipmikcs"; in test_acpi_piix4_tcg_ipmi()
1320 data.required_struct_types = ipmi_required_struct_types; in test_acpi_piix4_tcg_ipmi()
1321 data.required_struct_types_len = ARRAY_SIZE(ipmi_required_struct_types); in test_acpi_piix4_tcg_ipmi()
1324 &data); in test_acpi_piix4_tcg_ipmi()
1325 free_test_data(&data); in test_acpi_piix4_tcg_ipmi()
1330 test_data data = {}; in test_acpi_q35_tcg_memhp() local
1332 data.machine = MACHINE_Q35; in test_acpi_q35_tcg_memhp()
1333 data.arch = "x86", in test_acpi_q35_tcg_memhp()
1334 data.variant = ".memhp"; in test_acpi_q35_tcg_memhp()
1340 &data); in test_acpi_q35_tcg_memhp()
1341 free_test_data(&data); in test_acpi_q35_tcg_memhp()
1346 test_data data = {}; in test_acpi_piix4_tcg_memhp() local
1348 data.machine = MACHINE_PC; in test_acpi_piix4_tcg_memhp()
1349 data.arch = "x86"; in test_acpi_piix4_tcg_memhp()
1350 data.variant = ".memhp"; in test_acpi_piix4_tcg_memhp()
1356 &data); in test_acpi_piix4_tcg_memhp()
1357 free_test_data(&data); in test_acpi_piix4_tcg_memhp()
1362 test_data data = {}; in test_acpi_piix4_tcg_nosmm() local
1364 data.machine = MACHINE_PC; in test_acpi_piix4_tcg_nosmm()
1365 data.arch = "x86"; in test_acpi_piix4_tcg_nosmm()
1366 data.variant = ".nosmm"; in test_acpi_piix4_tcg_nosmm()
1367 test_acpi_one("-machine smm=off", &data); in test_acpi_piix4_tcg_nosmm()
1368 free_test_data(&data); in test_acpi_piix4_tcg_nosmm()
1373 test_data data = {}; in test_acpi_piix4_tcg_smm_compat() local
1375 data.machine = MACHINE_PC; in test_acpi_piix4_tcg_smm_compat()
1376 data.arch = "x86"; in test_acpi_piix4_tcg_smm_compat()
1377 data.variant = ".smm-compat"; in test_acpi_piix4_tcg_smm_compat()
1378 test_acpi_one("-global PIIX4_PM.smm-compat=on", &data); in test_acpi_piix4_tcg_smm_compat()
1379 free_test_data(&data); in test_acpi_piix4_tcg_smm_compat()
1384 test_data data = {}; in test_acpi_piix4_tcg_smm_compat_nosmm() local
1386 data.machine = MACHINE_PC; in test_acpi_piix4_tcg_smm_compat_nosmm()
1387 data.arch = "x86"; in test_acpi_piix4_tcg_smm_compat_nosmm()
1388 data.variant = ".smm-compat-nosmm"; in test_acpi_piix4_tcg_smm_compat_nosmm()
1389 test_acpi_one("-global PIIX4_PM.smm-compat=on -machine smm=off", &data); in test_acpi_piix4_tcg_smm_compat_nosmm()
1390 free_test_data(&data); in test_acpi_piix4_tcg_smm_compat_nosmm()
1395 test_data data = {}; in test_acpi_piix4_tcg_nohpet() local
1397 data.machine = MACHINE_PC; in test_acpi_piix4_tcg_nohpet()
1398 data.arch = "x86"; in test_acpi_piix4_tcg_nohpet()
1399 data.machine_param = ",hpet=off"; in test_acpi_piix4_tcg_nohpet()
1400 data.variant = ".nohpet"; in test_acpi_piix4_tcg_nohpet()
1401 test_acpi_one(NULL, &data); in test_acpi_piix4_tcg_nohpet()
1402 free_test_data(&data); in test_acpi_piix4_tcg_nohpet()
1407 test_data data = {}; in test_acpi_q35_tcg_numamem() local
1409 data.machine = MACHINE_Q35; in test_acpi_q35_tcg_numamem()
1410 data.arch = "x86", in test_acpi_q35_tcg_numamem()
1411 data.variant = ".numamem"; in test_acpi_q35_tcg_numamem()
1413 " -numa node -numa node,memdev=ram0", &data); in test_acpi_q35_tcg_numamem()
1414 free_test_data(&data); in test_acpi_q35_tcg_numamem()
1419 test_data data = {}; in test_acpi_q35_kvm_xapic() local
1421 data.machine = MACHINE_Q35; in test_acpi_q35_kvm_xapic()
1422 data.arch = "x86", in test_acpi_q35_kvm_xapic()
1423 data.variant = ".xapic"; in test_acpi_q35_kvm_xapic()
1426 " -machine kernel-irqchip=on -smp 1,maxcpus=288", &data); in test_acpi_q35_kvm_xapic()
1427 free_test_data(&data); in test_acpi_q35_kvm_xapic()
1432 test_data data = {}; in test_acpi_q35_tcg_nosmm() local
1434 data.machine = MACHINE_Q35; in test_acpi_q35_tcg_nosmm()
1435 data.arch = "x86", in test_acpi_q35_tcg_nosmm()
1436 data.variant = ".nosmm"; in test_acpi_q35_tcg_nosmm()
1437 test_acpi_one("-machine smm=off", &data); in test_acpi_q35_tcg_nosmm()
1438 free_test_data(&data); in test_acpi_q35_tcg_nosmm()
1443 test_data data = {}; in test_acpi_q35_tcg_smm_compat() local
1445 data.machine = MACHINE_Q35; in test_acpi_q35_tcg_smm_compat()
1446 data.arch = "x86", in test_acpi_q35_tcg_smm_compat()
1447 data.variant = ".smm-compat"; in test_acpi_q35_tcg_smm_compat()
1448 test_acpi_one("-global ICH9-LPC.smm-compat=on", &data); in test_acpi_q35_tcg_smm_compat()
1449 free_test_data(&data); in test_acpi_q35_tcg_smm_compat()
1454 test_data data = {}; in test_acpi_q35_tcg_smm_compat_nosmm() local
1456 data.machine = MACHINE_Q35; in test_acpi_q35_tcg_smm_compat_nosmm()
1457 data.arch = "x86", in test_acpi_q35_tcg_smm_compat_nosmm()
1458 data.variant = ".smm-compat-nosmm"; in test_acpi_q35_tcg_smm_compat_nosmm()
1459 test_acpi_one("-global ICH9-LPC.smm-compat=on -machine smm=off", &data); in test_acpi_q35_tcg_smm_compat_nosmm()
1460 free_test_data(&data); in test_acpi_q35_tcg_smm_compat_nosmm()
1465 test_data data = {}; in test_acpi_q35_tcg_nohpet() local
1467 data.machine = MACHINE_Q35; in test_acpi_q35_tcg_nohpet()
1468 data.arch = "x86", in test_acpi_q35_tcg_nohpet()
1469 data.machine_param = ",hpet=off"; in test_acpi_q35_tcg_nohpet()
1470 data.variant = ".nohpet"; in test_acpi_q35_tcg_nohpet()
1471 test_acpi_one(NULL, &data); in test_acpi_q35_tcg_nohpet()
1472 free_test_data(&data); in test_acpi_q35_tcg_nohpet()
1477 test_data data = {}; in test_acpi_q35_kvm_dmar() local
1479 data.machine = MACHINE_Q35; in test_acpi_q35_kvm_dmar()
1480 data.arch = "x86", in test_acpi_q35_kvm_dmar()
1481 data.variant = ".dmar"; in test_acpi_q35_kvm_dmar()
1483 " -device intel-iommu,intremap=on,device-iotlb=on", &data); in test_acpi_q35_kvm_dmar()
1484 free_test_data(&data); in test_acpi_q35_kvm_dmar()
1489 test_data data = {}; in test_acpi_q35_tcg_ivrs() local
1491 data.machine = MACHINE_Q35; in test_acpi_q35_tcg_ivrs()
1492 data.arch = "x86", in test_acpi_q35_tcg_ivrs()
1493 data.variant = ".ivrs"; in test_acpi_q35_tcg_ivrs()
1494 data.tcg_only = true, in test_acpi_q35_tcg_ivrs()
1495 test_acpi_one(" -device amd-iommu", &data); in test_acpi_q35_tcg_ivrs()
1496 free_test_data(&data); in test_acpi_q35_tcg_ivrs()
1501 test_data data = {}; in test_acpi_piix4_tcg_numamem() local
1503 data.machine = MACHINE_PC; in test_acpi_piix4_tcg_numamem()
1504 data.arch = "x86"; in test_acpi_piix4_tcg_numamem()
1505 data.variant = ".numamem"; in test_acpi_piix4_tcg_numamem()
1507 " -numa node -numa node,memdev=ram0", &data); in test_acpi_piix4_tcg_numamem()
1508 free_test_data(&data); in test_acpi_piix4_tcg_numamem()
1521 test_data data = {}; in test_acpi_tcg_tpm() local
1541 data.machine = machine; in test_acpi_tcg_tpm()
1542 data.arch = arch; in test_acpi_tcg_tpm()
1543 data.variant = variant; in test_acpi_tcg_tpm()
1551 test_acpi_one(args, &data); in test_acpi_tcg_tpm()
1561 free_test_data(&data); in test_acpi_tcg_tpm()
1576 test_data data = {}; in test_acpi_tcg_dimm_pxm() local
1578 data.machine = machine; in test_acpi_tcg_dimm_pxm()
1579 data.arch = arch; in test_acpi_tcg_dimm_pxm()
1580 data.variant = ".dimmpxm"; in test_acpi_tcg_dimm_pxm()
1600 &data); in test_acpi_tcg_dimm_pxm()
1601 free_test_data(&data); in test_acpi_tcg_dimm_pxm()
1616 test_data data = { in test_acpi_aarch64_virt_tcg_memhp() local
1627 data.variant = ".memhp"; in test_acpi_aarch64_virt_tcg_memhp()
1639 &data); in test_acpi_aarch64_virt_tcg_memhp()
1641 free_test_data(&data); in test_acpi_aarch64_virt_tcg_memhp()
1645 static void test_acpi_microvm_prepare(test_data *data) in test_acpi_microvm_prepare() argument
1647 data->machine = "microvm"; in test_acpi_microvm_prepare()
1648 data->arch = "x86"; in test_acpi_microvm_prepare()
1649 data->required_struct_types = NULL; /* no smbios */ in test_acpi_microvm_prepare()
1650 data->required_struct_types_len = 0; in test_acpi_microvm_prepare()
1651 data->blkdev = "virtio-blk-device"; in test_acpi_microvm_prepare()
1656 test_data data = {}; in test_acpi_microvm_tcg() local
1658 test_acpi_microvm_prepare(&data); in test_acpi_microvm_tcg()
1660 &data); in test_acpi_microvm_tcg()
1661 free_test_data(&data); in test_acpi_microvm_tcg()
1666 test_data data = {}; in test_acpi_microvm_usb_tcg() local
1668 test_acpi_microvm_prepare(&data); in test_acpi_microvm_usb_tcg()
1669 data.variant = ".usb"; in test_acpi_microvm_usb_tcg()
1671 &data); in test_acpi_microvm_usb_tcg()
1672 free_test_data(&data); in test_acpi_microvm_usb_tcg()
1677 test_data data = {}; in test_acpi_microvm_rtc_tcg() local
1679 test_acpi_microvm_prepare(&data); in test_acpi_microvm_rtc_tcg()
1680 data.variant = ".rtc"; in test_acpi_microvm_rtc_tcg()
1682 &data); in test_acpi_microvm_rtc_tcg()
1683 free_test_data(&data); in test_acpi_microvm_rtc_tcg()
1688 test_data data = {}; in test_acpi_microvm_pcie_tcg() local
1690 test_acpi_microvm_prepare(&data); in test_acpi_microvm_pcie_tcg()
1691 data.variant = ".pcie"; in test_acpi_microvm_pcie_tcg()
1692 data.tcg_only = true; /* need constant host-phys-bits */ in test_acpi_microvm_pcie_tcg()
1694 &data); in test_acpi_microvm_pcie_tcg()
1695 free_test_data(&data); in test_acpi_microvm_pcie_tcg()
1700 test_data data = {}; in test_acpi_microvm_ioapic2_tcg() local
1702 test_acpi_microvm_prepare(&data); in test_acpi_microvm_ioapic2_tcg()
1703 data.variant = ".ioapic2"; in test_acpi_microvm_ioapic2_tcg()
1705 &data); in test_acpi_microvm_ioapic2_tcg()
1706 free_test_data(&data); in test_acpi_microvm_ioapic2_tcg()
1711 test_data data = { in test_acpi_riscv64_virt_tcg_numamem() local
1722 data.variant = ".numamem"; in test_acpi_riscv64_virt_tcg_numamem()
1731 &data); in test_acpi_riscv64_virt_tcg_numamem()
1732 free_test_data(&data); in test_acpi_riscv64_virt_tcg_numamem()
1737 test_data data = { in test_acpi_aarch64_virt_tcg_numamem() local
1748 data.variant = ".numamem"; in test_acpi_aarch64_virt_tcg_numamem()
1752 &data); in test_acpi_aarch64_virt_tcg_numamem()
1754 free_test_data(&data); in test_acpi_aarch64_virt_tcg_numamem()
1760 test_data data = { in test_acpi_aarch64_virt_tcg_pxb() local
1776 data.variant = ".pxb"; in test_acpi_aarch64_virt_tcg_pxb()
1786 &data); in test_acpi_aarch64_virt_tcg_pxb()
1788 free_test_data(&data); in test_acpi_aarch64_virt_tcg_pxb()
1793 test_data data = {}; in test_acpi_tcg_acpi_hmat() local
1795 data.machine = machine; in test_acpi_tcg_acpi_hmat()
1796 data.arch = arch; in test_acpi_tcg_acpi_hmat()
1797 data.variant = ".acpihmat"; in test_acpi_tcg_acpi_hmat()
1819 &data); in test_acpi_tcg_acpi_hmat()
1820 free_test_data(&data); in test_acpi_tcg_acpi_hmat()
1835 test_data data = { in test_acpi_aarch64_virt_tcg_acpi_hmat() local
1846 data.variant = ".acpihmatvirt"; in test_acpi_aarch64_virt_tcg_acpi_hmat()
1886 &data); in test_acpi_aarch64_virt_tcg_acpi_hmat()
1888 free_test_data(&data); in test_acpi_aarch64_virt_tcg_acpi_hmat()
1893 test_data data = {}; in test_acpi_q35_tcg_acpi_hmat_noinitiator() local
1895 data.machine = MACHINE_Q35; in test_acpi_q35_tcg_acpi_hmat_noinitiator()
1896 data.arch = "x86"; in test_acpi_q35_tcg_acpi_hmat_noinitiator()
1897 data.variant = ".acpihmat-noinitiator"; in test_acpi_q35_tcg_acpi_hmat_noinitiator()
1935 &data); in test_acpi_q35_tcg_acpi_hmat_noinitiator()
1936 free_test_data(&data); in test_acpi_q35_tcg_acpi_hmat_noinitiator()
1942 test_data data = {}; in test_acpi_q35_tcg_acpi_hmat_generic_x() local
1944 data.machine = MACHINE_Q35; in test_acpi_q35_tcg_acpi_hmat_generic_x()
1945 data.arch = "x86"; in test_acpi_q35_tcg_acpi_hmat_generic_x()
1946 data.variant = ".acpihmat-generic-x"; in test_acpi_q35_tcg_acpi_hmat_generic_x()
2030 &data); in test_acpi_q35_tcg_acpi_hmat_generic_x()
2031 free_test_data(&data); in test_acpi_q35_tcg_acpi_hmat_generic_x()
2039 test_data data = {}; in test_acpi_erst() local
2041 data.machine = machine; in test_acpi_erst()
2042 data.arch = arch; in test_acpi_erst()
2043 data.variant = ".acpierst"; in test_acpi_erst()
2048 test_acpi_one(params, &data); in test_acpi_erst()
2049 free_test_data(&data); in test_acpi_erst()
2069 test_data data = {}; in test_acpi_microvm_acpi_erst() local
2071 test_acpi_microvm_prepare(&data); in test_acpi_microvm_acpi_erst()
2072 data.variant = ".pcie"; in test_acpi_microvm_acpi_erst()
2073 data.tcg_only = true; /* need constant host-phys-bits */ in test_acpi_microvm_acpi_erst()
2079 test_acpi_one(params, &data); in test_acpi_microvm_acpi_erst()
2083 free_test_data(&data); in test_acpi_microvm_acpi_erst()
2089 test_data data = { in test_acpi_riscv64_virt_tcg() local
2105 test_acpi_one("-cpu rva22s64 ", &data); in test_acpi_riscv64_virt_tcg()
2106 free_test_data(&data); in test_acpi_riscv64_virt_tcg()
2111 test_data data = { in test_acpi_aarch64_virt_tcg() local
2122 data.smbios_cpu_max_speed = 2900; in test_acpi_aarch64_virt_tcg()
2123 data.smbios_cpu_curr_speed = 2700; in test_acpi_aarch64_virt_tcg()
2125 "-smbios type=4,max-speed=2900,current-speed=2700", &data); in test_acpi_aarch64_virt_tcg()
2126 free_test_data(&data); in test_acpi_aarch64_virt_tcg()
2131 test_data data = { in test_acpi_aarch64_virt_tcg_topology() local
2144 "-smp sockets=1,clusters=2,cores=2,threads=2", &data); in test_acpi_aarch64_virt_tcg_topology()
2145 free_test_data(&data); in test_acpi_aarch64_virt_tcg_topology()
2150 test_data data = { in test_acpi_q35_viot() local
2165 &data); in test_acpi_q35_viot()
2166 free_test_data(&data); in test_acpi_q35_viot()
2175 test_data data = { in test_acpi_q35_cxl() local
2206 test_acpi_one(params, &data); in test_acpi_q35_cxl()
2211 free_test_data(&data); in test_acpi_q35_cxl()
2217 test_data data = { in test_acpi_aarch64_virt_viot() local
2229 "-device virtio-iommu-pci", &data); in test_acpi_aarch64_virt_viot()
2230 free_test_data(&data); in test_acpi_aarch64_virt_viot()
2241 test_data data = { in test_acpi_q35_slic() local
2250 &data); in test_acpi_q35_slic()
2251 free_test_data(&data); in test_acpi_q35_slic()
2256 test_data data = { in test_acpi_q35_applesmc() local
2264 "topreventinvalidkeywarningsonstderr", &data); in test_acpi_q35_applesmc()
2265 free_test_data(&data); in test_acpi_q35_applesmc()
2270 test_data data = { in test_acpi_q35_pvpanic_isa() local
2276 test_acpi_one("-device pvpanic", &data); in test_acpi_q35_pvpanic_isa()
2277 free_test_data(&data); in test_acpi_q35_pvpanic_isa()
2283 test_data data = { in test_acpi_pc_smbios_options() local
2291 test_smbios("-smbios type=11,value=TEST", &data); in test_acpi_pc_smbios_options()
2292 free_test_data(&data); in test_acpi_pc_smbios_options()
2298 test_data data = { in test_acpi_pc_smbios_blob() local
2307 "-smbios file=tests/data/smbios/type11_blob", &data); in test_acpi_pc_smbios_blob()
2308 free_test_data(&data); in test_acpi_pc_smbios_blob()
2314 test_data data = { in test_acpi_isapc_smbios_legacy() local
2322 "-smbios type=1,family=TEST", &data); in test_acpi_isapc_smbios_legacy()
2323 free_test_data(&data); in test_acpi_isapc_smbios_legacy()
2326 static void test_oem_fields(test_data *data) in test_oem_fields() argument
2330 for (i = 0; i < data->tables->len; ++i) { in test_oem_fields()
2333 sdt = &g_array_index(data->tables, AcpiSdtTable, i); in test_oem_fields()
2347 test_data data = {}; in test_acpi_piix4_oem_fields() local
2349 data.machine = MACHINE_PC; in test_acpi_piix4_oem_fields()
2350 data.arch = "x86"; in test_acpi_piix4_oem_fields()
2351 data.required_struct_types = base_required_struct_types; in test_acpi_piix4_oem_fields()
2352 data.required_struct_types_len = ARRAY_SIZE(base_required_struct_types); in test_acpi_piix4_oem_fields()
2354 args = test_acpi_create_args(&data, OEM_TEST_ARGS); in test_acpi_piix4_oem_fields()
2355 data.qts = qtest_init(args); in test_acpi_piix4_oem_fields()
2356 test_acpi_load_tables(&data); in test_acpi_piix4_oem_fields()
2357 test_oem_fields(&data); in test_acpi_piix4_oem_fields()
2358 qtest_quit(data.qts); in test_acpi_piix4_oem_fields()
2359 free_test_data(&data); in test_acpi_piix4_oem_fields()
2366 test_data data = {}; in test_acpi_q35_oem_fields() local
2368 data.machine = MACHINE_Q35; in test_acpi_q35_oem_fields()
2369 data.arch = "x86"; in test_acpi_q35_oem_fields()
2370 data.required_struct_types = base_required_struct_types; in test_acpi_q35_oem_fields()
2371 data.required_struct_types_len = ARRAY_SIZE(base_required_struct_types); in test_acpi_q35_oem_fields()
2373 args = test_acpi_create_args(&data, OEM_TEST_ARGS); in test_acpi_q35_oem_fields()
2374 data.qts = qtest_init(args); in test_acpi_q35_oem_fields()
2375 test_acpi_load_tables(&data); in test_acpi_q35_oem_fields()
2376 test_oem_fields(&data); in test_acpi_q35_oem_fields()
2377 qtest_quit(data.qts); in test_acpi_q35_oem_fields()
2378 free_test_data(&data); in test_acpi_q35_oem_fields()
2384 test_data data = {}; in test_acpi_microvm_oem_fields() local
2387 test_acpi_microvm_prepare(&data); in test_acpi_microvm_oem_fields()
2389 args = test_acpi_create_args(&data, in test_acpi_microvm_oem_fields()
2391 data.qts = qtest_init(args); in test_acpi_microvm_oem_fields()
2392 test_acpi_load_tables(&data); in test_acpi_microvm_oem_fields()
2393 test_oem_fields(&data); in test_acpi_microvm_oem_fields()
2394 qtest_quit(data.qts); in test_acpi_microvm_oem_fields()
2395 free_test_data(&data); in test_acpi_microvm_oem_fields()
2401 test_data data = { in test_acpi_aarch64_virt_oem_fields() local
2413 args = test_acpi_create_args(&data, "-cpu cortex-a57 "OEM_TEST_ARGS); in test_acpi_aarch64_virt_oem_fields()
2414 data.qts = qtest_init(args); in test_acpi_aarch64_virt_oem_fields()
2415 test_acpi_load_tables(&data); in test_acpi_aarch64_virt_oem_fields()
2416 test_oem_fields(&data); in test_acpi_aarch64_virt_oem_fields()
2417 qtest_quit(data.qts); in test_acpi_aarch64_virt_oem_fields()
2418 free_test_data(&data); in test_acpi_aarch64_virt_oem_fields()