Skip to contentSkip to conversation

Add support for RISC-V ACPI tests

PATCH Superseded Sunil V L 5 participants 34 messages May 24, 2024 – Jun 20, 2024

Subsystems (2)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Sunil V L

author
#0 lore raw

v2 cover Add support for RISC-V ACPI tests

Currently, bios-table-test doesn't support RISC-V. This series enables the framework changes required and basic testing. Things like NUMA related test cases will be added later.

This needs refactoring/renaming of ARM64 bios table tests. Importantly, the test cases now look for the expected AML files under tests/data/acpi/virt/aarch64 path instead of directly under tests/data/acpi/virt. To keep test cases not to fail because of this movement, they are updated to look for both paths first.

As part of this effort, it is found that uefi-test-tools is currently broken to build. So, updated its Makefile as well to use python based edk2 build script.

The changes are also available at branch
https://gitlab.com/vlsunil/qemu/-/tree/riscv_bios_table_test_v2

Changes since v1:
1) Addressed feedback from Gerd and Alistair
2) Rebased and added tags received

Sunil V L (12):
uefi-test-tools/UefiTestToolsPkg: Add RISC-V support
uefi-test-tools: Add support for python based build script tests/data/uefi-boot-images: Add RISC-V ISO image
qtest: bios-tables-test: Rename aarch64 tests with aarch64 in them tests/qtest/bios-tables-test.c: Add support for arch in path tests/data/acpi/virt: Move ACPI tables under aarch64 meson.build: Add RISC-V to the edk2-target list pc-bios/meson.build: Add support for RISC-V in unpack_edk2_blobs tests/data/acpi/rebuild-expected-aml.sh: Add RISC-V tests/qtest/bios-tables-test: Add empty ACPI data files for RISC-V tests/qtest/bios-tables-test.c: Enable basic testing for RISC-V tests/qtest/bios-tables-test: Add expected ACPI data files for RISC-V

 meson.build                                   |   2 +-
 pc-bios/meson.build                           |   2 +
 tests/data/acpi/rebuild-expected-aml.sh       |   5 +-
 tests/data/acpi/virt/{ => aarch64}/APIC       | Bin
 .../acpi/virt/{ => aarch64}/APIC.acpihmatvirt | Bin
 .../acpi/virt/{ => aarch64}/APIC.topology     | Bin
 tests/data/acpi/virt/{ => aarch64}/DBG2       | Bin
 tests/data/acpi/virt/{ => aarch64}/DSDT       | Bin
 .../acpi/virt/{ => aarch64}/DSDT.acpihmatvirt | Bin
 tests/data/acpi/virt/{ => aarch64}/DSDT.memhp | Bin
 tests/data/acpi/virt/{ => aarch64}/DSDT.pxb   | Bin
 .../acpi/virt/{ => aarch64}/DSDT.topology     | Bin
 tests/data/acpi/virt/{ => aarch64}/FACP       | Bin
 tests/data/acpi/virt/{ => aarch64}/GTDT       | Bin
 .../acpi/virt/{ => aarch64}/HMAT.acpihmatvirt | Bin
 tests/data/acpi/virt/{ => aarch64}/IORT       | Bin
 tests/data/acpi/virt/{ => aarch64}/MCFG       | Bin
 tests/data/acpi/virt/{ => aarch64}/NFIT.memhp | Bin
 tests/data/acpi/virt/{ => aarch64}/PPTT       | Bin
 .../acpi/virt/{ => aarch64}/PPTT.acpihmatvirt | Bin
 .../acpi/virt/{ => aarch64}/PPTT.topology     | Bin
 tests/data/acpi/virt/{ => aarch64}/SLIT.memhp | Bin
 tests/data/acpi/virt/{ => aarch64}/SPCR       | Bin
 .../acpi/virt/{ => aarch64}/SRAT.acpihmatvirt | Bin
 tests/data/acpi/virt/{ => aarch64}/SRAT.memhp | Bin
 .../data/acpi/virt/{ => aarch64}/SRAT.numamem | Bin
 tests/data/acpi/virt/{ => aarch64}/SSDT.memhp | Bin
 tests/data/acpi/virt/{ => aarch64}/VIOT       | Bin
 tests/data/acpi/virt/riscv64/APIC             | Bin 0 -> 116 bytes
 tests/data/acpi/virt/riscv64/DSDT             | Bin 0 -> 3518 bytes
 tests/data/acpi/virt/riscv64/FACP             | Bin 0 -> 276 bytes
 tests/data/acpi/virt/riscv64/MCFG             | Bin 0 -> 60 bytes
 tests/data/acpi/virt/riscv64/RHCT             | Bin 0 -> 314 bytes
 tests/data/acpi/virt/riscv64/SPCR             | Bin 0 -> 80 bytes
 .../bios-tables-test.riscv64.iso.qcow2        | Bin 0 -> 16896 bytes
 tests/qtest/bios-tables-test.c                |  93 ++++++++++++++----
 tests/qtest/meson.build                       |   3 +
 tests/uefi-test-tools/Makefile                |  19 ++--
 .../UefiTestToolsPkg/UefiTestToolsPkg.dsc     |   6 +-
 tests/uefi-test-tools/uefi-test-build.config  |  52 ++++++++++
 40 files changed, 147 insertions(+), 35 deletions(-)
 rename tests/data/acpi/virt/{ => aarch64}/APIC (100%)
 rename tests/data/acpi/virt/{ => aarch64}/APIC.acpihmatvirt (100%)
 rename tests/data/acpi/virt/{ => aarch64}/APIC.topology (100%)
 rename tests/data/acpi/virt/{ => aarch64}/DBG2 (100%)
 rename tests/data/acpi/virt/{ => aarch64}/DSDT (100%)
 rename tests/data/acpi/virt/{ => aarch64}/DSDT.acpihmatvirt (100%)
 rename tests/data/acpi/virt/{ => aarch64}/DSDT.memhp (100%)
 rename tests/data/acpi/virt/{ => aarch64}/DSDT.pxb (100%)
 rename tests/data/acpi/virt/{ => aarch64}/DSDT.topology (100%)
 rename tests/data/acpi/virt/{ => aarch64}/FACP (100%)
 rename tests/data/acpi/virt/{ => aarch64}/GTDT (100%)
 rename tests/data/acpi/virt/{ => aarch64}/HMAT.acpihmatvirt (100%)
 rename tests/data/acpi/virt/{ => aarch64}/IORT (100%)
 rename tests/data/acpi/virt/{ => aarch64}/MCFG (100%)
 rename tests/data/acpi/virt/{ => aarch64}/NFIT.memhp (100%)
 rename tests/data/acpi/virt/{ => aarch64}/PPTT (100%)
 rename tests/data/acpi/virt/{ => aarch64}/PPTT.acpihmatvirt (100%)
 rename tests/data/acpi/virt/{ => aarch64}/PPTT.topology (100%)
 rename tests/data/acpi/virt/{ => aarch64}/SLIT.memhp (100%)
 rename tests/data/acpi/virt/{ => aarch64}/SPCR (100%)
 rename tests/data/acpi/virt/{ => aarch64}/SRAT.acpihmatvirt (100%)
 rename tests/data/acpi/virt/{ => aarch64}/SRAT.memhp (100%)
 rename tests/data/acpi/virt/{ => aarch64}/SRAT.numamem (100%)
 rename tests/data/acpi/virt/{ => aarch64}/SSDT.memhp (100%)
 rename tests/data/acpi/virt/{ => aarch64}/VIOT (100%)
 create mode 100644 tests/data/acpi/virt/riscv64/APIC
 create mode 100644 tests/data/acpi/virt/riscv64/DSDT
 create mode 100644 tests/data/acpi/virt/riscv64/FACP
 create mode 100644 tests/data/acpi/virt/riscv64/MCFG
 create mode 100644 tests/data/acpi/virt/riscv64/RHCT
 create mode 100644 tests/data/acpi/virt/riscv64/SPCR
 create mode 100644 tests/data/uefi-boot-images/bios-tables-test.riscv64.iso.qcow2
 create mode 100644 tests/uefi-test-tools/uefi-test-build.config
Signature · 1 line
2.40.1
author
#1 lore raw

PATCH v2 1/12 uefi-test-tools/UefiTestToolsPkg: Add RISC-V support

Enable building the test application for RISC-V with appropriate dependencies updated.

---
 tests/uefi-test-tools/UefiTestToolsPkg/UefiTestToolsPkg.dsc | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
tests/uefi-test-tools/UefiTestToolsPkg/UefiTestToolsPkg.dsc +5 -1
index c8511cd732..0902fd3c73 100644
@@ -19,7 +19,7 @@
   PLATFORM_VERSION        = 0.1
   PLATFORM_NAME           = UefiTestTools
   SKUID_IDENTIFIER        = DEFAULT
-  SUPPORTED_ARCHITECTURES = ARM|AARCH64|IA32|X64
+  SUPPORTED_ARCHITECTURES = ARM|AARCH64|IA32|X64|RISCV64
   BUILD_TARGETS           = DEBUG
 
 [BuildOptions.IA32]
@@ -60,6 +60,10 @@
 
 [LibraryClasses.IA32, LibraryClasses.X64]
   BaseMemoryLib|MdePkg/Library/BaseMemoryLibRepStr/BaseMemoryLibRepStr.inf
+  RegisterFilterLib|MdePkg/Library/RegisterFilterLibNull/RegisterFilterLibNull.inf
+
+[LibraryClasses.RISCV64]
+  BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
 
 [PcdsFixedAtBuild]
   gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x8040004F
Signature · 1 line
2.40.1
Acked-by on v2 1/12
#2 lore raw

Re: [PATCH v2 01/12] uefi-test-tools/UefiTestToolsPkg: Add RISC-V support

Quoted 6 lines · Sunil V L

Enable building the test application for RISC-V with appropriate dependencies updated.

Alistair

Quoted 31 lines
---
 tests/uefi-test-tools/UefiTestToolsPkg/UefiTestToolsPkg.dsc | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
tests/uefi-test-tools/UefiTestToolsPkg/UefiTestToolsPkg.dsc +5 -2
index c8511cd732..0902fd3c73 100644
@@ -19,7 +19,7 @@
   PLATFORM_VERSION        = 0.1
   PLATFORM_NAME           = UefiTestTools
   SKUID_IDENTIFIER        = DEFAULT
-  SUPPORTED_ARCHITECTURES = ARM|AARCH64|IA32|X64
+  SUPPORTED_ARCHITECTURES = ARM|AARCH64|IA32|X64|RISCV64
   BUILD_TARGETS           = DEBUG
 
 [BuildOptions.IA32]
@@ -60,6 +60,10 @@
 
 [LibraryClasses.IA32, LibraryClasses.X64]
   BaseMemoryLib|MdePkg/Library/BaseMemoryLibRepStr/BaseMemoryLibRepStr.inf
+  RegisterFilterLib|MdePkg/Library/RegisterFilterLibNull/RegisterFilterLibNull.inf
+
+[LibraryClasses.RISCV64]
+  BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
 
 [PcdsFixedAtBuild]
   gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x8040004F
--

2.40.1

author
#3 lore raw

PATCH v2 2/12 uefi-test-tools: Add support for python based build script

In reply to Sunil V L

edk2-funcs.sh which is used in this Makefile, was removed in the commit c28a2891f3 ("edk2: update build script"). It is replaced with a python based script. So, update the Makefile and add the configuration file as required to support the python based build script.

---
 tests/uefi-test-tools/Makefile               | 19 +++----
 tests/uefi-test-tools/uefi-test-build.config | 52 ++++++++++++++++++++
 2 files changed, 59 insertions(+), 12 deletions(-)
 create mode 100644 tests/uefi-test-tools/uefi-test-build.config
tests/uefi-test-tools/Makefile +7 -12
index 0c003f2877..f4eaebd8ff 100644
@@ -12,7 +12,7 @@
 
 edk2_dir              := ../../roms/edk2
 images_dir            := ../data/uefi-boot-images
-emulation_targets     := arm aarch64 i386 x86_64
+emulation_targets     := arm aarch64 i386 x86_64 riscv64
 uefi_binaries         := bios-tables-test
 intermediate_suffixes := .efi .fat .iso.raw
 
@@ -56,7 +56,8 @@ Build/%.iso.raw: Build/%.fat
 # stripped from, the argument.
 map_arm_to_uefi     = $(subst arm,ARM,$(1))
 map_aarch64_to_uefi = $(subst aarch64,AA64,$(call map_arm_to_uefi,$(1)))
-map_i386_to_uefi    = $(subst i386,IA32,$(call map_aarch64_to_uefi,$(1)))
+map_riscv64_to_uefi = $(subst riscv64,RISCV64,$(call map_aarch64_to_uefi,$(1)))
+map_i386_to_uefi    = $(subst i386,IA32,$(call map_riscv64_to_uefi,$(1)))
 map_x86_64_to_uefi  = $(subst x86_64,X64,$(call map_i386_to_uefi,$(1)))
 map_to_uefi         = $(subst .,,$(call map_x86_64_to_uefi,$(1)))
 
@@ -70,7 +71,7 @@ Build/%.fat: Build/%.efi
 	uefi_bin_b=$$(stat --format=%s -- $<) && \
 		uefi_fat_kb=$$(( (uefi_bin_b * 11 / 10 + 1023) / 1024 )) && \
 		uefi_fat_kb=$$(( uefi_fat_kb >= 64 ? uefi_fat_kb : 64 )) && \
