kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zixuan Wang <zxwang42@gmail.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: kvm list <kvm@vger.kernel.org>, Andrew Jones <drjones@redhat.com>,
	Marc Orr <marcorr@google.com>,
	Erdem Aktas <erdemaktas@google.com>,
	David Rientjes <rientjes@google.com>,
	Sean Christopherson <seanjc@google.com>,
	"Singh, Brijesh" <brijesh.singh@amd.com>,
	"Lendacky, Thomas" <Thomas.Lendacky@amd.com>,
	Varad Gautam <varad.gautam@suse.com>,
	Joerg Roedel <jroedel@suse.de>,
	bp@suse.de
Subject: Re: [kvm-unit-tests PATCH v1 5/7] x86 UEFI: Exit QEMU with return code
Date: Sun, 31 Oct 2021 14:36:00 -0700	[thread overview]
Message-ID: <CAEDJ5ZQVX6c_FQ_=b4thNXo76cN2_a4cu+-4PZERdLovmjKmvg@mail.gmail.com> (raw)
In-Reply-To: <5460ca03-4547-b538-e187-6eb8e9ce8641@redhat.com>

On Sun, Oct 31, 2021 at 3:02 AM Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> On 31/10/21 06:56, Zixuan Wang wrote:
> > From: Zixuan Wang <zxwang42@gmail.com>
> >   efi_status_t efi_main(efi_handle_t handle, efi_system_table_t *sys_tab)
> >   {
> > -     int ret;
> > +     unsigned long ret;
>
> Why this change?

Didn't notice this, it should be int, thanks for pointing it out!

> >       efi_status_t status;
> >       efi_bootinfo_t efi_bootinfo;
> >
> > @@ -134,14 +134,14 @@ efi_status_t efi_main(efi_handle_t handle, efi_system_table_t *sys_tab)
> >       ret = main(__argc, __argv, __environ);
> >
> >       /* Shutdown the guest VM */
> > -     efi_rs_call(reset_system, EFI_RESET_SHUTDOWN, ret, 0, NULL);
> > +     exit(ret);
> >
> >       /* Unreachable */
> >       return EFI_UNSUPPORTED;
> >
> >   efi_main_error:
> >       /* Shutdown the guest with error EFI status */
> > -     efi_rs_call(reset_system, EFI_RESET_SHUTDOWN, status, 0, NULL);
> > +     exit(status);
> >
> >       /* Unreachable */
> >       return EFI_UNSUPPORTED;
>
> It's better to keep the exit() *and* the efi_rs_call(), I think, in case
> the testdev is missing and therefore the exit() does not work.
>
> Paolo
>

I agree, I think there are three possible solutions:

1. keep both exit() and efi_rs_call() here, or
2. define a new function efi_exit() that calls both exit() and efi_rs_call(), or
3. add efi_rs_call() to the end of exit() function (defined in
lib/x86/io.c), so many other calls to exit() can utilize EFI exit as a
backup

Best regards,
Zixuan

  reply	other threads:[~2021-10-31 21:36 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-31  5:56 [kvm-unit-tests PATCH v1 0/7] x86_64 UEFI set up process refactor and scripts fixes Zixuan Wang
2021-10-31  5:56 ` [kvm-unit-tests PATCH v1 1/7] x86 UEFI: Remove mixed_mode Zixuan Wang
2021-10-31  5:56 ` [kvm-unit-tests PATCH v1 2/7] x86 UEFI: Refactor set up process Zixuan Wang
2021-11-05 18:54   ` Sean Christopherson
2021-11-09 17:16     ` Zixuan Wang
2021-10-31  5:56 ` [kvm-unit-tests PATCH v1 3/7] x86 UEFI: Convert x86 test cases to PIC Zixuan Wang
2021-10-31  5:56 ` [kvm-unit-tests PATCH v1 4/7] x86 UEFI: Set UEFI OVMF as readonly Zixuan Wang
2021-10-31  5:56 ` [kvm-unit-tests PATCH v1 5/7] x86 UEFI: Exit QEMU with return code Zixuan Wang
2021-10-31 10:01   ` Paolo Bonzini
2021-10-31 21:36     ` Zixuan Wang [this message]
2021-10-31  5:56 ` [kvm-unit-tests PATCH v1 6/7] scripts: Generalize EFI check Zixuan Wang
2021-10-31  7:13   ` Paolo Bonzini
2021-10-31 15:35     ` Marc Orr
2021-10-31  5:56 ` [kvm-unit-tests PATCH v1 7/7] x86 UEFI: Make run_tests.sh (mostly) work under UEFI Zixuan Wang
2021-10-31  7:28 ` [kvm-unit-tests PATCH v1 0/7] x86_64 UEFI set up process refactor and scripts fixes Paolo Bonzini
2021-10-31 16:14   ` Marc Orr
2021-10-31 21:54     ` Zixuan Wang
2021-11-01  7:11       ` Andrew Jones
2021-11-01 22:35         ` Zixuan Wang

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='CAEDJ5ZQVX6c_FQ_=b4thNXo76cN2_a4cu+-4PZERdLovmjKmvg@mail.gmail.com' \
    --to=zxwang42@gmail.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=pbonzini@redhat.com \
    --cc=rientjes@google.com \
    --cc=seanjc@google.com \
    --cc=varad.gautam@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).