Re: [kvm-unit-tests PATCH v2 10/18] arm64: efi: Allow running tests directly

Andrew Jones
2024-03-04T09:43:34Z

On Mon, Mar 04, 2024 at 07:52:40AM +0000, Nikos Nikoleris wrote:
> On 27/02/2024 19:21, Andrew Jones wrote:
> > Since it's possible to run tests with UEFI and the QEMU -kernel
> > option (and now the DTB will be found and even the environ will
> > be set up from an initrd if given with the -initrd option), then
> > we can skip the loading of EFI tests into a file system and booting
> > to the shell to run them. Just run them directly. Running directly
> > is waaaaaay faster than booting the shell first. We keep the UEFI
> > shell as the default behavior, though, and provide a new configure
> > option to enable the direct running.
> >
> > Signed-off-by: Andrew Jones <andrew.jones@linux.dev>
>
> Just a minor nit, see below, but in any case:
>
> Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
>
> > ---
> > arm/efi/run | 17 +++++++++++++++--
> > arm/run | 4 +++-
> > configure | 17 +++++++++++++++++
> > 3 files changed, 35 insertions(+), 3 deletions(-)
> >
> > diff --git a/arm/efi/run b/arm/efi/run
> > index b7a8418a07f8..af7b593c2bb8 100755
> > --- a/arm/efi/run
> > +++ b/arm/efi/run
> > @@ -18,10 +18,12 @@ elif [ -f /usr/share/edk2/aarch64/QEMU_EFI.silent.fd ]; then
> > DEFAULT_UEFI=/usr/share/edk2/aarch64/QEMU_EFI.silent.fd
> > fi
> > +KERNEL_NAME=$1
> > +
> > : "${EFI_SRC:=$TEST_DIR}"
> > : "${EFI_UEFI:=$DEFAULT_UEFI}"
> > : "${EFI_TEST:=efi-tests}"
> > -: "${EFI_CASE:=$(basename $1 .efi)}"
> > +: "${EFI_CASE:=$(basename $KERNEL_NAME .efi)}"
> > : "${EFI_TESTNAME:=$TESTNAME}"
> > : "${EFI_TESTNAME:=$EFI_CASE}"
> > : "${EFI_CASE_DIR:="$EFI_TEST/$EFI_TESTNAME"}"
> > @@ -80,4 +82,15 @@ uefi_shell_run()
> > "${qemu_args[@]}"
> > }
> > -uefi_shell_run
> > +if [ "$EFI_DIRECT" = "y" ]; then
> > + if [ "$EFI_USE_ACPI" != "y" ]; then
> > + qemu_args+=(-machine acpi=off)
> > + fi
>
> The if statement above is common for the efi and efi_direct paths. You could
> also move it above to avoid the code replication.

Will do.

Thanks,
drew