-		mkdosfs -C $@ -n $(basename $(@F)) -- $$uefi_fat_kb
+		mkdosfs -C $@ -n "bios-test" -- $$uefi_fat_kb
 	MTOOLS_SKIP_CHECK=1 mmd -i $@ ::EFI
 	MTOOLS_SKIP_CHECK=1 mmd -i $@ ::EFI/BOOT
 	MTOOLS_SKIP_CHECK=1 mcopy -i $@ -- $< \
@@ -95,15 +96,9 @@ Build/%.fat: Build/%.efi
 # we must mark the recipe manually as recursive, by using the "+" indicator.
 # This way, when the inner "make" starts a parallel build of the target edk2
 # module, it can communicate with the outer "make"'s job server.
-Build/bios-tables-test.%.efi: build-edk2-tools
-	+./build.sh $(edk2_dir) BiosTablesTest $* $@
-
-build-edk2-tools:
-	cd $(edk2_dir)/BaseTools && git submodule update --init --force
-	$(MAKE) -C $(edk2_dir)/BaseTools \
-		PYTHON_COMMAND=$${EDK2_PYTHON_COMMAND:-python3} \
-		EXTRA_OPTFLAGS='$(EDK2_BASETOOLS_OPTFLAGS)' \
-		EXTRA_LDFLAGS='$(EDK2_BASETOOLS_LDFLAGS)'
+Build/bios-tables-test.%.efi:
+	$(PYTHON) ../../roms/edk2-build.py --config uefi-test-build.config \
+		--match $*
 
 clean:
 	rm -rf Build Conf log
tests/uefi-test-tools/uefi-test-build.config new file +52 -0

52 lines not on this page · raw message

Signature · 1 line
2.40.1
author
#4 lore raw

PATCH v2 3/12 tests/data/uefi-boot-images: Add RISC-V ISO image

In reply to Sunil V L

To test ACPI tables, edk2 needs to be booted with a disk image having EFI partition. This image is created using UefiTestToolsPkg.

The image is generated using tests/uefi-test-tools source.

---
 .../bios-tables-test.riscv64.iso.qcow2          | Bin 0 -> 16896 bytes
 tests/uefi-test-tools/uefi-test-build.config    |   2 +-
 2 files changed, 1 insertion(+), 1 deletion(-)
 create mode 100644 tests/data/uefi-boot-images/bios-tables-test.riscv64.iso.qcow2
tests/data/uefi-boot-images/bios-tables-test.riscv64.iso.qcow2 new file binary +0 -0
new file mode 100644
index 0000000000000000000000000000000000000000..c720bf99a45fab6d1e21963cca563ee0ea059b82
GIT binary patch
tests/uefi-test-tools/uefi-test-build.config +1 -1
index 1f389ae541..a4c61fc97a 100644
@@ -24,7 +24,7 @@ cpy1 = AARCH64/BiosTablesTest.efi  bios-tables-test.aarch64.efi
 ####################################################################################
 # riscv64
 
-[build.riscv]
+[build.riscv64]
 conf = UefiTestToolsPkg/UefiTestToolsPkg.dsc
 plat = UefiTestTools
 dest = ./Build
Signature · 1 line
2.40.1
author
#5 lore raw

PATCH v2 4/12 qtest: bios-tables-test: Rename aarch64 tests with aarch64 in them

In reply to Sunil V L

Existing AARCH64 virt test functions do not have AARCH64 in their name. To add RISC-V virt related test cases, better to rename existing functions to indicate they are ARM only.

---
 tests/qtest/bios-tables-test.c | 35 ++++++++++++++++++----------------
 1 file changed, 19 insertions(+), 16 deletions(-)
tests/qtest/bios-tables-test.c +19 -16
index d1ff4db7a2..c4a4d1c7bf 100644
@@ -1570,7 +1570,7 @@ static void test_acpi_piix4_tcg_dimm_pxm(void)
     test_acpi_tcg_dimm_pxm(MACHINE_PC);
 }
 
