From: David Woodhouse <dwmw2@infradead.org>
To: Kevin O'Connor <kevin@koconnor.net>, Gerd Hoffmann <kraxel@redhat.com>
Cc: seabios <seabios@seabios.org>,
xen-devel <xen-devel@lists.xenproject.org>,
qemu-devel <qemu-devel@nongnu.org>, paul <paul@xen.org>
Subject: Re: [SeaBIOS] [SeaBIOS PATCH] xen: require Xen info structure at 0x1000 to detect Xen
Date: Thu, 02 Feb 2023 08:05:01 +0000 [thread overview]
Message-ID: <fd3259a2765d4b33ccf7baea320ac798bab63159.camel@infradead.org> (raw)
In-Reply-To: <Y9scWQ/ASMCrY/uM@morn>
[-- Attachment #1: Type: text/plain, Size: 2370 bytes --]
On Wed, 2023-02-01 at 21:13 -0500, Kevin O'Connor wrote:
> On Fri, Jan 20, 2023 at 11:33:19AM +0000, David Woodhouse wrote:
> > From: David Woodhouse <dwmw@amazon.co.uk>
> >
> > When running under Xen, hvmloader places a table at 0x1000 with the e820
> > information and BIOS tables. If this isn't present, SeaBIOS will
> > currently panic.
> >
> > We now have support for running Xen guests natively in QEMU/KVM, which
> > boots SeaBIOS directly instead of via hvmloader, and does not provide
> > the same structure.
> >
> > As it happens, this doesn't matter on first boot. because although we
> > set PlatformRunningOn to PF_QEMU|PF_XEN, reading it back again still
> > gives zero. Presumably because in true Xen, this is all already RAM. But
> > in QEMU with a faithfully-emulated PAM config in the host bridge, it's
> > still in ROM mode at this point so we don't see what we've just written.
> >
> > On reboot, however, the region *is* set to RAM mode and we do see the
> > updated value of PlatformRunningOn, do manage to remember that we've
> > detected Xen in CPUID, and hit the panic.
> >
> > It's not trivial to detect QEMU vs. real Xen at the time xen_preinit()
> > runs, because it's so early. We can't even make a XENVER_extraversion
> > hypercall to look for hints, because we haven't set up the hypercall
> > page (and don't have an allocator to give us a page in which to do so).
> >
> > So just make Xen detection contingent on the info structure being
> > present. If it wasn't, we were going to panic anyway. That leaves us
> > taking the standard QEMU init path for Xen guests in native QEMU,
> > which is just fine.
>
> Thanks. I committed this change.
>
> -Kevin
Thanks, Kevin.
I'd like to get the rest of the Xen platform support in to qemu 8.0 if
possible. Which is currently scheduled for March.
Is there likely to be a SeaBIOS release before then which Gerd would
pull into qemu anyway, or should I submit a submodule update to a
snapshot of today's tree? That would just pull in this commit, and the
one other fix that's in the SeaBIOS tree since 1.16.1?
$ git shortlog rel-1.16.1..
David Woodhouse (1):
xen: require Xen info structure at 0x1000 to detect Xen
Qi Zhou (1):
usb: fix wrong init of keyboard/mouse's if first interface is not boot protocol
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5965 bytes --]
next prev parent reply other threads:[~2023-02-02 8:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-20 11:33 [SeaBIOS PATCH] xen: require Xen info structure at 0x1000 to detect Xen David Woodhouse
2023-01-26 17:49 ` Paul Durrant
2023-01-26 23:52 ` [SeaBIOS] " Kevin O'Connor
2023-02-02 2:13 ` Kevin O'Connor
2023-02-02 8:05 ` David Woodhouse [this message]
2023-02-02 9:10 ` [SeaBIOS] " Gerd Hoffmann
2023-03-07 8:42 ` David Woodhouse
2023-03-09 11:27 ` Gerd Hoffmann
2023-03-16 13:02 ` seabios 1.16.2 release tagged (was: Re: [SeaBIOS] Re: [SeaBIOS PATCH] xen: require Xen info structure at). " Gerd Hoffmann
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=fd3259a2765d4b33ccf7baea320ac798bab63159.camel@infradead.org \
--to=dwmw2@infradead.org \
--cc=kevin@koconnor.net \
--cc=kraxel@redhat.com \
--cc=paul@xen.org \
--cc=qemu-devel@nongnu.org \
--cc=seabios@seabios.org \
--cc=xen-devel@lists.xenproject.org \
/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).