From: Li Chen <chenl311@chinatelecom.cn>
Add ACPI SPCR table test case for RISC-V when SPCR was off.
Signed-off-by: Li Chen <chenl311@chinatelecom.cn>
Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
---
Notes:
Changes since v3: Add Reviewed-by from Sunil V L <sunilvl@ventanamicro.com>
tests/qtest/bios-tables-test.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c
index ede846f905..04a9d8a4da 100644
--- a/tests/qtest/bios-tables-test.c
+++ b/tests/qtest/bios-tables-test.c
@@ -1807,6 +1807,26 @@ static void test_acpi_aarch64_virt_tcg_acpi_spcr(void)
" -machine spcr=off", &data);
free_test_data(&data);
}
+
+static void test_acpi_riscv_virt_tcg_acpi_spcr(void)
+{
+ test_data data = {
+ .machine = "virt",
+ .arch = "riscv64",
+ .tcg_only = true,
+ .uefi_fl1 = "pc-bios/edk2-riscv-code.fd",
+ .uefi_fl2 = "pc-bios/edk2-riscv-vars.fd",
+ .cd = "tests/data/uefi-boot-images/bios-tables-test.riscv64.iso.qcow2",
+ .ram_start = 0x80000000ULL,
+ .scan_len = 128ULL * 1024 * 1024,
+ .variant = ".acpispcr",
+ };
+
+ test_acpi_one("-cpu rva22s64 "
+ "-machine spcr=off", &data);
+ free_test_data(&data);
+}
+
static void test_acpi_tcg_acpi_hmat(const char *machine, const char *arch)
{
test_data data = {};
@@ -2633,6 +2653,8 @@ int main(int argc, char *argv[])
qtest_add_func("acpi/virt", test_acpi_riscv64_virt_tcg);
qtest_add_func("acpi/virt/numamem",
test_acpi_riscv64_virt_tcg_numamem);
+ qtest_add_func("acpi/virt/acpispcr",
+ test_acpi_riscv_virt_tcg_acpi_spcr);
}
}
ret = g_test_run();
--
2.50.0