-static void test_acpi_virt_tcg_memhp(void)
+static void test_acpi_aarch64_virt_tcg_memhp(void)
 {
     test_data data = {
         .machine = "virt",
@@ -1663,7 +1663,7 @@ static void test_acpi_microvm_ioapic2_tcg(void)
     free_test_data(&data);
 }
 
-static void test_acpi_virt_tcg_numamem(void)
+static void test_acpi_aarch64_virt_tcg_numamem(void)
 {
     test_data data = {
         .machine = "virt",
@@ -1685,7 +1685,7 @@ static void test_acpi_virt_tcg_numamem(void)
 
 }
 
-static void test_acpi_virt_tcg_pxb(void)
+static void test_acpi_aarch64_virt_tcg_pxb(void)
 {
     test_data data = {
         .machine = "virt",
@@ -1758,7 +1758,7 @@ static void test_acpi_piix4_tcg_acpi_hmat(void)
     test_acpi_tcg_acpi_hmat(MACHINE_PC);
 }
 
-static void test_acpi_virt_tcg_acpi_hmat(void)
+static void test_acpi_aarch64_virt_tcg_acpi_hmat(void)
 {
     test_data data = {
         .machine = "virt",
@@ -1914,7 +1914,7 @@ static void test_acpi_microvm_acpi_erst(void)
 }
 #endif /* CONFIG_POSIX */
 
-static void test_acpi_virt_tcg(void)
+static void test_acpi_aarch64_virt_tcg(void)
 {
     test_data data = {
         .machine = "virt",
@@ -1933,7 +1933,7 @@ static void test_acpi_virt_tcg(void)
     free_test_data(&data);
 }
 
-static void test_acpi_virt_tcg_topology(void)
+static void test_acpi_aarch64_virt_tcg_topology(void)
 {
     test_data data = {
         .machine = "virt",
@@ -2016,7 +2016,7 @@ static void test_acpi_q35_cxl(void)
 }
 #endif /* CONFIG_POSIX */
 
-static void test_acpi_virt_viot(void)
+static void test_acpi_aarch64_virt_viot(void)
 {
     test_data data = {
         .machine = "virt",
@@ -2192,7 +2192,7 @@ static void test_acpi_microvm_oem_fields(void)
     g_free(args);
 }
 
-static void test_acpi_virt_oem_fields(void)
+static void test_acpi_aarch64_virt_oem_fields(void)
 {
     test_data data = {
         .machine = "virt",
@@ -2364,16 +2364,19 @@ int main(int argc, char *argv[])
         }
     } else if (strcmp(arch, "aarch64") == 0) {
         if (has_tcg && qtest_has_device("virtio-blk-pci")) {
-            qtest_add_func("acpi/virt", test_acpi_virt_tcg);
+            qtest_add_func("acpi/virt", test_acpi_aarch64_virt_tcg);
             qtest_add_func("acpi/virt/acpihmatvirt",
-                            test_acpi_virt_tcg_acpi_hmat);
-            qtest_add_func("acpi/virt/topology", test_acpi_virt_tcg_topology);
-            qtest_add_func("acpi/virt/numamem", test_acpi_virt_tcg_numamem);
-            qtest_add_func("acpi/virt/memhp", test_acpi_virt_tcg_memhp);
-            qtest_add_func("acpi/virt/pxb", test_acpi_virt_tcg_pxb);
-            qtest_add_func("acpi/virt/oem-fields", test_acpi_virt_oem_fields);
+                           test_acpi_aarch64_virt_tcg_acpi_hmat);
+            qtest_add_func("acpi/virt/topology",
+                           test_acpi_aarch64_virt_tcg_topology);
+            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/pxb", test_acpi_aarch64_virt_tcg_pxb);
+            qtest_add_func("acpi/virt/oem-fields",
+                           test_acpi_aarch64_virt_oem_fields);
             if (qtest_has_device("virtio-iommu-pci")) {
-                qtest_add_func("acpi/virt/viot", test_acpi_virt_viot);
+                qtest_add_func("acpi/virt/viot", test_acpi_aarch64_virt_viot);
             }
         }
     }
Signature · 1 line
2.40.1
Reviewed-by on v2 4/12
#6 lore raw

Re: [PATCH v2 04/12] qtest: bios-tables-test: Rename aarch64 tests with aarch64 in them

Quoted 6 lines · On Fri, 24 May 2024 11:44:03 +0530 Sunil V L <[email protected]> wrote:

Existing AARCH64 virt test functions do not have AARCH64 in their name. To add RISC-V virt related test cases, better to rename existing functions to indicate they are ARM only.

Quoted 108 lines
---
 tests/qtest/bios-tables-test.c | 35 ++++++++++++++++++----------------
 1 file changed, 19 insertions(+), 16 deletions(-)
tests/qtest/bios-tables-test.c +19 -16
index d1ff4db7a2..c4a4d1c7bf 100644
@@ -1570,7 +1570,7 @@ static void test_acpi_piix4_tcg_dimm_pxm(void)
     test_acpi_tcg_dimm_pxm(MACHINE_PC);
 }
 
-static void test_acpi_virt_tcg_memhp(void)
+static void test_acpi_aarch64_virt_tcg_memhp(void)
 {
     test_data data = {
         .machine = "virt",
@@ -1663,7 +1663,7 @@ static void test_acpi_microvm_ioapic2_tcg(void)
     free_test_data(&data);
 }
 
-static void test_acpi_virt_tcg_numamem(void)
+static void test_acpi_aarch64_virt_tcg_numamem(void)
 {
     test_data data = {
         .machine = "virt",
@@ -1685,7 +1685,7 @@ static void test_acpi_virt_tcg_numamem(void)
 
 }
 
-static void test_acpi_virt_tcg_pxb(void)
+static void test_acpi_aarch64_virt_tcg_pxb(void)
 {
     test_data data = {
         .machine = "virt",
@@ -1758,7 +1758,7 @@ static void test_acpi_piix4_tcg_acpi_hmat(void)
     test_acpi_tcg_acpi_hmat(MACHINE_PC);
 }
 
-static void test_acpi_virt_tcg_acpi_hmat(void)
+static void test_acpi_aarch64_virt_tcg_acpi_hmat(void)
 {
     test_data data = {
         .machine = "virt",
@@ -1914,7 +1914,7 @@ static void test_acpi_microvm_acpi_erst(void)
 }
 #endif /* CONFIG_POSIX */
 
-static void test_acpi_virt_tcg(void)
+static void test_acpi_aarch64_virt_tcg(void)
 {
     test_data data = {
         .machine = "virt",
@@ -1933,7 +1933,7 @@ static void test_acpi_virt_tcg(void)
     free_test_data(&data);
 }
 
-static void test_acpi_virt_tcg_topology(void)
+static void test_acpi_aarch64_virt_tcg_topology(void)
 {
     test_data data = {
         .machine = "virt",
@@ -2016,7 +2016,7 @@ static void test_acpi_q35_cxl(void)
 }
 #endif /* CONFIG_POSIX */
 
-static void test_acpi_virt_viot(void)
+static void test_acpi_aarch64_virt_viot(void)
 {
     test_data data = {
         .machine = "virt",
@@ -2192,7 +2192,7 @@ static void test_acpi_microvm_oem_fields(void)
     g_free(args);
 }
 
-static void test_acpi_virt_oem_fields(void)
+static void test_acpi_aarch64_virt_oem_fields(void)
 {
     test_data data = {
         .machine = "virt",
@@ -2364,16 +2364,19 @@ int main(int argc, char *argv[])
         }
     } else if (strcmp(arch, "aarch64") == 0) {
         if (has_tcg && qtest_has_device("virtio-blk-pci")) {
-            qtest_add_func("acpi/virt", test_acpi_virt_tcg);
+            qtest_add_func("acpi/virt", test_acpi_aarch64_virt_tcg);
             qtest_add_func("acpi/virt/acpihmatvirt",
-                            test_acpi_virt_tcg_acpi_hmat);
-            qtest_add_func("acpi/virt/topology", test_acpi_virt_tcg_topology);
-            qtest_add_func("acpi/virt/numamem", test_acpi_virt_tcg_numamem);
-            qtest_add_func("acpi/virt/memhp", test_acpi_virt_tcg_memhp);
-            qtest_add_func("acpi/virt/pxb", test_acpi_virt_tcg_pxb);
-            qtest_add_func("acpi/virt/oem-fields", test_acpi_virt_oem_fields);
+                           test_acpi_aarch64_virt_tcg_acpi_hmat);
+            qtest_add_func("acpi/virt/topology",
+                           test_acpi_aarch64_virt_tcg_topology);
+            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/pxb", test_acpi_aarch64_virt_tcg_pxb);
+            qtest_add_func("acpi/virt/oem-fields",
+                           test_acpi_aarch64_virt_oem_fields);
             if (qtest_has_device("virtio-iommu-pci")) {
-                qtest_add_func("acpi/virt/viot", test_acpi_virt_viot);
+                qtest_add_func("acpi/virt/viot", test_acpi_aarch64_virt_viot);
             }
         }
     }
author
#7 lore raw

PATCH v2 5/12 tests/qtest/bios-tables-test.c: Add support for arch in path

In reply to Sunil V L

Since virt machine is common for multiple architectures, add "arch" in the path to search expected AML files. Since the AML files are still under old path, support both by searching with and without arch in the path.

---
 tests/qtest/bios-tables-test.c | 31 ++++++++++++++++++++++++++++---
 1 file changed, 28 insertions(+), 3 deletions(-)
tests/qtest/bios-tables-test.c +28 -3
index c4a4d1c7bf..c73174ad00 100644
@@ -78,6 +78,7 @@
 typedef struct {
     bool tcg_only;
     const char *machine;
+    const char *arch;
     const char *machine_param;
     const char *variant;
     const char *uefi_fl1;
@@ -262,8 +263,19 @@ static void dump_aml_files(test_data *data, bool rebuild)
         g_assert(exp_sdt->aml);
 
         if (rebuild) {
-            aml_file = g_strdup_printf("%s/%s/%.4s%s", data_dir, data->machine,
+            aml_file = g_strdup_printf("%s/%s/%s/%.4s%s", data_dir,
+                                       data->machine, data->arch,
                                        sdt->aml, ext);
+
+            /*
+             * To keep test cases not failing when the DATA files are moved to
+             * ARCH under virt folder, add this check as well.
+             */
+            if (!g_file_test(aml_file, G_FILE_TEST_EXISTS)) {
+                aml_file = g_strdup_printf("%s/%s/%.4s%s", data_dir,
+                                           data->machine, sdt->aml, ext);
+            }
+
             if (!g_file_test(aml_file, G_FILE_TEST_EXISTS) &&
                 sdt->aml_len == exp_sdt->aml_len &&
                 !memcmp(sdt->aml, exp_sdt->aml, sdt->aml_len)) {
@@ -398,8 +410,13 @@ static GArray *load_expected_aml(test_data *data)
         memset(&exp_sdt, 0, sizeof(exp_sdt));
 
 try_again:
-        aml_file = g_strdup_printf("%s/%s/%.4s%s", data_dir, data->machine,
-                                   sdt->aml, ext);
+        aml_file = g_strdup_printf("%s/%s/%s/%.4s%s", data_dir, data->machine,
+                                   data->arch, sdt->aml, ext);
+        if (!g_file_test(aml_file, G_FILE_TEST_EXISTS)) {
+            aml_file = g_strdup_printf("%s/%s/%.4s%s", data_dir, data->machine,
+                                       sdt->aml, ext);
+        }
+
         if (verbosity_level >= 2) {
             fprintf(stderr, "Looking for expected file '%s'\n", aml_file);
         }
@@ -1574,6 +1591,7 @@ static void test_acpi_aarch64_virt_tcg_memhp(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",
@@ -1667,6 +1685,7 @@ static void test_acpi_aarch64_virt_tcg_numamem(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",
@@ -1689,6 +1708,7 @@ static void test_acpi_aarch64_virt_tcg_pxb(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",
@@ -1762,6 +1782,7 @@ static void test_acpi_aarch64_virt_tcg_acpi_hmat(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",
@@ -1918,6 +1939,7 @@ static void test_acpi_aarch64_virt_tcg(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",
@@ -1937,6 +1959,7 @@ static void test_acpi_aarch64_virt_tcg_topology(void)
 {
     test_data data = {
         .machine = "virt",
+        .arch = "aarch64",
         .variant = ".topology",
         .tcg_only = true,
         .uefi_fl1 = "pc-bios/edk2-aarch64-code.fd",
@@ -2020,6 +2043,7 @@ static void test_acpi_aarch64_virt_viot(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",
@@ -2196,6 +2220,7 @@ static void test_acpi_aarch64_virt_oem_fields(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",
Signature · 1 line
2.40.1
#8 lore raw

Re: [PATCH v2 05/12] tests/qtest/bios-tables-test.c: Add support for arch in path

Quoted 7 lines · On Fri, 24 May 2024 11:44:04 +0530 Sunil V L <[email protected]> wrote:

Since virt machine is common for multiple architectures, add "arch" in the path to search expected AML files. Since the AML files are still under old path, support both by searching with and without arch in the path.

other than need to swap machine/arch order mentioned in the next patch look good to me

Quoted 117 lines
---
 tests/qtest/bios-tables-test.c | 31 ++++++++++++++++++++++++++++---
 1 file changed, 28 insertions(+), 3 deletions(-)
tests/qtest/bios-tables-test.c +28 -3
index c4a4d1c7bf..c73174ad00 100644
@@ -78,6 +78,7 @@
 typedef struct {
     bool tcg_only;
     const char *machine;
+    const char *arch;
     const char *machine_param;
     const char *variant;
     const char *uefi_fl1;
@@ -262,8 +263,19 @@ static void dump_aml_files(test_data *data, bool rebuild)
         g_assert(exp_sdt->aml);
 
         if (rebuild) {
-            aml_file = g_strdup_printf("%s/%s/%.4s%s", data_dir, data->machine,
+            aml_file = g_strdup_printf("%s/%s/%s/%.4s%s", data_dir,
+                                       data->machine, data->arch,
                                        sdt->aml, ext);
+
+            /*
+             * To keep test cases not failing when the DATA files are moved to
+             * ARCH under virt folder, add this check as well.
+             */
+            if (!g_file_test(aml_file, G_FILE_TEST_EXISTS)) {
+                aml_file = g_strdup_printf("%s/%s/%.4s%s", data_dir,
+                                           data->machine, sdt->aml, ext);
+            }
+
             if (!g_file_test(aml_file, G_FILE_TEST_EXISTS) &&
                 sdt->aml_len == exp_sdt->aml_len &&
                 !memcmp(sdt->aml, exp_sdt->aml, sdt->aml_len)) {
@@ -398,8 +410,13 @@ static GArray *load_expected_aml(test_data *data)
         memset(&exp_sdt, 0, sizeof(exp_sdt));
 
 try_again:
-        aml_file = g_strdup_printf("%s/%s/%.4s%s", data_dir, data->machine,
-                                   sdt->aml, ext);
+        aml_file = g_strdup_printf("%s/%s/%s/%.4s%s", data_dir, data->machine,
+                                   data->arch, sdt->aml, ext);
+        if (!g_file_test(aml_file, G_FILE_TEST_EXISTS)) {
+            aml_file = g_strdup_printf("%s/%s/%.4s%s", data_dir, data->machine,
+                                       sdt->aml, ext);
+        }
+
         if (verbosity_level >= 2) {
             fprintf(stderr, "Looking for expected file '%s'\n", aml_file);
         }
@@ -1574,6 +1591,7 @@ static void test_acpi_aarch64_virt_tcg_memhp(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",
@@ -1667,6 +1685,7 @@ static void test_acpi_aarch64_virt_tcg_numamem(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",
@@ -1689,6 +1708,7 @@ static void test_acpi_aarch64_virt_tcg_pxb(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",
@@ -1762,6 +1782,7 @@ static void test_acpi_aarch64_virt_tcg_acpi_hmat(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",
@@ -1918,6 +1939,7 @@ static void test_acpi_aarch64_virt_tcg(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",
@@ -1937,6 +1959,7 @@ static void test_acpi_aarch64_virt_tcg_topology(void)
 {
     test_data data = {
         .machine = "virt",
+        .arch = "aarch64",
         .variant = ".topology",
         .tcg_only = true,
         .uefi_fl1 = "pc-bios/edk2-aarch64-code.fd",
@@ -2020,6 +2043,7 @@ static void test_acpi_aarch64_virt_viot(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",
@@ -2196,6 +2220,7 @@ static void test_acpi_aarch64_virt_oem_fields(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",
author
#9 lore raw

PATCH v2 6/12 tests/data/acpi/virt: Move ACPI tables under aarch64

In reply to Sunil V L

Since virt is a common machine name across architectures like ARM64 and RISC-V, move existing ARM64 ACPI tables under aarch64 folder so that RISC-V tables can be added under riscv64 folder in future.

---
 tests/data/acpi/virt/{ => aarch64}/APIC             | Bin
 .../data/acpi/virt/{ => aarch64}/APIC.acpihmatvirt  | Bin
 tests/data/acpi/virt/{ => aarch64}/APIC.topology    | Bin
 tests/data/acpi/virt/{ => aarch64}/DBG2             | Bin
 tests/data/acpi/virt/{ => aarch64}/DSDT             | Bin
 .../data/acpi/virt/{ => aarch64}/DSDT.acpihmatvirt  | Bin
 tests/data/acpi/virt/{ => aarch64}/DSDT.memhp       | Bin
 tests/data/acpi/virt/{ => aarch64}/DSDT.pxb         | Bin
 tests/data/acpi/virt/{ => aarch64}/DSDT.topology    | Bin
 tests/data/acpi/virt/{ => aarch64}/FACP             | Bin
 tests/data/acpi/virt/{ => aarch64}/GTDT             | Bin
 .../data/acpi/virt/{ => aarch64}/HMAT.acpihmatvirt  | Bin
 tests/data/acpi/virt/{ => aarch64}/IORT             | Bin
 tests/data/acpi/virt/{ => aarch64}/MCFG             | Bin
 tests/data/acpi/virt/{ => aarch64}/NFIT.memhp       | Bin
 tests/data/acpi/virt/{ => aarch64}/PPTT             | Bin
 .../data/acpi/virt/{ => aarch64}/PPTT.acpihmatvirt  | Bin
 tests/data/acpi/virt/{ => aarch64}/PPTT.topology    | Bin
 tests/data/acpi/virt/{ => aarch64}/SLIT.memhp       | Bin
 tests/data/acpi/virt/{ => aarch64}/SPCR             | Bin
 .../data/acpi/virt/{ => aarch64}/SRAT.acpihmatvirt  | Bin
 tests/data/acpi/virt/{ => aarch64}/SRAT.memhp       | Bin
 tests/data/acpi/virt/{ => aarch64}/SRAT.numamem     | Bin
 tests/data/acpi/virt/{ => aarch64}/SSDT.memhp       | Bin
 tests/data/acpi/virt/{ => aarch64}/VIOT             | Bin
 25 files changed, 0 insertions(+), 0 deletions(-)
 rename tests/data/acpi/virt/{ => aarch64}/APIC (100%)
 rename tests/data/acpi/virt/{ => aarch64}/APIC.acpihmatvirt (100%)
 rename tests/data/acpi/virt/{ => aarch64}/APIC.topology (100%)
 rename tests/data/acpi/virt/{ => aarch64}/DBG2 (100%)
 rename tests/data/acpi/virt/{ => aarch64}/DSDT (100%)
 rename tests/data/acpi/virt/{ => aarch64}/DSDT.acpihmatvirt (100%)
 rename tests/data/acpi/virt/{ => aarch64}/DSDT.memhp (100%)
 rename tests/data/acpi/virt/{ => aarch64}/DSDT.pxb (100%)
 rename tests/data/acpi/virt/{ => aarch64}/DSDT.topology (100%)
 rename tests/data/acpi/virt/{ => aarch64}/FACP (100%)
 rename tests/data/acpi/virt/{ => aarch64}/GTDT (100%)
 rename tests/data/acpi/virt/{ => aarch64}/HMAT.acpihmatvirt (100%)
 rename tests/data/acpi/virt/{ => aarch64}/IORT (100%)
 rename tests/data/acpi/virt/{ => aarch64}/MCFG (100%)
 rename tests/data/acpi/virt/{ => aarch64}/NFIT.memhp (100%)
 rename tests/data/acpi/virt/{ => aarch64}/PPTT (100%)
 rename tests/data/acpi/virt/{ => aarch64}/PPTT.acpihmatvirt (100%)
 rename tests/data/acpi/virt/{ => aarch64}/PPTT.topology (100%)
 rename tests/data/acpi/virt/{ => aarch64}/SLIT.memhp (100%)
 rename tests/data/acpi/virt/{ => aarch64}/SPCR (100%)
 rename tests/data/acpi/virt/{ => aarch64}/SRAT.acpihmatvirt (100%)
 rename tests/data/acpi/virt/{ => aarch64}/SRAT.memhp (100%)
 rename tests/data/acpi/virt/{ => aarch64}/SRAT.numamem (100%)
 rename tests/data/acpi/virt/{ => aarch64}/SSDT.memhp (100%)
 rename tests/data/acpi/virt/{ => aarch64}/VIOT (100%)
tests/data/acpi/virt/aarch64/APIC renamed from tests/data/acpi/virt/APIC +0 -0
similarity index 100%
rename from tests/data/acpi/virt/APIC
rename to tests/data/acpi/virt/aarch64/APIC
tests/data/acpi/virt/aarch64/APIC.acpihmatvirt renamed from tests/data/acpi/virt/APIC.acpihmatvirt +0 -0
similarity index 100%
rename from tests/data/acpi/virt/APIC.acpihmatvirt
rename to tests/data/acpi/virt/aarch64/APIC.acpihmatvirt
tests/data/acpi/virt/aarch64/APIC.topology renamed from tests/data/acpi/virt/APIC.topology +0 -0
similarity index 100%
rename from tests/data/acpi/virt/APIC.topology
rename to tests/data/acpi/virt/aarch64/APIC.topology
tests/data/acpi/virt/aarch64/DBG2 renamed from tests/data/acpi/virt/DBG2 +0 -0
similarity index 100%
rename from tests/data/acpi/virt/DBG2
rename to tests/data/acpi/virt/aarch64/DBG2
tests/data/acpi/virt/aarch64/DSDT renamed from tests/data/acpi/virt/DSDT +0 -0
similarity index 100%
rename from tests/data/acpi/virt/DSDT
rename to tests/data/acpi/virt/aarch64/DSDT
tests/data/acpi/virt/aarch64/DSDT.acpihmatvirt renamed from tests/data/acpi/virt/DSDT.acpihmatvirt +0 -0
similarity index 100%
rename from tests/data/acpi/virt/DSDT.acpihmatvirt
rename to tests/data/acpi/virt/aarch64/DSDT.acpihmatvirt
tests/data/acpi/virt/aarch64/DSDT.memhp renamed from tests/data/acpi/virt/DSDT.memhp +0 -0
similarity index 100%
rename from tests/data/acpi/virt/DSDT.memhp
rename to tests/data/acpi/virt/aarch64/DSDT.memhp
tests/data/acpi/virt/aarch64/DSDT.pxb renamed from tests/data/acpi/virt/DSDT.pxb +0 -0
similarity index 100%
rename from tests/data/acpi/virt/DSDT.pxb
rename to tests/data/acpi/virt/aarch64/DSDT.pxb
tests/data/acpi/virt/aarch64/DSDT.topology renamed from tests/data/acpi/virt/DSDT.topology +0 -0
similarity index 100%
rename from tests/data/acpi/virt/DSDT.topology
rename to tests/data/acpi/virt/aarch64/DSDT.topology
tests/data/acpi/virt/aarch64/FACP renamed from tests/data/acpi/virt/FACP +0 -0
similarity index 100%
rename from tests/data/acpi/virt/FACP
rename to tests/data/acpi/virt/aarch64/FACP
tests/data/acpi/virt/aarch64/GTDT renamed from tests/data/acpi/virt/GTDT +0 -0
similarity index 100%
rename from tests/data/acpi/virt/GTDT
rename to tests/data/acpi/virt/aarch64/GTDT
tests/data/acpi/virt/aarch64/HMAT.acpihmatvirt renamed from tests/data/acpi/virt/HMAT.acpihmatvirt +0 -0
similarity index 100%
rename from tests/data/acpi/virt/HMAT.acpihmatvirt
rename to tests/data/acpi/virt/aarch64/HMAT.acpihmatvirt
tests/data/acpi/virt/aarch64/IORT renamed from tests/data/acpi/virt/IORT +0 -0
similarity index 100%
rename from tests/data/acpi/virt/IORT
rename to tests/data/acpi/virt/aarch64/IORT
tests/data/acpi/virt/aarch64/MCFG renamed from tests/data/acpi/virt/MCFG +0 -0
similarity index 100%
rename from tests/data/acpi/virt/MCFG
rename to tests/data/acpi/virt/aarch64/MCFG
tests/data/acpi/virt/aarch64/NFIT.memhp renamed from tests/data/acpi/virt/NFIT.memhp +0 -0
similarity index 100%
rename from tests/data/acpi/virt/NFIT.memhp
rename to tests/data/acpi/virt/aarch64/NFIT.memhp
tests/data/acpi/virt/aarch64/PPTT renamed from tests/data/acpi/virt/PPTT +0 -0
similarity index 100%
rename from tests/data/acpi/virt/PPTT
rename to tests/data/acpi/virt/aarch64/PPTT
tests/data/acpi/virt/aarch64/PPTT.acpihmatvirt renamed from tests/data/acpi/virt/PPTT.acpihmatvirt +0 -0
similarity index 100%
rename from tests/data/acpi/virt/PPTT.acpihmatvirt
rename to tests/data/acpi/virt/aarch64/PPTT.acpihmatvirt
tests/data/acpi/virt/aarch64/PPTT.topology renamed from tests/data/acpi/virt/PPTT.topology +0 -0
similarity index 100%
rename from tests/data/acpi/virt/PPTT.topology
rename to tests/data/acpi/virt/aarch64/PPTT.topology
tests/data/acpi/virt/aarch64/SLIT.memhp renamed from tests/data/acpi/virt/SLIT.memhp +0 -0
similarity index 100%
rename from tests/data/acpi/virt/SLIT.memhp
rename to tests/data/acpi/virt/aarch64/SLIT.memhp
tests/data/acpi/virt/aarch64/SPCR renamed from tests/data/acpi/virt/SPCR +0 -0
similarity index 100%
rename from tests/data/acpi/virt/SPCR
rename to tests/data/acpi/virt/aarch64/SPCR
tests/data/acpi/virt/aarch64/SRAT.acpihmatvirt renamed from tests/data/acpi/virt/SRAT.acpihmatvirt +0 -0
similarity index 100%
rename from tests/data/acpi/virt/SRAT.acpihmatvirt
rename to tests/data/acpi/virt/aarch64/SRAT.acpihmatvirt
tests/data/acpi/virt/aarch64/SRAT.memhp renamed from tests/data/acpi/virt/SRAT.memhp +0 -0
similarity index 100%
rename from tests/data/acpi/virt/SRAT.memhp
rename to tests/data/acpi/virt/aarch64/SRAT.memhp
tests/data/acpi/virt/aarch64/SRAT.numamem renamed from tests/data/acpi/virt/SRAT.numamem +0 -0
similarity index 100%
rename from tests/data/acpi/virt/SRAT.numamem
rename to tests/data/acpi/virt/aarch64/SRAT.numamem
tests/data/acpi/virt/aarch64/SSDT.memhp renamed from tests/data/acpi/virt/SSDT.memhp +0 -0
similarity index 100%
rename from tests/data/acpi/virt/SSDT.memhp
rename to tests/data/acpi/virt/aarch64/SSDT.memhp
tests/data/acpi/virt/aarch64/VIOT renamed from tests/data/acpi/virt/VIOT +0 -0
similarity index 100%
rename from tests/data/acpi/virt/VIOT
rename to tests/data/acpi/virt/aarch64/VIOT
Signature · 1 line
2.40.1
#10 lore raw

Re: [PATCH v2 06/12] tests/data/acpi/virt: Move ACPI tables under aarch64

Hi Sunil,

Quoted 8 lines · Sunil V L

Since virt is a common machine name across architectures like ARM64 and RISC-V, move existing ARM64 ACPI tables under aarch64 folder so that RISC-V tables can be added under riscv64 folder in future.

---
  tests/data/acpi/virt/{ => aarch64}/APIC             | Bin

The usual pattern is {target}/{machine}, so instead of:

microvm/
pc/
q35/
virt/aarch64/
virt/riscv64/

(which is odd because q35 is the x86 'virt'), I'd rather see:

x86/microvm/
x86/pc/
x86/q35/
aarch64/virt/
riscv64/virt/

Anyhow just my 2 cents, up to the ACPI maintainers :)

Regards,

Phil.

author
#11 lore raw

Re: [PATCH v2 06/12] tests/data/acpi/virt: Move ACPI tables under aarch64

Quoted 22 lines · Philippe Mathieu-Daudé

Hi Sunil,

Quoted 8 lines · Sunil V L

Since virt is a common machine name across architectures like ARM64 and RISC-V, move existing ARM64 ACPI tables under aarch64 folder so that RISC-V tables can be added under riscv64 folder in future.

---
  tests/data/acpi/virt/{ => aarch64}/APIC             | Bin

The usual pattern is {target}/{machine}, so instead of:

microvm/
pc/
q35/
virt/aarch64/
virt/riscv64/

(which is odd because q35 is the x86 'virt'), I'd rather see:

Quoted 8 lines

x86/microvm/
x86/pc/
x86/q35/
aarch64/virt/
riscv64/virt/

Anyhow just my 2 cents, up to the ACPI maintainers :)

Hi Phil,

Your suggestion does make sense to me. Let me wait for feedback from ARM/ACPI maintainers.

Thanks,
Sunil

#12 lore raw

Re: [PATCH v2 06/12] tests/data/acpi/virt: Move ACPI tables under aarch64

Quoted 29 lines · On Mon, 27 May 2024 20:46:29 +0530 Sunil V L <[email protected]> wrote:
Quoted 28 lines · Philippe Mathieu-Daudé

Hi Sunil,

Quoted 8 lines · Sunil V L

Since virt is a common machine name across architectures like ARM64 and RISC-V, move existing ARM64 ACPI tables under aarch64 folder so that RISC-V tables can be added under riscv64 folder in future.

---
  tests/data/acpi/virt/{ => aarch64}/APIC             | Bin  

The usual pattern is {target}/{machine}, so instead of:

microvm/
pc/
q35/
virt/aarch64/
virt/riscv64/

(which is odd because q35 is the x86 'virt'), I'd rather see:

x86/microvm/
x86/pc/
x86/q35/
aarch64/virt/
riscv64/virt/

Quoted 6 lines
Quoted 2 lines

Anyhow just my 2 cents, up to the ACPI maintainers :)

Hi Phil,

Your suggestion does make sense to me. Let me wait for feedback from ARM/ACPI maintainers.

I'd prefer {target}/{machine} hierarchy like Philippe suggests

Quoted 3 lines

Thanks,
Sunil

#13 lore raw

Re: [PATCH v2 06/12] tests/data/acpi/virt: Move ACPI tables under aarch64

Quoted 32 lines · Igor Mammedov
Quoted 29 lines · On Mon, 27 May 2024 20:46:29 +0530 Sunil V L <[email protected]> wrote:
Quoted 28 lines · Philippe Mathieu-Daudé

Hi Sunil,

Quoted 8 lines · Sunil V L

Since virt is a common machine name across architectures like ARM64 and RISC-V, move existing ARM64 ACPI tables under aarch64 folder so that RISC-V tables can be added under riscv64 folder in future.

---
  tests/data/acpi/virt/{ => aarch64}/APIC             | Bin  

The usual pattern is {target}/{machine}, so instead of:

microvm/
pc/
q35/
virt/aarch64/
virt/riscv64/

(which is odd because q35 is the x86 'virt'), I'd rather see:

x86/microvm/
x86/pc/
x86/q35/
aarch64/virt/
riscv64/virt/

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

Anyhow just my 2 cents, up to the ACPI maintainers :)

Hi Phil,

Your suggestion does make sense to me. Let me wait for feedback from ARM/ACPI maintainers.

I'd prefer {target}/{machine} hierarchy like Philippe suggests

Agreed.

Quoted 3 lines
Quoted 3 lines

Thanks,
Sunil

author
#14 lore raw

Re: [PATCH v2 06/12] tests/data/acpi/virt: Move ACPI tables under aarch64

Quoted 35 lines · Michael S. Tsirkin
Quoted 34 lines · Igor Mammedov
Quoted 31 lines · On Mon, 27 May 2024 20:46:29 +0530 Sunil V L <[email protected]> wrote:
Quoted 30 lines · Philippe Mathieu-Daudé

Hi Sunil,

Quoted 8 lines · Sunil V L

Since virt is a common machine name across architectures like ARM64 and RISC-V, move existing ARM64 ACPI tables under aarch64 folder so that RISC-V tables can be added under riscv64 folder in future.

---
  tests/data/acpi/virt/{ => aarch64}/APIC             | Bin  

The usual pattern is {target}/{machine}, so instead of:

microvm/
pc/
q35/
virt/aarch64/
virt/riscv64/

(which is odd because q35 is the x86 'virt'), I'd rather see:

x86/microvm/
x86/pc/
x86/q35/
aarch64/virt/
riscv64/virt/

Anyhow just my 2 cents, up to the ACPI maintainers :)

Quoted 9 lines
Quoted 6 lines
Quoted 4 lines

Hi Phil,

Your suggestion does make sense to me. Let me wait for feedback from ARM/ACPI maintainers.

I'd prefer {target}/{machine} hierarchy like Philippe suggests

Agreed.

Thanks for the confirmation!. Let me send the updated version soon.

Moving pc/q35/microvm also under new x86 would need many changes in bios-table-test.c. So, the question is, are you ok to combine x86 changes as well in this series or prefer to it later in separate series?

Thanks,
Sunil

#15 lore raw

Re: [PATCH v2 06/12] tests/data/acpi/virt: Move ACPI tables under aarch64

Quoted 43 lines · On Wed, 19 Jun 2024 23:30:35 +0530 Sunil V L <[email protected]> wrote:
Quoted 42 lines · Michael S. Tsirkin
Quoted 40 lines · Igor Mammedov
Quoted 29 lines · On Mon, 27 May 2024 20:46:29 +0530 Sunil V L <[email protected]> wrote:
Quoted 28 lines · Philippe Mathieu-Daudé

Hi Sunil,

Quoted 8 lines · Sunil V L

Since virt is a common machine name across architectures like ARM64 and RISC-V, move existing ARM64 ACPI tables under aarch64 folder so that RISC-V tables can be added under riscv64 folder in future.

---
  tests/data/acpi/virt/{ => aarch64}/APIC             | Bin    

The usual pattern is {target}/{machine}, so instead of:

microvm/
pc/
q35/
virt/aarch64/
virt/riscv64/

(which is odd because q35 is the x86 'virt'), I'd rather see:

x86/microvm/
x86/pc/
x86/q35/
aarch64/virt/
riscv64/virt/

Quoted 6 lines
Quoted 2 lines

Anyhow just my 2 cents, up to the ACPI maintainers :)

Hi Phil,

Your suggestion does make sense to me. Let me wait for feedback from ARM/ACPI maintainers.

I'd prefer {target}/{machine} hierarchy like Philippe suggests

Quoted 7 lines
Quoted 2 lines

Agreed.

Thanks for the confirmation!. Let me send the updated version soon.

Moving pc/q35/microvm also under new x86 would need many changes in bios-table-test.c. So, the question is, are you ok to combine x86 changes as well in this series or prefer to it later in separate series?

it should be fine ok to include x86 changes here as well.

I'd basically split previous patch on path altering part and a 2nd adding
.arch = "aarch64"

then 3rd doing the same for x86

as for this patch, I'd include all blobs movement here.

Quoted 4 lines

Thanks,
Sunil

author
#16 lore raw

PATCH v2 7/12 meson.build: Add RISC-V to the edk2-target list

In reply to Sunil V L

so that ACPI table test can be supported.

---
 meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meson.build +1 -1
index a9de71d450..576c803a8a 100644
@@ -93,7 +93,7 @@ else
   iasl = find_program(get_option('iasl'), required: true)
 endif
 
-edk2_targets = [ 'arm-softmmu', 'aarch64-softmmu', 'i386-softmmu', 'x86_64-softmmu' ]
+edk2_targets = [ 'arm-softmmu', 'aarch64-softmmu', 'i386-softmmu', 'x86_64-softmmu', 'riscv64-softmmu' ]
 unpack_edk2_blobs = false
 foreach target : edk2_targets
   if target in target_dirs
Signature · 1 line
2.40.1
Reviewed-by on v2 7/12
#17 lore raw

Re: [PATCH v2 07/12] meson.build: Add RISC-V to the edk2-target list

Quoted 4 lines · On Fri, 24 May 2024 11:44:06 +0530 Sunil V L <[email protected]> wrote:

so that ACPI table test can be supported.

Quoted 17 lines
---
 meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meson.build +1 -1
index a9de71d450..576c803a8a 100644
@@ -93,7 +93,7 @@ else
   iasl = find_program(get_option('iasl'), required: true)
 endif
 
-edk2_targets = [ 'arm-softmmu', 'aarch64-softmmu', 'i386-softmmu', 'x86_64-softmmu' ]
+edk2_targets = [ 'arm-softmmu', 'aarch64-softmmu', 'i386-softmmu', 'x86_64-softmmu', 'riscv64-softmmu' ]
 unpack_edk2_blobs = false
 foreach target : edk2_targets
   if target in target_dirs
author
#18 lore raw

PATCH v2 8/12 pc-bios/meson.build: Add support for RISC-V in unpack_edk2_blobs

In reply to Sunil V L

Update list of images supported in unpack_edk2_blobs to enable RISC-V ACPI table testing.

---
 pc-bios/meson.build     | 2 ++
 tests/qtest/meson.build | 3 +++
 2 files changed, 5 insertions(+)
pc-bios/meson.build +2 -0
index 0760612bea..8602b45b9b 100644
@@ -4,6 +4,8 @@ if unpack_edk2_blobs
     'edk2-aarch64-code.fd',
     'edk2-arm-code.fd',
     'edk2-arm-vars.fd',
+    'edk2-riscv-code.fd',
+    'edk2-riscv-vars.fd',
     'edk2-i386-code.fd',
     'edk2-i386-secure-code.fd',
     'edk2-i386-vars.fd',
tests/qtest/meson.build +3 -0
index 86293051dc..2f60f6aed8 100644
@@ -259,6 +259,9 @@ qtests_s390x = \
 qtests_riscv32 = \
   (config_all_devices.has_key('CONFIG_SIFIVE_E_AON') ? ['sifive-e-aon-watchdog-test'] : [])
 
+qtests_riscv64 = \
+  (unpack_edk2_blobs ? ['bios-tables-test'] : [])
+
 qos_test_ss = ss.source_set()
 qos_test_ss.add(
   'ac97-test.c',
Signature · 1 line
2.40.1
Reviewed-by on v2 8/12
#19 lore raw

Re: [PATCH v2 08/12] pc-bios/meson.build: Add support for RISC-V in unpack_edk2_blobs

Quoted 5 lines · On Fri, 24 May 2024 11:44:07 +0530 Sunil V L <[email protected]> wrote:

Update list of images supported in unpack_edk2_blobs to enable RISC-V ACPI table testing.

Quoted 32 lines
---
 pc-bios/meson.build     | 2 ++
 tests/qtest/meson.build | 3 +++
 2 files changed, 5 insertions(+)
pc-bios/meson.build +2 -0
index 0760612bea..8602b45b9b 100644
@@ -4,6 +4,8 @@ if unpack_edk2_blobs
     'edk2-aarch64-code.fd',
     'edk2-arm-code.fd',
     'edk2-arm-vars.fd',
+    'edk2-riscv-code.fd',
+    'edk2-riscv-vars.fd',
     'edk2-i386-code.fd',
     'edk2-i386-secure-code.fd',
     'edk2-i386-vars.fd',
tests/qtest/meson.build +3 -0
index 86293051dc..2f60f6aed8 100644
@@ -259,6 +259,9 @@ qtests_s390x = \
 qtests_riscv32 = \
   (config_all_devices.has_key('CONFIG_SIFIVE_E_AON') ? ['sifive-e-aon-watchdog-test'] : [])
 
+qtests_riscv64 = \
+  (unpack_edk2_blobs ? ['bios-tables-test'] : [])
+
 qos_test_ss = ss.source_set()
 qos_test_ss.add(
   'ac97-test.c',
author
#20 lore raw

PATCH v2 9/12 tests/data/acpi/rebuild-expected-aml.sh: Add RISC-V

In reply to Sunil V L

Update the list of supported architectures to include RISC-V.

---
 tests/data/acpi/rebuild-expected-aml.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
tests/data/acpi/rebuild-expected-aml.sh +3 -2
index dcf2e2f221..c1092fb8ba 100755
@@ -12,7 +12,7 @@
 # This work is licensed under the terms of the GNU GPLv2.
 # See the COPYING.LIB file in the top-level directory.
 
-qemu_arches="x86_64 aarch64"
+qemu_arches="x86_64 aarch64 riscv64"
 
 if [ ! -e "tests/qtest/bios-tables-test" ]; then
     echo "Test: bios-tables-test is required! Run make check before this script."
@@ -36,7 +36,8 @@ fi
 if [ -z "$qemu_bins" ]; then
     echo "Only the following architectures are currently supported: $qemu_arches"
     echo "None of these configured!"
-    echo "To fix, run configure --target-list=x86_64-softmmu,aarch64-softmmu"
+    echo "To fix, run configure \
+         --target-list=x86_64-softmmu,aarch64-softmmu,riscv64-softmmu"
     exit 1;
 fi
 
Signature · 1 line
2.40.1
Reviewed-by on v2 9/12
#21 lore raw

Re: [PATCH v2 09/12] tests/data/acpi/rebuild-expected-aml.sh: Add RISC-V

Quoted 4 lines · On Fri, 24 May 2024 11:44:08 +0530 Sunil V L <[email protected]> wrote:

Update the list of supported architectures to include RISC-V.

Quoted 27 lines
---
 tests/data/acpi/rebuild-expected-aml.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
tests/data/acpi/rebuild-expected-aml.sh +3 -2
index dcf2e2f221..c1092fb8ba 100755
@@ -12,7 +12,7 @@
 # This work is licensed under the terms of the GNU GPLv2.
 # See the COPYING.LIB file in the top-level directory.
 
-qemu_arches="x86_64 aarch64"
+qemu_arches="x86_64 aarch64 riscv64"
 
 if [ ! -e "tests/qtest/bios-tables-test" ]; then
     echo "Test: bios-tables-test is required! Run make check before this script."
@@ -36,7 +36,8 @@ fi
 if [ -z "$qemu_bins" ]; then
     echo "Only the following architectures are currently supported: $qemu_arches"
     echo "None of these configured!"
-    echo "To fix, run configure --target-list=x86_64-softmmu,aarch64-softmmu"
+    echo "To fix, run configure \
+         --target-list=x86_64-softmmu,aarch64-softmmu,riscv64-softmmu"
     exit 1;
 fi
 
author
#22 lore raw

PATCH v2 10/12 tests/qtest/bios-tables-test: Add empty ACPI data files for RISC-V

In reply to Sunil V L

As per process documented (steps 1-3) in bios-tables-test.c, add empty AML data files for RISC-V ACPI tables and add the entries in bios-tables-test-allowed-diff.h.

---
 tests/data/acpi/virt/riscv64/APIC           | 0
 tests/data/acpi/virt/riscv64/DSDT           | 0
 tests/data/acpi/virt/riscv64/FACP           | 0
 tests/data/acpi/virt/riscv64/MCFG           | 0
 tests/data/acpi/virt/riscv64/RHCT           | 0
 tests/data/acpi/virt/riscv64/SPCR           | 0
 tests/qtest/bios-tables-test-allowed-diff.h | 6 ++++++
 7 files changed, 6 insertions(+)
 create mode 100644 tests/data/acpi/virt/riscv64/APIC
 create mode 100644 tests/data/acpi/virt/riscv64/DSDT
 create mode 100644 tests/data/acpi/virt/riscv64/FACP
 create mode 100644 tests/data/acpi/virt/riscv64/MCFG
 create mode 100644 tests/data/acpi/virt/riscv64/RHCT
 create mode 100644 tests/data/acpi/virt/riscv64/SPCR
tests/data/acpi/virt/riscv64/APIC new file +0 -0
new file mode 100644
index 0000000000..e69de29bb2
tests/data/acpi/virt/riscv64/DSDT new file +0 -0
new file mode 100644
index 0000000000..e69de29bb2
tests/data/acpi/virt/riscv64/FACP new file +0 -0
new file mode 100644
index 0000000000..e69de29bb2
tests/data/acpi/virt/riscv64/MCFG new file +0 -0
new file mode 100644
index 0000000000..e69de29bb2
tests/data/acpi/virt/riscv64/RHCT new file +0 -0
new file mode 100644
index 0000000000..e69de29bb2
tests/data/acpi/virt/riscv64/SPCR new file +0 -0
new file mode 100644
index 0000000000..e69de29bb2
tests/qtest/bios-tables-test-allowed-diff.h +6 -0
index dfb8523c8b..d8610c8d72 100644
@@ -1 +1,7 @@
 /* List of comma-separated changed AML files to ignore */
+"tests/data/acpi/virt/riscv64/APIC",
+"tests/data/acpi/virt/riscv64/DSDT",
+"tests/data/acpi/virt/riscv64/FACP",
+"tests/data/acpi/virt/riscv64/MCFG",
+"tests/data/acpi/virt/riscv64/RHCT",
+"tests/data/acpi/virt/riscv64/SPCR",
Signature · 1 line
2.40.1
Acked-by on v2 10/12
#23 lore raw

Re: [PATCH v2 10/12] tests/qtest/bios-tables-test: Add empty ACPI data files for RISC-V

Quoted 6 lines · Sunil V L

As per process documented (steps 1-3) in bios-tables-test.c, add empty AML data files for RISC-V ACPI tables and add the entries in bios-tables-test-allowed-diff.h.

Alistair

Quoted 49 lines
---
 tests/data/acpi/virt/riscv64/APIC           | 0
 tests/data/acpi/virt/riscv64/DSDT           | 0
 tests/data/acpi/virt/riscv64/FACP           | 0
 tests/data/acpi/virt/riscv64/MCFG           | 0
 tests/data/acpi/virt/riscv64/RHCT           | 0
 tests/data/acpi/virt/riscv64/SPCR           | 0
 tests/qtest/bios-tables-test-allowed-diff.h | 6 ++++++
 7 files changed, 6 insertions(+)
 create mode 100644 tests/data/acpi/virt/riscv64/APIC
 create mode 100644 tests/data/acpi/virt/riscv64/DSDT
 create mode 100644 tests/data/acpi/virt/riscv64/FACP
 create mode 100644 tests/data/acpi/virt/riscv64/MCFG
 create mode 100644 tests/data/acpi/virt/riscv64/RHCT
 create mode 100644 tests/data/acpi/virt/riscv64/SPCR
tests/data/acpi/virt/riscv64/APIC new file +0 -0
new file mode 100644
index 0000000000..e69de29bb2
tests/data/acpi/virt/riscv64/DSDT new file +0 -0
new file mode 100644
index 0000000000..e69de29bb2
tests/data/acpi/virt/riscv64/FACP new file +0 -0
new file mode 100644
index 0000000000..e69de29bb2
tests/data/acpi/virt/riscv64/MCFG new file +0 -0
new file mode 100644
index 0000000000..e69de29bb2
tests/data/acpi/virt/riscv64/RHCT new file +0 -0
new file mode 100644
index 0000000000..e69de29bb2
tests/data/acpi/virt/riscv64/SPCR new file +0 -0
new file mode 100644
index 0000000000..e69de29bb2
tests/qtest/bios-tables-test-allowed-diff.h +6 -1
index dfb8523c8b..d8610c8d72 100644
@@ -1 +1,7 @@
 /* List of comma-separated changed AML files to ignore */
+"tests/data/acpi/virt/riscv64/APIC",
+"tests/data/acpi/virt/riscv64/DSDT",
+"tests/data/acpi/virt/riscv64/FACP",
+"tests/data/acpi/virt/riscv64/MCFG",
+"tests/data/acpi/virt/riscv64/RHCT",
+"tests/data/acpi/virt/riscv64/SPCR",
--

2.40.1

Reviewed-by on v2 10/12
#24 lore raw

Re: [PATCH v2 10/12] tests/qtest/bios-tables-test: Add empty ACPI data files for RISC-V

In reply to Sunil V L
Quoted 5 lines · On Fri, 24 May 2024 11:44:09 +0530 Sunil V L <[email protected]> wrote:

As per process documented (steps 1-3) in bios-tables-test.c, add empty AML data files for RISC-V ACPI tables and add the entries in bios-tables-test-allowed-diff.h.

Quoted 46 lines
---
 tests/data/acpi/virt/riscv64/APIC           | 0
 tests/data/acpi/virt/riscv64/DSDT           | 0
 tests/data/acpi/virt/riscv64/FACP           | 0
 tests/data/acpi/virt/riscv64/MCFG           | 0
 tests/data/acpi/virt/riscv64/RHCT           | 0
 tests/data/acpi/virt/riscv64/SPCR           | 0
 tests/qtest/bios-tables-test-allowed-diff.h | 6 ++++++
 7 files changed, 6 insertions(+)
 create mode 100644 tests/data/acpi/virt/riscv64/APIC
 create mode 100644 tests/data/acpi/virt/riscv64/DSDT
 create mode 100644 tests/data/acpi/virt/riscv64/FACP
 create mode 100644 tests/data/acpi/virt/riscv64/MCFG
 create mode 100644 tests/data/acpi/virt/riscv64/RHCT
 create mode 100644 tests/data/acpi/virt/riscv64/SPCR
tests/data/acpi/virt/riscv64/APIC new file +0 -0
new file mode 100644
index 0000000000..e69de29bb2
tests/data/acpi/virt/riscv64/DSDT new file +0 -0
new file mode 100644
index 0000000000..e69de29bb2
tests/data/acpi/virt/riscv64/FACP new file +0 -0
new file mode 100644
index 0000000000..e69de29bb2
tests/data/acpi/virt/riscv64/MCFG new file +0 -0
new file mode 100644
index 0000000000..e69de29bb2
tests/data/acpi/virt/riscv64/RHCT new file +0 -0
new file mode 100644
index 0000000000..e69de29bb2
tests/data/acpi/virt/riscv64/SPCR new file +0 -0
new file mode 100644
index 0000000000..e69de29bb2
tests/qtest/bios-tables-test-allowed-diff.h +6 -0
index dfb8523c8b..d8610c8d72 100644
@@ -1 +1,7 @@
 /* List of comma-separated changed AML files to ignore */
+"tests/data/acpi/virt/riscv64/APIC",
+"tests/data/acpi/virt/riscv64/DSDT",
+"tests/data/acpi/virt/riscv64/FACP",
+"tests/data/acpi/virt/riscv64/MCFG",
+"tests/data/acpi/virt/riscv64/RHCT",
+"tests/data/acpi/virt/riscv64/SPCR",
author
#25 lore raw

PATCH v2 11/12 tests/qtest/bios-tables-test.c: Enable basic testing for RISC-V

In reply to Sunil V L

Add basic ACPI table test case for RISC-V.

---
 tests/qtest/bios-tables-test.c | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
tests/qtest/bios-tables-test.c +27 -0
index c73174ad00..880435a5fa 100644
@@ -1935,6 +1935,29 @@ static void test_acpi_microvm_acpi_erst(void)
 }
 #endif /* CONFIG_POSIX */
 
+static void test_acpi_riscv64_virt_tcg(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",
+        .ram_start = 0x80000000ULL,
+        .scan_len = 128ULL * 1024 * 1024,
+    };
+
+    /*
+     * RHCT will have ISA string encoded. To reduce the effort
+     * of updating expected AML file for any new default ISA extension,
+     * use the profile rva22s64.
+     */
+    test_acpi_one("-cpu rva22s64 -device virtio-blk-device,drive=hd0 "
+                  "-drive file=tests/data/uefi-boot-images/bios-tables-test.riscv64.iso.qcow2,id=hd0",
+                  &data);
+    free_test_data(&data);
+}
+
 static void test_acpi_aarch64_virt_tcg(void)
 {
     test_data data = {
@@ -2404,6 +2427,10 @@ int main(int argc, char *argv[])
                 qtest_add_func("acpi/virt/viot", test_acpi_aarch64_virt_viot);
             }
         }
+    } else if (strcmp(arch, "riscv64") == 0) {
+        if (has_tcg && qtest_has_device("virtio-blk-pci")) {
+            qtest_add_func("acpi/virt", test_acpi_riscv64_virt_tcg);
+        }
     }
     ret = g_test_run();
     boot_sector_cleanup(disk);
Signature · 1 line
2.40.1
Reviewed-by on v2 11/12
#26 lore raw

Re: [PATCH v2 11/12] tests/qtest/bios-tables-test.c: Enable basic testing for RISC-V

Quoted 4 lines · Sunil V L

Add basic ACPI table test case for RISC-V.

Alistair

Quoted 52 lines
---
 tests/qtest/bios-tables-test.c | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
tests/qtest/bios-tables-test.c +27 -1
index c73174ad00..880435a5fa 100644
@@ -1935,6 +1935,29 @@ static void test_acpi_microvm_acpi_erst(void)
 }
 #endif /* CONFIG_POSIX */
 
+static void test_acpi_riscv64_virt_tcg(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",
+        .ram_start = 0x80000000ULL,
+        .scan_len = 128ULL * 1024 * 1024,
+    };
+
+    /*
+     * RHCT will have ISA string encoded. To reduce the effort
+     * of updating expected AML file for any new default ISA extension,
+     * use the profile rva22s64.
+     */
+    test_acpi_one("-cpu rva22s64 -device virtio-blk-device,drive=hd0 "
+                  "-drive file=tests/data/uefi-boot-images/bios-tables-test.riscv64.iso.qcow2,id=hd0",
+                  &data);
+    free_test_data(&data);
+}
+
 static void test_acpi_aarch64_virt_tcg(void)
 {
     test_data data = {
@@ -2404,6 +2427,10 @@ int main(int argc, char *argv[])
                 qtest_add_func("acpi/virt/viot", test_acpi_aarch64_virt_viot);
             }
         }
+    } else if (strcmp(arch, "riscv64") == 0) {
+        if (has_tcg && qtest_has_device("virtio-blk-pci")) {
+            qtest_add_func("acpi/virt", test_acpi_riscv64_virt_tcg);
+        }
     }
     ret = g_test_run();
     boot_sector_cleanup(disk);
--

2.40.1

#27 lore raw

Re: [PATCH v2 11/12] tests/qtest/bios-tables-test.c: Enable basic testing for RISC-V

In reply to Sunil V L
Quoted 24 lines · On Fri, 24 May 2024 11:44:10 +0530 Sunil V L <[email protected]> wrote:

Add basic ACPI table test case for RISC-V.

---
 tests/qtest/bios-tables-test.c | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
tests/qtest/bios-tables-test.c +9 -0
index c73174ad00..880435a5fa 100644
@@ -1935,6 +1935,29 @@ static void test_acpi_microvm_acpi_erst(void)
 }
 #endif /* CONFIG_POSIX */
 
+static void test_acpi_riscv64_virt_tcg(void)
+{
+    ->cd data = {
+        .machine = "virt",
+        .arch = "riscv64",
+        .tcg_only = true,
+        .uefi_fl1 = "pc-bios/edk2-riscv-code.fd",
+        .uefi_fl2 = "pc-bios/edk2-riscv-vars.fd",
+        .ram_start = 0x80000000ULL,

tests/qtest/bios-tables-test.c static void test_acpi_microvm_acpi_erst(void) · line 1956

Quoted 10 lines
tests/qtest/bios-tables-test.c +10 -0
+        .scan_len = 128ULL * 1024 * 1024,
+    };
+
+    /*
+     * RHCT will have ISA string encoded. To reduce the effort
+     * of updating expected AML file for any new default ISA extension,
+     * use the profile rva22s64.
+     */
+    test_acpi_one("-cpu rva22s64 -device virtio-blk-device,drive=hd0 "
+                  "-drive file=tests/data/uefi-boot-images/bios-tables-test.riscv64.iso.qcow2,id=hd0",

Can you reuse test_data->cd, instead of specifying disk here?

Quoted 18 lines
tests/qtest/bios-tables-test.c +8 -0
+                  &data);
+    free_test_data(&data);
+}
+
 static void test_acpi_aarch64_virt_tcg(void)
 {
     test_data data = {
@@ -2404,6 +2427,10 @@ int main(int argc, char *argv[])
                 qtest_add_func("acpi/virt/viot", test_acpi_aarch64_virt_viot);
             }
         }
+    } else if (strcmp(arch, "riscv64") == 0) {
+        if (has_tcg && qtest_has_device("virtio-blk-pci")) {
+            qtest_add_func("acpi/virt", test_acpi_riscv64_virt_tcg);
+        }
     }
     ret = g_test_run();
     boot_sector_cleanup(disk);
author
#28 lore raw

Re: [PATCH v2 11/12] tests/qtest/bios-tables-test.c: Enable basic testing for RISC-V

Quoted 31 lines · Igor Mammedov
Quoted 28 lines · On Fri, 24 May 2024 11:44:10 +0530 Sunil V L <[email protected]> wrote:

Add basic ACPI table test case for RISC-V.

---
 tests/qtest/bios-tables-test.c | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
tests/qtest/bios-tables-test.c +13 -0
index c73174ad00..880435a5fa 100644
@@ -1935,6 +1935,29 @@ static void test_acpi_microvm_acpi_erst(void)
 }
 #endif /* CONFIG_POSIX */
 
+static void test_acpi_riscv64_virt_tcg(void)
+{
+    ->cd data = {
+        .machine = "virt",
+        .arch = "riscv64",
+        .tcg_only = true,
+        .uefi_fl1 = "pc-bios/edk2-riscv-code.fd",
+        .uefi_fl2 = "pc-bios/edk2-riscv-vars.fd",
+        .ram_start = 0x80000000ULL,
+        .scan_len = 128ULL * 1024 * 1024,
+    };
+
+    /*
Quoted 9 lines

tests/qtest/bios-tables-test.c static void test_acpi_microvm_acpi_erst(void) · line 1956

Quoted 6 lines
tests/qtest/bios-tables-test.c +6 -0
+     * RHCT will have ISA string encoded. To reduce the effort
+     * of updating expected AML file for any new default ISA extension,
+     * use the profile rva22s64.
+     */
+    test_acpi_one("-cpu rva22s64 -device virtio-blk-device,drive=hd0 "
+                  "-drive file=tests/data/uefi-boot-images/bios-tables-test.riscv64.iso.qcow2,id=hd0",

Can you reuse test_data->cd, instead of specifying disk here?

Actually, currently there is an issue with RISC-V virt machine due to which -cdrom doesn't work properly. But I have a fix for that. With that fix in place , I can use cd here.

I will send that fix tomorrow separately.

Thanks,
Sunil

author
#29 lore raw

PATCH v2 12/12 tests/qtest/bios-tables-test: Add expected ACPI data files for RISC-V

In reply to Sunil V L

As per the step 5 in the process documented in bios-tables-test.c, generate the expected ACPI AML data files for RISC-V using the rebuild-expected-aml.sh script and update the bios-tables-test-allowed-diff.h.

These are all new files being added for the first time. Hence, iASL diff output is not added.

---
 tests/data/acpi/virt/riscv64/APIC           | Bin 0 -> 116 bytes
 tests/data/acpi/virt/riscv64/DSDT           | Bin 0 -> 3518 bytes
 tests/data/acpi/virt/riscv64/FACP           | Bin 0 -> 276 bytes
 tests/data/acpi/virt/riscv64/MCFG           | Bin 0 -> 60 bytes
 tests/data/acpi/virt/riscv64/RHCT           | Bin 0 -> 314 bytes
 tests/data/acpi/virt/riscv64/SPCR           | Bin 0 -> 80 bytes
 tests/qtest/bios-tables-test-allowed-diff.h |   6 ------
 7 files changed, 6 deletions(-)
tests/data/acpi/virt/riscv64/APIC binary +0 -0
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..66a25dfd2d6ea2b607c024722b2eab95873a01e9 100644
GIT binary patch
tests/data/acpi/virt/riscv64/DSDT binary +0 -0
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0fb2d5e0e389541209b765d5092d0706f40298f6 100644
GIT binary patch
tests/data/acpi/virt/riscv64/FACP binary +0 -0
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..a5276b65ea8ce46cc9b40d96d98f0669c9089ed4 100644
GIT binary patch
tests/data/acpi/virt/riscv64/MCFG binary +0 -0
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..37eb923a9320f5573c0c2cdb90bd98409cc7eb6f 100644
GIT binary patch
tests/data/acpi/virt/riscv64/RHCT binary +0 -0
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..beaa961bbf0f0486c0dee25f543377c928354f84 100644
GIT binary patch
tests/data/acpi/virt/riscv64/SPCR binary +0 -0
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..4da9daf65f71a13ac2b488d4e9728f194b569a43 100644
GIT binary patch
tests/qtest/bios-tables-test-allowed-diff.h +0 -6
index d8610c8d72..dfb8523c8b 100644
@@ -1,7 +1 @@
 /* List of comma-separated changed AML files to ignore */
-"tests/data/acpi/virt/riscv64/APIC",
-"tests/data/acpi/virt/riscv64/DSDT",
-"tests/data/acpi/virt/riscv64/FACP",
-"tests/data/acpi/virt/riscv64/MCFG",
-"tests/data/acpi/virt/riscv64/RHCT",
-"tests/data/acpi/virt/riscv64/SPCR",
Signature · 1 line
2.40.1
Acked-by on v2 12/12
#30 lore raw

Re: [PATCH v2 12/12] tests/qtest/bios-tables-test: Add expected ACPI data files for RISC-V

Quoted 10 lines · Sunil V L

As per the step 5 in the process documented in bios-tables-test.c, generate the expected ACPI AML data files for RISC-V using the rebuild-expected-aml.sh script and update the bios-tables-test-allowed-diff.h.

These are all new files being added for the first time. Hence, iASL diff output is not added.

Alistair

Quoted 109 lines
---
 tests/data/acpi/virt/riscv64/APIC           | Bin 0 -> 116 bytes
 tests/data/acpi/virt/riscv64/DSDT           | Bin 0 -> 3518 bytes
 tests/data/acpi/virt/riscv64/FACP           | Bin 0 -> 276 bytes
 tests/data/acpi/virt/riscv64/MCFG           | Bin 0 -> 60 bytes
 tests/data/acpi/virt/riscv64/RHCT           | Bin 0 -> 314 bytes
 tests/data/acpi/virt/riscv64/SPCR           | Bin 0 -> 80 bytes
 tests/qtest/bios-tables-test-allowed-diff.h |   6 ------
 7 files changed, 6 deletions(-)
tests/data/acpi/virt/riscv64/APIC binary +0 -0
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..66a25dfd2d6ea2b607c024722b2eab95873a01e9 100644
GIT binary patch
tests/data/acpi/virt/riscv64/DSDT binary +0 -0
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0fb2d5e0e389541209b765d5092d0706f40298f6 100644
GIT binary patch
tests/data/acpi/virt/riscv64/FACP binary +0 -0
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..a5276b65ea8ce46cc9b40d96d98f0669c9089ed4 100644
GIT binary patch
tests/data/acpi/virt/riscv64/MCFG binary +0 -0
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..37eb923a9320f5573c0c2cdb90bd98409cc7eb6f 100644
GIT binary patch
tests/data/acpi/virt/riscv64/RHCT binary +0 -0
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..beaa961bbf0f0486c0dee25f543377c928354f84 100644
GIT binary patch
tests/data/acpi/virt/riscv64/SPCR binary +0 -0
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..4da9daf65f71a13ac2b488d4e9728f194b569a43 100644
GIT binary patch
tests/qtest/bios-tables-test-allowed-diff.h +0 -7
index d8610c8d72..dfb8523c8b 100644
@@ -1,7 +1 @@
 /* List of comma-separated changed AML files to ignore */
-"tests/data/acpi/virt/riscv64/APIC",
-"tests/data/acpi/virt/riscv64/DSDT",
-"tests/data/acpi/virt/riscv64/FACP",
-"tests/data/acpi/virt/riscv64/MCFG",
-"tests/data/acpi/virt/riscv64/RHCT",
-"tests/data/acpi/virt/riscv64/SPCR",
--

2.40.1

Acked-by on v2 12/12
#31 lore raw

Re: [PATCH v2 12/12] tests/qtest/bios-tables-test: Add expected ACPI data files for RISC-V

In reply to Sunil V L
Quoted 9 lines · On Fri, 24 May 2024 11:44:11 +0530 Sunil V L <[email protected]> wrote:

As per the step 5 in the process documented in bios-tables-test.c, generate the expected ACPI AML data files for RISC-V using the rebuild-expected-aml.sh script and update the bios-tables-test-allowed-diff.h.

These are all new files being added for the first time. Hence, iASL diff output is not added.

Quoted 106 lines
---
 tests/data/acpi/virt/riscv64/APIC           | Bin 0 -> 116 bytes
 tests/data/acpi/virt/riscv64/DSDT           | Bin 0 -> 3518 bytes
 tests/data/acpi/virt/riscv64/FACP           | Bin 0 -> 276 bytes
 tests/data/acpi/virt/riscv64/MCFG           | Bin 0 -> 60 bytes
 tests/data/acpi/virt/riscv64/RHCT           | Bin 0 -> 314 bytes
 tests/data/acpi/virt/riscv64/SPCR           | Bin 0 -> 80 bytes
 tests/qtest/bios-tables-test-allowed-diff.h |   6 ------
 7 files changed, 6 deletions(-)
tests/data/acpi/virt/riscv64/APIC binary +0 -0
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..66a25dfd2d6ea2b607c024722b2eab95873a01e9 100644
GIT binary patch
tests/data/acpi/virt/riscv64/DSDT binary +0 -0
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0fb2d5e0e389541209b765d5092d0706f40298f6 100644
GIT binary patch

zVE91w&KfCiza7@#@A>YkTOF1_DRa)WNl^t#{A^TNmZNji{btZCtt5&QPNDqU;E!+b zecnEQ^xc;~?0jvN=B?69B6sx0n@1<N?!0~c*1N~|jvlD2+E~Xu>-LMCh<kUhvyXCD z|GVk1+UV8=+`16nn$W3iZBaGE(t=R0Su8V)L_|(iti)M3i8v3Jc_g_<E!HC$=dr;& zZ0_+)tcM-v;WLjB?y(x{F%swTD)SiS9?!;ljK+DKGLIDZSc~;Y#d$nr9_i3y=NsQ^ zu@zZ&*ReP}{EyK3th+T@*_*eqZ#4FX%O>b{iWO(USDtFAW3{YY{55g*p1P}!a8zWX z7lz;IPVBzpJS=7G%wV8y2Q62ba|EHRm#%1lYm%>L=vK=N;x|_7+?*WxKL3R0umY z&O>M<DHHxW7E8~>hKe$y(1g;N2-TU8l!<C|EEb%J4HacZp-Gd8P@M@$nW#v|VwsuP zP=$;-)Haz>@sOMoiwli1tW@cj+o4-cu3BPCB-VhD+4MD9hIDroD&Pl#Oi8OIy2%- zNlr-4iRFXLXr|LTGn$gL<b>p$V}cX!M^n3=p)tt$vN>NG_krM{qil6Owag1ZPHY zW+W#h=gbPutl-Q_PDsv)?-Htwo@Y*Q<|HR1=gbSvyx1BPDsu<E;z>p=eXpA<eYfp zv*(GAkEvZhm4f7i<eWvpSrnW_$qC6hOM<fI7^Zfl5<W7&I!ReAvqyAXIXHT1!q}u zLUPVY!8s{7CnYB&=bRFpQ-X6!azb*>X~8)yIHx5iB<DoK!Jg-g;GB1keqW?aLx+O zS;+~>Ip+lDoZy_3oRFMzUU1F}&UwiR$vGDU=Yrr|kera5b5U?E3eH8z3CTH^1m}|A zT#}rSoU<Z0D}u8kIUx;a@2q9hqcop+Y3zu*6>5@qiML8Qmx@>rXnqyVu6bqy3;0 zSfN$e$O$X-aop-gjFlN1TJ2C(VM8aZsGs9rPsDhcG3gaHcG3%d9rt=N#><R_Ugd1x zYt+>h-rEXOMpLn!a_)bcQwbVUYCt>d6Z~go(OKwiV=x$e6rJOWm8FJLZ)jL(gSOQ9 z(=101Q%{N90rg{iGreXyIPiUy_PU*2Ro)uw?+2cJexkhQVfAu5b@3W?^1b$-wSOuL z8($pWumAYmuXoN*92)^EIHqx|osu9QI;oM>2efl4w7)DozPM|Bh$~ecUA>%od=bT& z;R0PerC=JrI{7MZ#_1;2tCR9A{Hkc%mp4ozpVZISFrki_c5@?b)Ba_T|{c>*}hQ pv@F;cR<_jYzAT_(hnb+<eKANn;)0v1k>|8pBtRxTSGr9{slF>K_0A

literal 0
HcmV?d00001

tests/data/acpi/virt/riscv64/FACP binary +0 -0
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..a5276b65ea8ce46cc9b40d96d98f0669c9089ed4 100644
GIT binary patch

zcmZ>BbPf<<WME(ucJg=j2v%^42yj*a0-z8Bhz+8t3k1-OV?`GjD1M-;Zz#xa0OIBc A0RR91

literal 0
HcmV?d00001

tests/data/acpi/virt/riscv64/MCFG binary +0 -0
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..37eb923a9320f5573c0c2cdb90bd98409cc7eb6f 100644
GIT binary patch
tests/data/acpi/virt/riscv64/RHCT binary +0 -0
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..beaa961bbf0f0486c0dee25f543377c928354f84 100644
GIT binary patch

z7;1JgewX|OE=3Z>{xM3wM)ljIQKa+635YaZ7jrOeGc+eJEnks*|jl=GEUBVQ8WhX zK@<flJgso_nMF!k2aE&flg}m^e@2oQd6bm~m(n5!gJ?a<U{EgOALs#2D_Y&qJuA9g Pp1|9>GjINg;u)Bd);9H

literal 0
HcmV?d00001

tests/data/acpi/virt/riscv64/SPCR binary +0 -0
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..4da9daf65f71a13ac2b488d4e9728f194b569a43 100644
GIT binary patch

zcmWFza1IJ!U|?X{>E!S15v<@85#X!<1dKp25F12;fdTFDF9*%FmM4$c8~ze;@#f G!2kgKJqrN<

literal 0
HcmV?d00001

tests/qtest/bios-tables-test-allowed-diff.h +0 -6
index d8610c8d72..dfb8523c8b 100644
@@ -1,7 +1 @@
 /* List of comma-separated changed AML files to ignore */
-"tests/data/acpi/virt/riscv64/APIC",
-"tests/data/acpi/virt/riscv64/DSDT",
-"tests/data/acpi/virt/riscv64/FACP",
-"tests/data/acpi/virt/riscv64/MCFG",
-"tests/data/acpi/virt/riscv64/RHCT",
-"tests/data/acpi/virt/riscv64/SPCR",
#32 lore raw
In reply to Sunil V L
Quoted 11 lines · Sunil V L

Currently, bios-table-test doesn't support RISC-V. This series enables the framework changes required and basic testing. Things like NUMA related test cases will be added later.

This needs refactoring/renaming of ARM64 bios table tests. Importantly, the test cases now look for the expected AML files under tests/data/acpi/virt/aarch64 path instead of directly under tests/data/acpi/virt. To keep test cases not to fail because of this movement, they are updated to look for both paths first.

Quoted 3 lines

As part of this effort, it is found that uefi-test-tools is currently broken to build. So, updated its Makefile as well to use python based edk2 build script.

It would be great to get someone who knows the UEFI world better than I do to ack these changes, especially the first few patches

Alistair

Quoted 100 lines

The changes are also available at branch
https://gitlab.com/vlsunil/qemu/-/tree/riscv_bios_table_test_v2

Changes since v1:
1) Addressed feedback from Gerd and Alistair
2) Rebased and added tags received

Sunil V L (12):
uefi-test-tools/UefiTestToolsPkg: Add RISC-V support
uefi-test-tools: Add support for python based build script tests/data/uefi-boot-images: Add RISC-V ISO image
qtest: bios-tables-test: Rename aarch64 tests with aarch64 in them tests/qtest/bios-tables-test.c: Add support for arch in path tests/data/acpi/virt: Move ACPI tables under aarch64 meson.build: Add RISC-V to the edk2-target list pc-bios/meson.build: Add support for RISC-V in unpack_edk2_blobs tests/data/acpi/rebuild-expected-aml.sh: Add RISC-V tests/qtest/bios-tables-test: Add empty ACPI data files for RISC-V tests/qtest/bios-tables-test.c: Enable basic testing for RISC-V tests/qtest/bios-tables-test: Add expected ACPI data files for RISC-V

 meson.build                                   |   2 +-
 pc-bios/meson.build                           |   2 +
 tests/data/acpi/rebuild-expected-aml.sh       |   5 +-
 tests/data/acpi/virt/{ => aarch64}/APIC       | Bin
 .../acpi/virt/{ => aarch64}/APIC.acpihmatvirt | Bin
 .../acpi/virt/{ => aarch64}/APIC.topology     | Bin
 tests/data/acpi/virt/{ => aarch64}/DBG2       | Bin
 tests/data/acpi/virt/{ => aarch64}/DSDT       | Bin
 .../acpi/virt/{ => aarch64}/DSDT.acpihmatvirt | Bin
 tests/data/acpi/virt/{ => aarch64}/DSDT.memhp | Bin
 tests/data/acpi/virt/{ => aarch64}/DSDT.pxb   | Bin
 .../acpi/virt/{ => aarch64}/DSDT.topology     | Bin
 tests/data/acpi/virt/{ => aarch64}/FACP       | Bin
 tests/data/acpi/virt/{ => aarch64}/GTDT       | Bin
 .../acpi/virt/{ => aarch64}/HMAT.acpihmatvirt | Bin
 tests/data/acpi/virt/{ => aarch64}/IORT       | Bin
 tests/data/acpi/virt/{ => aarch64}/MCFG       | Bin
 tests/data/acpi/virt/{ => aarch64}/NFIT.memhp | Bin
 tests/data/acpi/virt/{ => aarch64}/PPTT       | Bin
 .../acpi/virt/{ => aarch64}/PPTT.acpihmatvirt | Bin
 .../acpi/virt/{ => aarch64}/PPTT.topology     | Bin
 tests/data/acpi/virt/{ => aarch64}/SLIT.memhp | Bin
 tests/data/acpi/virt/{ => aarch64}/SPCR       | Bin
 .../acpi/virt/{ => aarch64}/SRAT.acpihmatvirt | Bin
 tests/data/acpi/virt/{ => aarch64}/SRAT.memhp | Bin
 .../data/acpi/virt/{ => aarch64}/SRAT.numamem | Bin
 tests/data/acpi/virt/{ => aarch64}/SSDT.memhp | Bin
 tests/data/acpi/virt/{ => aarch64}/VIOT       | Bin
 tests/data/acpi/virt/riscv64/APIC             | Bin 0 -> 116 bytes
 tests/data/acpi/virt/riscv64/DSDT             | Bin 0 -> 3518 bytes
 tests/data/acpi/virt/riscv64/FACP             | Bin 0 -> 276 bytes
 tests/data/acpi/virt/riscv64/MCFG             | Bin 0 -> 60 bytes
 tests/data/acpi/virt/riscv64/RHCT             | Bin 0 -> 314 bytes
 tests/data/acpi/virt/riscv64/SPCR             | Bin 0 -> 80 bytes
 .../bios-tables-test.riscv64.iso.qcow2        | Bin 0 -> 16896 bytes
 tests/qtest/bios-tables-test.c                |  93 ++++++++++++++----
 tests/qtest/meson.build                       |   3 +
 tests/uefi-test-tools/Makefile                |  19 ++--
 .../UefiTestToolsPkg/UefiTestToolsPkg.dsc     |   6 +-
 tests/uefi-test-tools/uefi-test-build.config  |  52 ++++++++++
 40 files changed, 147 insertions(+), 35 deletions(-)
 rename tests/data/acpi/virt/{ => aarch64}/APIC (100%)
 rename tests/data/acpi/virt/{ => aarch64}/APIC.acpihmatvirt (100%)
 rename tests/data/acpi/virt/{ => aarch64}/APIC.topology (100%)
 rename tests/data/acpi/virt/{ => aarch64}/DBG2 (100%)
 rename tests/data/acpi/virt/{ => aarch64}/DSDT (100%)
 rename tests/data/acpi/virt/{ => aarch64}/DSDT.acpihmatvirt (100%)
 rename tests/data/acpi/virt/{ => aarch64}/DSDT.memhp (100%)
 rename tests/data/acpi/virt/{ => aarch64}/DSDT.pxb (100%)
 rename tests/data/acpi/virt/{ => aarch64}/DSDT.topology (100%)
 rename tests/data/acpi/virt/{ => aarch64}/FACP (100%)
 rename tests/data/acpi/virt/{ => aarch64}/GTDT (100%)
 rename tests/data/acpi/virt/{ => aarch64}/HMAT.acpihmatvirt (100%)
 rename tests/data/acpi/virt/{ => aarch64}/IORT (100%)
 rename tests/data/acpi/virt/{ => aarch64}/MCFG (100%)
 rename tests/data/acpi/virt/{ => aarch64}/NFIT.memhp (100%)
 rename tests/data/acpi/virt/{ => aarch64}/PPTT (100%)
 rename tests/data/acpi/virt/{ => aarch64}/PPTT.acpihmatvirt (100%)
 rename tests/data/acpi/virt/{ => aarch64}/PPTT.topology (100%)
 rename tests/data/acpi/virt/{ => aarch64}/SLIT.memhp (100%)
 rename tests/data/acpi/virt/{ => aarch64}/SPCR (100%)
 rename tests/data/acpi/virt/{ => aarch64}/SRAT.acpihmatvirt (100%)
 rename tests/data/acpi/virt/{ => aarch64}/SRAT.memhp (100%)
 rename tests/data/acpi/virt/{ => aarch64}/SRAT.numamem (100%)
 rename tests/data/acpi/virt/{ => aarch64}/SSDT.memhp (100%)
 rename tests/data/acpi/virt/{ => aarch64}/VIOT (100%)
 create mode 100644 tests/data/acpi/virt/riscv64/APIC
 create mode 100644 tests/data/acpi/virt/riscv64/DSDT
 create mode 100644 tests/data/acpi/virt/riscv64/FACP
 create mode 100644 tests/data/acpi/virt/riscv64/MCFG
 create mode 100644 tests/data/acpi/virt/riscv64/RHCT
 create mode 100644 tests/data/acpi/virt/riscv64/SPCR
 create mode 100644 tests/data/uefi-boot-images/bios-tables-test.riscv64.iso.qcow2
 create mode 100644 tests/uefi-test-tools/uefi-test-build.config

--
2.40.1

#33 lore raw
Quoted 16 lines · Alistair Francis
Quoted 11 lines · Sunil V L

Currently, bios-table-test doesn't support RISC-V. This series enables the framework changes required and basic testing. Things like NUMA related test cases will be added later.

This needs refactoring/renaming of ARM64 bios table tests. Importantly, the test cases now look for the expected AML files under tests/data/acpi/virt/aarch64 path instead of directly under tests/data/acpi/virt. To keep test cases not to fail because of this movement, they are updated to look for both paths first.

Quoted 3 lines

As part of this effort, it is found that uefi-test-tools is currently broken to build. So, updated its Makefile as well to use python based edk2 build script.

Quoted 5 lines

It would be great to get someone who knows the UEFI world better than I do to ack these changes, especially the first few patches

Alistair

ACPI things look ok. I can merge this but will wait a week or so more for more acks.

Quoted 100 lines
Quoted 100 lines

The changes are also available at branch
https://gitlab.com/vlsunil/qemu/-/tree/riscv_bios_table_test_v2

Changes since v1:
1) Addressed feedback from Gerd and Alistair
2) Rebased and added tags received

Sunil V L (12):
uefi-test-tools/UefiTestToolsPkg: Add RISC-V support
uefi-test-tools: Add support for python based build script tests/data/uefi-boot-images: Add RISC-V ISO image
qtest: bios-tables-test: Rename aarch64 tests with aarch64 in them tests/qtest/bios-tables-test.c: Add support for arch in path tests/data/acpi/virt: Move ACPI tables under aarch64 meson.build: Add RISC-V to the edk2-target list pc-bios/meson.build: Add support for RISC-V in unpack_edk2_blobs tests/data/acpi/rebuild-expected-aml.sh: Add RISC-V tests/qtest/bios-tables-test: Add empty ACPI data files for RISC-V tests/qtest/bios-tables-test.c: Enable basic testing for RISC-V tests/qtest/bios-tables-test: Add expected ACPI data files for RISC-V

 meson.build                                   |   2 +-
 pc-bios/meson.build                           |   2 +
 tests/data/acpi/rebuild-expected-aml.sh       |   5 +-
 tests/data/acpi/virt/{ => aarch64}/APIC       | Bin
 .../acpi/virt/{ => aarch64}/APIC.acpihmatvirt | Bin
 .../acpi/virt/{ => aarch64}/APIC.topology     | Bin
 tests/data/acpi/virt/{ => aarch64}/DBG2       | Bin
 tests/data/acpi/virt/{ => aarch64}/DSDT       | Bin
 .../acpi/virt/{ => aarch64}/DSDT.acpihmatvirt | Bin
 tests/data/acpi/virt/{ => aarch64}/DSDT.memhp | Bin
 tests/data/acpi/virt/{ => aarch64}/DSDT.pxb   | Bin
 .../acpi/virt/{ => aarch64}/DSDT.topology     | Bin
 tests/data/acpi/virt/{ => aarch64}/FACP       | Bin
 tests/data/acpi/virt/{ => aarch64}/GTDT       | Bin
 .../acpi/virt/{ => aarch64}/HMAT.acpihmatvirt | Bin
 tests/data/acpi/virt/{ => aarch64}/IORT       | Bin
 tests/data/acpi/virt/{ => aarch64}/MCFG       | Bin
 tests/data/acpi/virt/{ => aarch64}/NFIT.memhp | Bin
 tests/data/acpi/virt/{ => aarch64}/PPTT       | Bin
 .../acpi/virt/{ => aarch64}/PPTT.acpihmatvirt | Bin
 .../acpi/virt/{ => aarch64}/PPTT.topology     | Bin
 tests/data/acpi/virt/{ => aarch64}/SLIT.memhp | Bin
 tests/data/acpi/virt/{ => aarch64}/SPCR       | Bin
 .../acpi/virt/{ => aarch64}/SRAT.acpihmatvirt | Bin
 tests/data/acpi/virt/{ => aarch64}/SRAT.memhp | Bin
 .../data/acpi/virt/{ => aarch64}/SRAT.numamem | Bin
 tests/data/acpi/virt/{ => aarch64}/SSDT.memhp | Bin
 tests/data/acpi/virt/{ => aarch64}/VIOT       | Bin
 tests/data/acpi/virt/riscv64/APIC             | Bin 0 -> 116 bytes
 tests/data/acpi/virt/riscv64/DSDT             | Bin 0 -> 3518 bytes
 tests/data/acpi/virt/riscv64/FACP             | Bin 0 -> 276 bytes
 tests/data/acpi/virt/riscv64/MCFG             | Bin 0 -> 60 bytes
 tests/data/acpi/virt/riscv64/RHCT             | Bin 0 -> 314 bytes
 tests/data/acpi/virt/riscv64/SPCR             | Bin 0 -> 80 bytes
 .../bios-tables-test.riscv64.iso.qcow2        | Bin 0 -> 16896 bytes
 tests/qtest/bios-tables-test.c                |  93 ++++++++++++++----
 tests/qtest/meson.build                       |   3 +
 tests/uefi-test-tools/Makefile                |  19 ++--
 .../UefiTestToolsPkg/UefiTestToolsPkg.dsc     |   6 +-
 tests/uefi-test-tools/uefi-test-build.config  |  52 ++++++++++
 40 files changed, 147 insertions(+), 35 deletions(-)
 rename tests/data/acpi/virt/{ => aarch64}/APIC (100%)
 rename tests/data/acpi/virt/{ => aarch64}/APIC.acpihmatvirt (100%)
 rename tests/data/acpi/virt/{ => aarch64}/APIC.topology (100%)
 rename tests/data/acpi/virt/{ => aarch64}/DBG2 (100%)
 rename tests/data/acpi/virt/{ => aarch64}/DSDT (100%)
 rename tests/data/acpi/virt/{ => aarch64}/DSDT.acpihmatvirt (100%)
 rename tests/data/acpi/virt/{ => aarch64}/DSDT.memhp (100%)
 rename tests/data/acpi/virt/{ => aarch64}/DSDT.pxb (100%)
 rename tests/data/acpi/virt/{ => aarch64}/DSDT.topology (100%)
 rename tests/data/acpi/virt/{ => aarch64}/FACP (100%)
 rename tests/data/acpi/virt/{ => aarch64}/GTDT (100%)
 rename tests/data/acpi/virt/{ => aarch64}/HMAT.acpihmatvirt (100%)
 rename tests/data/acpi/virt/{ => aarch64}/IORT (100%)
 rename tests/data/acpi/virt/{ => aarch64}/MCFG (100%)
 rename tests/data/acpi/virt/{ => aarch64}/NFIT.memhp (100%)
 rename tests/data/acpi/virt/{ => aarch64}/PPTT (100%)
 rename tests/data/acpi/virt/{ => aarch64}/PPTT.acpihmatvirt (100%)
 rename tests/data/acpi/virt/{ => aarch64}/PPTT.topology (100%)
 rename tests/data/acpi/virt/{ => aarch64}/SLIT.memhp (100%)
 rename tests/data/acpi/virt/{ => aarch64}/SPCR (100%)
 rename tests/data/acpi/virt/{ => aarch64}/SRAT.acpihmatvirt (100%)
 rename tests/data/acpi/virt/{ => aarch64}/SRAT.memhp (100%)
 rename tests/data/acpi/virt/{ => aarch64}/SRAT.numamem (100%)
 rename tests/data/acpi/virt/{ => aarch64}/SSDT.memhp (100%)
 rename tests/data/acpi/virt/{ => aarch64}/VIOT (100%)
 create mode 100644 tests/data/acpi/virt/riscv64/APIC
 create mode 100644 tests/data/acpi/virt/riscv64/DSDT
 create mode 100644 tests/data/acpi/virt/riscv64/FACP
 create mode 100644 tests/data/acpi/virt/riscv64/MCFG
 create mode 100644 tests/data/acpi/virt/riscv64/RHCT
 create mode 100644 tests/data/acpi/virt/riscv64/SPCR
 create mode 100644 tests/data/uefi-boot-images/bios-tables-test.riscv64.iso.qcow2
 create mode 100644 tests/uefi-test-tools/uefi-test-build.config

--
2.40.1