All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Zixuan Wang <zxwang42@gmail.com>,
	kvm@vger.kernel.org, drjones@redhat.com
Cc: marcorr@google.com, erdemaktas@google.com, rientjes@google.com,
	seanjc@google.com, brijesh.singh@amd.com,
	Thomas.Lendacky@amd.com, varad.gautam@suse.com, jroedel@suse.de,
	bp@suse.de
Subject: Re: [kvm-unit-tests PATCH v2 10/10] x86 UEFI: Make _NO_FILE_4Uhere_ work w/ BOOTX64.EFI
Date: Tue, 18 Jan 2022 16:47:23 +0100	[thread overview]
Message-ID: <fddefa8e-37bb-3c02-d387-71191a4ffa7e@redhat.com> (raw)
In-Reply-To: <20211116204053.220523-11-zxwang42@gmail.com>

On 11/16/21 21:40, Zixuan Wang wrote:
> From: Marc Orr <marcorr@google.com>
> 
> The `_NO_FILE_4Uhere_` test case is used by the runner scripts to verify
> QEMU's configuration. Make it work with EFI/BOOT/BOOTX64.EFI by compling
> a minimal EFI binary, called dummy.c that returns immediately.
> 
> Signed-off-by: Marc Orr <marcorr@google.com>

A slightly simpler way to do it is to just let the normal build process
create dummy.efi as well:

commit 2fbec25780568559e13486f7e5b5350630d061d3 (HEAD -> uefi)
Author: Marc Orr <marcorr@google.com>
Date:   Tue Nov 16 12:40:53 2021 -0800

     x86 UEFI: Make _NO_FILE_4Uhere_ work w/ BOOTX64.EFI
     
     The `_NO_FILE_4Uhere_` test case is used by the runner scripts to verify
     QEMU's configuration. Make it work with EFI/BOOT/BOOTX64.EFI by compling
     a minimal EFI binary, called dummy.c that returns immediately.
     
     Signed-off-by: Marc Orr <marcorr@google.com>
     Message-Id: <20211116204053.220523-11-zxwang42@gmail.com>
     Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

