public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Boeuf, Sebastien" <sebastien.boeuf@intel.com>
To: "kraxel@redhat.com" <kraxel@redhat.com>
Cc: "devel@edk2.groups.io" <devel@edk2.groups.io>
Subject: Re: EFI shell with microvm
Date: Fri, 7 Jan 2022 14:12:59 +0000	[thread overview]
Message-ID: <4f16917c557d35d2c7e27e0c222addfe02a1c87a.camel@intel.com> (raw)
In-Reply-To: <cbc9b402cf4fa5678f29290301ac18cfdcf3a44b.camel@intel.com>

I finally got it to work by using the XenTimerDxe. The reason why it
works is because the UEFI service SetTimer() needs one Timer
Architectural Protocol to be installed. In case of standard QEMU, the
8254 PIT is the one registering the service, while for microvm the Xen
timer does the job.

It's interesting to notice that XenTimerDxe is not specific to Xen as
it simply relies on the local APIC timer that generates an interrupt on
IRQ0, which is eventually the local APIC vector 32.

So now I'm wondering how I'm gonna make OvmfPkgX64 work for both QEMU
and Cloud Hypervisor since only one Timer Architectural Protocol can be
registered.

Do you think it would be acceptable to move OvmfPkgX64 to XenTimerDxe
instead of 8254 legacy PIT?

Thanks,
Sebastien

On Fri, 2022-01-07 at 14:06 +0100, Sebastien Boeuf wrote:
> On Fri, 2022-01-07 at 13:07 +0100, kraxel@redhat.com wrote:
> >   Hi,
> > 
> > > > microvm has no lpc bridge, so I had to do it in a different way
> > > > ...
> > > 
> > > Cloud Hypervisor doesn't emulate any LPC bridge or ISA bus.
> > 
> > Ok, doing it microvm-style makes sense then.
> 
> Ok thanks for the confirmation. Hopefully it won't conflict with what
> QEMU uses/needs.
> 
> > 
> > > > Works fine for me.
> > > > 
> > > > qemu-system-x86_64 -nographic -machine microvm,rtc=on -bios
> > > > Build/MicrovmX64/DEBUG_GCC5/FV/MICROVM.fd
> > > 
> > > Thanks for the confirmation, something might be wrong with the
> > > interrupt used for my serial device.
> > 
> > tianocore doesn't use interrupts (other than timer).
> 
> Yes I realized that by diving into the code. I can see microvm using
> the Xen timer while OvmfPkgX64 uses 8254 PIT.
> 
> > 
> > > Cloud Hypervisor only has an IOAPIC, it doesn't rely on any PIC,
> > > which
> > > is why I'm not sure what might be missing to get the EFI shell to
> > > receive the interrupts.
> > 
> > PIC is optional for microvm too, and everything works fine for me
> > with
> > "-machine microvm,rtc=on,pic=off,pit=off"
> 
> Yes that's interesting and after some investigations I think the
> problem is that I don't get TerminalConInTimerHandler handler to be
> triggered. I can see the handler is correctly registered but for some
> reasons, it's never used. I'm wondering if that might be an issue
> related to a lack of timer support. Especially I see the UEFI service
> SetTimer() is being used for the polling mechanism, so I wonder what
> is
> the backend for it.
> 
> > 
> > take care,
> >   Gerd
> > 
> 

---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris, 
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

      parent reply	other threads:[~2022-01-07 14:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-06 11:25 EFI shell with microvm Boeuf, Sebastien
2022-01-06 12:44 ` Gerd Hoffmann
2022-01-06 13:08   ` Boeuf, Sebastien
2022-01-07 12:07     ` Gerd Hoffmann
2022-01-07 13:06       ` Boeuf, Sebastien
2022-01-07 13:37         ` Gerd Hoffmann
2022-01-10  0:16           ` Min Xu
2022-01-10  9:05             ` Boeuf, Sebastien
2022-01-07 14:12         ` Boeuf, Sebastien [this message]

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-list 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=4f16917c557d35d2c7e27e0c222addfe02a1c87a.camel@intel.com \
    --to=devel@edk2.groups.io \
    /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