uefi-test-tools: Add support for python based build script
Subsystems (2)
PATCH 4/12 tests/data/uefi-boot-images: Add RISC-V ISO image
In reply to Sunil V LTo test ACPI tables, edk2 needs to be booted with a disk image having EFI partition. This image is created using UefiTestToolsPkg.
--- .../bios-tables-test.riscv64.iso.qcow2 | Bin 0 -> 16896 bytes 1 file changed, 0 insertions(+), 0 deletions(-) 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
Signature · 1 line
2.40.1
PATCH 3/12 uefi-test-tools: Add support for python based build script
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 | 18 +++---- tests/uefi-test-tools/uefi-test-build.config | 57 ++++++++++++++++++++ 2 files changed, 63 insertions(+), 12 deletions(-) create mode 100644 tests/uefi-test-tools/uefi-test-build.config
tests/uefi-test-tools/Makefile +6 -12
@@ -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,8 @@ 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 clean: rm -rf Build Conf log
tests/uefi-test-tools/uefi-test-build.config new file +57 -0
57 lines not on this page · raw message
Signature · 1 line
2.40.1
PATCH 5/12 qtest: bios-tables-test: Rename aarch64 tests with aarch64 in them
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
@@ -1557,7 +1557,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" ,
@@ -1650,7 +1650,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" ,
@@ -1672,7 +1672,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" ,
@@ -1745,7 +1745,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" ,
@@ -1901,7 +1901,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" ,
@@ -1920,7 +1920,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" ,
@@ -2003,7 +2003,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" ,
@@ -2135,7 +2135,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" ,
@@ -2301,16 +2301,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
PATCH 11/12 tests/data/acpi/virt/riscv64: Add expected ACPI tables for RISC-V
In reply to Sunil V LAdd expected ACPI tables for RISC-V so that bios-table-test can be enabled for RISC-V.
--- tests/data/acpi/virt/riscv64/APIC | Bin 0 -> 116 bytes tests/data/acpi/virt/riscv64/BGRT | Bin 0 -> 56 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/RSDP | Bin 0 -> 36 bytes tests/data/acpi/virt/riscv64/SPCR | Bin 0 -> 80 bytes tests/data/acpi/virt/riscv64/XSDT | Bin 0 -> 84 bytes 9 files changed, 0 insertions(+), 0 deletions(-) create mode 100755 tests/data/acpi/virt/riscv64/APIC create mode 100755 tests/data/acpi/virt/riscv64/BGRT create mode 100755 tests/data/acpi/virt/riscv64/DSDT create mode 100755 tests/data/acpi/virt/riscv64/FACP create mode 100755 tests/data/acpi/virt/riscv64/MCFG create mode 100755 tests/data/acpi/virt/riscv64/RHCT create mode 100755 tests/data/acpi/virt/riscv64/RSDP create mode 100755 tests/data/acpi/virt/riscv64/SPCR create mode 100755 tests/data/acpi/virt/riscv64/XSDT
tests/data/acpi/virt/riscv64/APIC new file binary +0 -0
tests/data/acpi/virt/riscv64/BGRT new file binary +0 -0
tests/data/acpi/virt/riscv64/DSDT new file binary +0 -0
tests/data/acpi/virt/riscv64/FACP new file binary +0 -0
tests/data/acpi/virt/riscv64/MCFG new file binary +0 -0
tests/data/acpi/virt/riscv64/RHCT new file binary +0 -0
tests/data/acpi/virt/riscv64/RSDP new file binary +0 -0
tests/data/acpi/virt/riscv64/SPCR new file binary +0 -0
tests/data/acpi/virt/riscv64/XSDT new file binary +0 -0
Signature · 1 line
2.40.1
PATCH 9/12 pc-bios/meson.build: Add support for RISC-V in unpack_edk2_blobs
In reply to Sunil V LUpdate 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
@@ -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
@@ -252,6 +252,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
PATCH 8/12 meson.build: Add RISC-V to the edk2-target list
In reply to Sunil V Lso that ACPI table test can be supported.
--- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meson.build +1 -1
@@ -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
PATCH 7/12 tests/data/acpi/virt: Move ACPI tables under aarch64
In reply to Sunil V LSince 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
tests/data/acpi/virt/aarch64/APIC.acpihmatvirt renamed from tests/data/acpi/virt/APIC.acpihmatvirt +0 -0
tests/data/acpi/virt/aarch64/APIC.topology renamed from tests/data/acpi/virt/APIC.topology +0 -0
tests/data/acpi/virt/aarch64/DBG2 renamed from tests/data/acpi/virt/DBG2 +0 -0
tests/data/acpi/virt/aarch64/DSDT renamed from tests/data/acpi/virt/DSDT +0 -0
tests/data/acpi/virt/aarch64/DSDT.acpihmatvirt renamed from tests/data/acpi/virt/DSDT.acpihmatvirt +0 -0
tests/data/acpi/virt/aarch64/DSDT.memhp renamed from tests/data/acpi/virt/DSDT.memhp +0 -0
tests/data/acpi/virt/aarch64/DSDT.pxb renamed from tests/data/acpi/virt/DSDT.pxb +0 -0
tests/data/acpi/virt/aarch64/DSDT.topology renamed from tests/data/acpi/virt/DSDT.topology +0 -0
tests/data/acpi/virt/aarch64/FACP renamed from tests/data/acpi/virt/FACP +0 -0
tests/data/acpi/virt/aarch64/GTDT renamed from tests/data/acpi/virt/GTDT +0 -0
tests/data/acpi/virt/aarch64/HMAT.acpihmatvirt renamed from tests/data/acpi/virt/HMAT.acpihmatvirt +0 -0
tests/data/acpi/virt/aarch64/IORT renamed from tests/data/acpi/virt/IORT +0 -0
tests/data/acpi/virt/aarch64/MCFG renamed from tests/data/acpi/virt/MCFG +0 -0
tests/data/acpi/virt/aarch64/NFIT.memhp renamed from tests/data/acpi/virt/NFIT.memhp +0 -0
tests/data/acpi/virt/aarch64/PPTT renamed from tests/data/acpi/virt/PPTT +0 -0
tests/data/acpi/virt/aarch64/PPTT.acpihmatvirt renamed from tests/data/acpi/virt/PPTT.acpihmatvirt +0 -0
tests/data/acpi/virt/aarch64/PPTT.topology renamed from tests/data/acpi/virt/PPTT.topology +0 -0
tests/data/acpi/virt/aarch64/SLIT.memhp renamed from tests/data/acpi/virt/SLIT.memhp +0 -0
tests/data/acpi/virt/aarch64/SPCR renamed from tests/data/acpi/virt/SPCR +0 -0
tests/data/acpi/virt/aarch64/SRAT.acpihmatvirt renamed from tests/data/acpi/virt/SRAT.acpihmatvirt +0 -0
tests/data/acpi/virt/aarch64/SRAT.memhp renamed from tests/data/acpi/virt/SRAT.memhp +0 -0
tests/data/acpi/virt/aarch64/SRAT.numamem renamed from tests/data/acpi/virt/SRAT.numamem +0 -0
tests/data/acpi/virt/aarch64/SSDT.memhp renamed from tests/data/acpi/virt/SSDT.memhp +0 -0
tests/data/acpi/virt/aarch64/VIOT renamed from tests/data/acpi/virt/VIOT +0 -0
Signature · 1 line
2.40.1
PATCH 12/12 tests/qtest/bios-tables-test.c: Enable basic testing for RISC-V
In reply to Sunil V LAdd basic ACPI table testing for RISC-V.
--- tests/qtest/bios-tables-test.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+)
tests/qtest/bios-tables-test.c +28 -0
@@ -1923,6 +1923,30 @@ 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. Once profile is ratified, there may +* not be new extension possible. +*/ +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 = {
@@ -2342,6 +2366,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
PATCH 10/12 tests/data/acpi/rebuild-expected-aml.sh: Add RISC-V
In reply to Sunil V LUpdate 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
@@ -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
PATCH 6/12 tests/qtest/bios-tables-test.c: Add support for arch in path
In reply to Sunil V LSince 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 | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-)
tests/qtest/bios-tables-test.c +29 -3
@@ -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,20 @@ 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 which can be removed once +* the DATA files are moved. +*/ +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 +411,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); + } + exp_sdt.aml_file = aml_file;if (verbosity_level >=2 ) {fprintf (stderr,"Looking for expected file '%s'\n" , aml_file); }
@@ -1561,6 +1579,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" ,
@@ -1654,6 +1673,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" ,
@@ -1676,6 +1696,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" ,
@@ -1749,6 +1770,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" ,
@@ -1905,6 +1927,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" ,
@@ -1924,6 +1947,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" ,
@@ -2007,6 +2031,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" ,
@@ -2139,6 +2164,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
tests/uefi-test-tools/Makefile Build/%.fat: Build/%.efi · line 100
Quoted 2 lines
tests/uefi-test-tools/Makefile +2
-0+Build/bios-tables-test.%.efi: + $(PYTHON) ../../roms/edk2-build.py --config uefi-test-build.config
Adding '--match $*' will build one arch instead of all.
Quoted 5 lines · Gerd Hoffmann
tests/uefi-test-tools/Makefile Build/%.fat: Build/%.efi · line 100
Quoted 2 lines
tests/uefi-test-tools/Makefile +2
-0+Build/bios-tables-test.%.efi: + $(PYTHON) ../../roms/edk2-build.py --config uefi-test-build.configAdding '--match $*' will build one arch instead of all.
Thanks Gerd. Good suggestion. Let me update in next revision.
Thanks,
Sunil
Re: [PATCH 04/12] tests/data/uefi-boot-images: Add RISC-V ISO image
In reply to Sunil V LQuoted 3 lines · 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.
Can we document exactly how this is generated?
Alistair
Quoted 278 lines
Signed-off-by Sunil V L <[email protected]>--- .../bios-tables-test.riscv64.iso.qcow2 | Bin 0 -> 16896 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 tests/data/uefi-boot-images/bios-tables-test.riscv64.iso.qcow2tests/data/uefi-boot-images/bios-tables-test.riscv64.iso.qcow2 new file binary +0
-1--2.40.1
Re: [PATCH 05/12] qtest: bios-tables-test: Rename aarch64 tests with aarch64 in them
In reply to Sunil V LQuoted 6 lines · 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.
Signed-off-by Sunil V L <[email protected]>
Alistair
Quoted 111 lines
--- tests/qtest/bios-tables-test.c | 35 ++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-)tests/qtest/bios-tables-test.c +19
-17@@ -1557,7 +1557,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" ,@@ -1650,7 +1650,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" ,@@ -1672,7 +1672,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" ,@@ -1745,7 +1745,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" ,@@ -1901,7 +1901,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" ,@@ -1920,7 +1920,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" ,@@ -2003,7 +2003,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" ,@@ -2135,7 +2135,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" ,@@ -2301,16 +2301,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); } } } --2.40.1
Re: [PATCH 06/12] tests/qtest/bios-tables-test.c: Add support for arch in path
In reply to Sunil V LQuoted 7 lines · 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.
Signed-off-by Sunil V L <[email protected]>
Alistair
Quoted 121 lines
--- tests/qtest/bios-tables-test.c | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-)tests/qtest/bios-tables-test.c +29
-4@@ -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,20 @@ 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 which can be removed once +* the DATA files are moved. +*/ +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 +411,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); + } + exp_sdt.aml_file = aml_file;if (verbosity_level >=2 ) {fprintf (stderr,"Looking for expected file '%s'\n" , aml_file); }@@ -1561,6 +1579,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" ,@@ -1654,6 +1673,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" ,@@ -1676,6 +1696,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" ,@@ -1749,6 +1770,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" ,@@ -1905,6 +1927,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" ,@@ -1924,6 +1947,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" ,@@ -2007,6 +2031,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" ,@@ -2139,6 +2164,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" , --2.40.1
Re: [PATCH 07/12] tests/data/acpi/virt: Move ACPI tables under aarch64
In reply to Sunil V LQuoted 6 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.
Signed-off-by Sunil V L <[email protected]>
Alistair
Quoted 156 lines
--- 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
-0tests/data/acpi/virt/aarch64/APIC.acpihmatvirt renamed from tests/data/acpi/virt/APIC.acpihmatvirt +0
-0tests/data/acpi/virt/aarch64/APIC.topology renamed from tests/data/acpi/virt/APIC.topology +0
-0tests/data/acpi/virt/aarch64/DBG2 renamed from tests/data/acpi/virt/DBG2 +0
-0tests/data/acpi/virt/aarch64/DSDT renamed from tests/data/acpi/virt/DSDT +0
-0tests/data/acpi/virt/aarch64/DSDT.acpihmatvirt renamed from tests/data/acpi/virt/DSDT.acpihmatvirt +0
-0tests/data/acpi/virt/aarch64/DSDT.memhp renamed from tests/data/acpi/virt/DSDT.memhp +0
-0tests/data/acpi/virt/aarch64/DSDT.pxb renamed from tests/data/acpi/virt/DSDT.pxb +0
-0tests/data/acpi/virt/aarch64/DSDT.topology renamed from tests/data/acpi/virt/DSDT.topology +0
-0tests/data/acpi/virt/aarch64/FACP renamed from tests/data/acpi/virt/FACP +0
-0tests/data/acpi/virt/aarch64/GTDT renamed from tests/data/acpi/virt/GTDT +0
-0tests/data/acpi/virt/aarch64/HMAT.acpihmatvirt renamed from tests/data/acpi/virt/HMAT.acpihmatvirt +0
-0tests/data/acpi/virt/aarch64/IORT renamed from tests/data/acpi/virt/IORT +0
-0tests/data/acpi/virt/aarch64/MCFG renamed from tests/data/acpi/virt/MCFG +0
-0tests/data/acpi/virt/aarch64/NFIT.memhp renamed from tests/data/acpi/virt/NFIT.memhp +0
-0tests/data/acpi/virt/aarch64/PPTT renamed from tests/data/acpi/virt/PPTT +0
-0tests/data/acpi/virt/aarch64/PPTT.acpihmatvirt renamed from tests/data/acpi/virt/PPTT.acpihmatvirt +0
-0tests/data/acpi/virt/aarch64/PPTT.topology renamed from tests/data/acpi/virt/PPTT.topology +0
-0tests/data/acpi/virt/aarch64/SLIT.memhp renamed from tests/data/acpi/virt/SLIT.memhp +0
-0tests/data/acpi/virt/aarch64/SPCR renamed from tests/data/acpi/virt/SPCR +0
-0tests/data/acpi/virt/aarch64/SRAT.acpihmatvirt renamed from tests/data/acpi/virt/SRAT.acpihmatvirt +0
-0tests/data/acpi/virt/aarch64/SRAT.memhp renamed from tests/data/acpi/virt/SRAT.memhp +0
-0tests/data/acpi/virt/aarch64/SRAT.numamem renamed from tests/data/acpi/virt/SRAT.numamem +0
-0tests/data/acpi/virt/aarch64/SSDT.memhp renamed from tests/data/acpi/virt/SSDT.memhp +0
-0tests/data/acpi/virt/aarch64/VIOT renamed from tests/data/acpi/virt/VIOT +0
-1--2.40.1
Re: [PATCH 08/12] meson.build: Add RISC-V to the edk2-target list
In reply to Sunil V LQuoted 4 lines · Sunil V L
so that ACPI table test can be supported.
Signed-off-by Sunil V L <[email protected]>
Alistair
Quoted 20 lines
--- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)meson.build +1
-2@@ -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 --2.40.1
Re: [PATCH 09/12] pc-bios/meson.build: Add support for RISC-V in unpack_edk2_blobs
In reply to Sunil V LQuoted 5 lines · Sunil V L
Update list of images supported in
unpack_edk2_blobsto enable RISC-V ACPI table testing.Signed-off-by Sunil V L <[email protected]>
Alistair
Quoted 35 lines
--- pc-bios/meson.build | 2 ++ tests/qtest/meson.build | 3 +++ 2 files changed, 5 insertions(+)pc-bios/meson.build +2
-0@@ -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
-1@@ -252,6 +252,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', --2.40.1
Re: [PATCH 10/12] tests/data/acpi/rebuild-expected-aml.sh: Add RISC-V
In reply to Sunil V LQuoted 4 lines · Sunil V L
Update the list of supported architectures to include RISC-V.
Signed-off-by Sunil V L <[email protected]>
Alistair
Quoted 30 lines
--- tests/data/acpi/rebuild-expected-aml.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)tests/data/acpi/rebuild-expected-aml.sh +3
-3@@ -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 --2.40.1
Re: [PATCH 11/12] tests/data/acpi/virt/riscv64: Add expected ACPI tables for RISC-V
In reply to Sunil V LQuoted 3 lines · Sunil V L
Add expected ACPI tables for RISC-V so that bios-table-test can be enabled for RISC-V.
Can you detail where and how these files are generated/built?
Alistair
Quoted 147 lines
Signed-off-by Sunil V L <[email protected]>--- tests/data/acpi/virt/riscv64/APIC | Bin 0 -> 116 bytes tests/data/acpi/virt/riscv64/BGRT | Bin 0 -> 56 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/RSDP | Bin 0 -> 36 bytes tests/data/acpi/virt/riscv64/SPCR | Bin 0 -> 80 bytes tests/data/acpi/virt/riscv64/XSDT | Bin 0 -> 84 bytes 9 files changed, 0 insertions(+), 0 deletions(-) create mode 100755 tests/data/acpi/virt/riscv64/APIC create mode 100755 tests/data/acpi/virt/riscv64/BGRT create mode 100755 tests/data/acpi/virt/riscv64/DSDT create mode 100755 tests/data/acpi/virt/riscv64/FACP create mode 100755 tests/data/acpi/virt/riscv64/MCFG create mode 100755 tests/data/acpi/virt/riscv64/RHCT create mode 100755 tests/data/acpi/virt/riscv64/RSDP create mode 100755 tests/data/acpi/virt/riscv64/SPCR create mode 100755 tests/data/acpi/virt/riscv64/XSDTtests/data/acpi/virt/riscv64/APIC new file binary +0
-0tests/data/acpi/virt/riscv64/BGRT new file binary +0
-0tests/data/acpi/virt/riscv64/DSDT new file binary +0
-0tests/data/acpi/virt/riscv64/FACP new file binary +0
-0tests/data/acpi/virt/riscv64/MCFG new file binary +0
-0tests/data/acpi/virt/riscv64/RHCT new file binary +0
-0tests/data/acpi/virt/riscv64/RSDP new file binary +0
-0tests/data/acpi/virt/riscv64/SPCR new file binary +0
-0tests/data/acpi/virt/riscv64/XSDT new file binary +0
-1--2.40.1
Re: [PATCH 12/12] tests/qtest/bios-tables-test.c: Enable basic testing for RISC-V
In reply to Sunil V LQuoted 4 lines · Sunil V L
Add basic ACPI table testing for RISC-V.
Signed-off-by Sunil V L <[email protected]>
Alistair
Quoted 53 lines
--- tests/qtest/bios-tables-test.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+)tests/qtest/bios-tables-test.c +28
-1@@ -1923,6 +1923,30 @@ 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. Once profile is ratified, there may +* not be new extension possible. +*/ +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 = {@@ -2342,6 +2366,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