diff --git a/scripts/runtime.bash b/scripts/runtime.bash
index 228a207..bb89a53 100644
--- a/scripts/runtime.bash
+++ b/scripts/runtime.bash
@@ -132,7 +132,7 @@ function run()
  
      last_line=$(premature_failure > >(tail -1)) && {
          skip=true
-        if [ "${TARGET_EFI}" == "y" ] && [[ "${last_line}" =~ "Reset" ]]; then
+        if [ "${TARGET_EFI}" == "y" ] && [[ "${last_line}" =~ "enabling apic" ]]; then
              skip=false
          fi
          if [ ${skip} == true ]; then
diff --git a/x86/Makefile.common b/x86/Makefile.common
index 2b39dd5..984444e 100644
--- a/x86/Makefile.common
+++ b/x86/Makefile.common
@@ -72,7 +72,7 @@ else
  endif
  
  tests-common = $(TEST_DIR)/vmexit.$(exe) $(TEST_DIR)/tsc.$(exe) \
-               $(TEST_DIR)/smptest.$(exe)  \
+               $(TEST_DIR)/smptest.$(exe) $(TEST_DIR)/dummy.$(exe) \
                 $(TEST_DIR)/msr.$(exe) \
                 $(TEST_DIR)/hypercall.$(exe) $(TEST_DIR)/sieve.$(exe) \
                 $(TEST_DIR)/kvmclock_test.$(exe) \
diff --git a/x86/dummy.c b/x86/dummy.c
new file mode 100644
index 0000000..5019e79
--- /dev/null
+++ b/x86/dummy.c
@@ -0,0 +1,4 @@
+int main(int argc, char **argv)
+{
+	return 0;
+}
diff --git a/x86/efi/run b/x86/efi/run
index a888979..ac368a5 100755
--- a/x86/efi/run
+++ b/x86/efi/run
@@ -29,6 +29,10 @@ fi
  # Remove the TEST_CASE from $@
  shift 1
  
+if [ "$EFI_CASE" = "_NO_FILE_4Uhere_" ]; then
+	EFI_CASE=dummy
+fi
+
  # Prepare EFI boot file system
  #   - Copy .efi file to host dir $EFI_TEST/$EFI_CASE/EFI/BOOT/BOOTX64.EFI
  #     This host dir will be loaded by QEMU as a FAT32 image
@@ -37,9 +41,7 @@ shift 1
  : "${EFI_CASE_BINARY:="$EFI_CASE_DIR/BOOTX64.EFI"}"
  
  mkdir -p "$EFI_CASE_DIR"
-if [ "$EFI_CASE" != "_NO_FILE_4Uhere_" ]; then
-	cp "$EFI_SRC/$EFI_CASE.efi" "$EFI_CASE_BINARY"
-fi
+cp "$EFI_SRC/$EFI_CASE.efi" "$EFI_CASE_BINARY"
  
  # Run test case with 256MiB QEMU memory. QEMU default memory size is 128MiB.
  # After UEFI boot up and we call `LibMemoryMap()`, the largest consecutive


  reply	other threads:[~2022-01-18 15:47 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-16 20:40 [kvm-unit-tests PATCH v2 00/10] x86_64 UEFI set up process refactor and scripts fixes Zixuan Wang
2021-11-16 20:40 ` [kvm-unit-tests PATCH v2 01/10] x86 UEFI: Remove mixed_mode Zixuan Wang
2021-11-16 20:40 ` [kvm-unit-tests PATCH v2 02/10] x86 UEFI: Refactor set up process Zixuan Wang
2021-11-16 20:40 ` [kvm-unit-tests PATCH v2 03/10] x86 AMD SEV: Skip SEV-ES if SEV is unsupported Zixuan Wang
2021-11-16 20:40 ` [kvm-unit-tests PATCH v2 04/10] x86 UEFI: Convert x86 test cases to PIC Zixuan Wang
2021-11-16 20:40 ` [kvm-unit-tests PATCH v2 05/10] x86 UEFI: Set UEFI OVMF as readonly Zixuan Wang
2021-11-16 20:40 ` [kvm-unit-tests PATCH v2 06/10] x86 UEFI: Exit QEMU with return code Zixuan Wang
2021-11-16 20:40 ` [kvm-unit-tests PATCH v2 07/10] scripts: Generalize EFI check Zixuan Wang
2021-11-16 20:40 ` [kvm-unit-tests PATCH v2 08/10] x86 UEFI: Make run_tests.sh (mostly) work under UEFI Zixuan Wang
2021-11-16 20:40 ` [kvm-unit-tests PATCH v2 09/10] x86 UEFI: Improve Boot Speed Zixuan Wang
2021-11-16 20:40 ` [kvm-unit-tests PATCH v2 10/10] x86 UEFI: Make _NO_FILE_4Uhere_ work w/ BOOTX64.EFI Zixuan Wang
2022-01-18 15:47   ` Paolo Bonzini [this message]
2022-01-18 16:51 ` [kvm-unit-tests PATCH v2 00/10] x86_64 UEFI set up process refactor and scripts fixes Paolo Bonzini
2022-01-18 17:29   ` Marc Orr

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fddefa8e-37bb-3c02-d387-71191a4ffa7e@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=Thomas.Lendacky@amd.com \
    --cc=bp@suse.de \
    --cc=brijesh.singh@amd.com \
    --cc=drjones@redhat.com \
    --cc=erdemaktas@google.com \
    --cc=jroedel@suse.de \
    --cc=kvm@vger.kernel.org \
    --cc=marcorr@google.com \
    --cc=rientjes@google.com \
    --cc=seanjc@google.com \
    --cc=varad.gautam@suse.com \
    --cc=zxwang42@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.