xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Ian Campbell <Ian.Campbell@eu.citrix.com>
To: Kevin O'Connor <kevin@koconnor.net>
Cc: Anthony Perard <anthony.perard@citrix.com>,
	xen-devel <xen-devel@lists.xensource.com>,
	"seabios@seabios.org" <seabios@seabios.org>
Subject: Re: [Xen-devel] Re: [RFC] [PATCH 0/2] Basic SeaBIOS support for Xen HVM
Date: Tue, 24 May 2011 12:02:07 +0100	[thread overview]
Message-ID: <1306234927.20576.155.camel@zakaz.uk.xensource.com> (raw)
In-Reply-To: <20110524001759.GC28567@morn.localdomain>

[-- Attachment #1: Type: text/plain, Size: 5189 bytes --]

On Tue, 2011-05-24 at 01:17 +0100, Kevin O'Connor wrote:
> On Mon, May 23, 2011 at 11:44:38AM +0100, Ian Campbell wrote:
> > On Tue, 2011-05-17 at 16:59 +0100, Ian Campbell wrote:
> > > The following implements all your feedback (I hope). I have squashed it
> > > down into a single commit which supports direct boot.
> 
> BTW, in general, the above patch looks okay to me.
> 
> > I've gotten all the PCI setup and ACPI stuff etc etc working but,
> > frankly, the patch to SeaBIOS is getting to be pretty enormous and
> > intrusive.
> 
> Is that due to incompleteness / innacuracies in the current SeaBIOS
> code, or due to requirements specific to Xen?

A mixture of both but mainly requirements specific to Xen, I think.

PCI setup is one of the main things, the interrupt routing in particular
is different which has knock on effects on chipset setup (e.g. legacy
PCI ISA IRQ routing) and the BIOS tables (e.g. ACPI _PRT entries). This
strikes me as being highly "mainboard" specific, IOW the stuff I would
expect to find in coreboot rather than SeaBIOS.

Another difference is that the existing hvmloader tables are ACPI 2.0
while SeaBIOS only creates 1.0 tables, I'm not sure that strictly
speaking counts as a incompleteness in SeaBIOS since it's not obvious
that Xen actually needs/uses any of the functionality of 2.0. Also it
might be something SeaBIOS would like to grow in any case.

> If you have test code, I'd be curious to see a patch on the mailing
> list - it may help later to understand the use cases for SeaBIOS.

It's in a pretty embarrassing state at the moment, but OK. Please note
that I was nowhere near suggesting this patch was in any way suitable to
be applied or even near to becoming an RFC!

I initially took a rather gung-ho approach in the interests of matching
as closely as possible how hvmloader+rombios sets things up, rather than
evaluating the actual useful meaning of the differences. Having made
things match my intention was to go back and evaluate each change and
attempt to get rid of it unless there was an extremely pressing reason
not to, but I didn't reach that phase yet. So I think this is an upper
bound (possibly by a large-ish order of magnitude) on the level of
change.

I hardcoded a few things here and there too (e.g. numbers of CPUs), in
the interests of getting something working before going back and
cleaning it up.

The diff (vs. the patches I already posted) is attached, it's diffstat
is:

 src/Kconfig          |   34 +
 src/acpi-dsdt.dsl    | 9482 +++++++++++++++++++++++++++++++++++++++++++++-----
 src/acpi-dsdt.hex    | 9331 +++++++++++++++++++++++++++++++++++++++++++-------
 src/acpi.c           |  152 +-
 src/acpi.h           |   93 +
 src/config.h         |    6 +-
 src/dev-i440fx.c     |   16 +-
 src/pciinit.c        |    6 +-
 src/pmm.c            |    5 +-
 src/post.c           |    5 +
 src/util.h           |    5 +
 src/xen.c            |  128 +-
 src/xen.h            |    3 +
 src/xen/hvm/hvm_op.h |  245 ++
 src/xen/hvm/params.h |  145 +
 src/xen/version.h    |   94 +
 src/xen/xen.h        |  739 ++++
 src/xen_hypercall.h  |  187 +
 18 files changed, 18591 insertions(+), 2085 deletions(-)

The DSDT change rather dominates, dropping it gives a more sensible:
 11 files changed, 414 insertions(+), 39 deletions(-)

I just ripped the DSDT out of hvmloader, I'm sure with analysis the
changes could be reduced to something much more sane, although I have a
feeling it would still end up as a subtly different variant of the table
(_PRT and such).

> > The more I look at it the more I am coming to the conclusion that it
> > would be better to have hvmloader setup all this platform level stuff
> > and pass details onto SeaBIOS as necessary, following the model used
> > with coreboot->SeaBIOS rather than the emulator's way of doing things.
> > hvmloader basically already fulfils the same role for Xen HVM guests as
> > coreboot does for physical hardware so I think that makes a certain
> > amount of sense.
> 
> I'm okay with that approach as well

The SeaBIOS patch for this approach seems likely to be an awful lot
smaller. Basically most "if (COREBOOT)" become effectively "if
(COREBOOT||XEN)" + a Xen equivalent to coreboot_copy_biostable and
coreboot_fill_map.

> - there are pros and cons to each method.

Apart from avoiding bloating SeaBIOS with a load of Xen specific stuff
(which would be duplicated in hvmloader and also needed by the tianocore
firmware variant etc) I think the big thing pulling me towards this
approach is the idea that the BIOS tables describe the hardware, and
since the "hardware" in this case is defined by Xen the tables ought to
be supplied by Xen. I don't know if that's a distinction which people
who really know about things at this level actually make though.

>  (At various points, it's been discussed whether SeaBIOS
> should generate ACPI tables for coreboot,

Would that involve pulling a bunch of mainboard specific stuff from
coreboot into SeaBIOS?

>  and it has also been
> discussed if QEmu should just pass in ACPI tables to SeaBIOS..)

That sounds plausible to me, at least based on my current understanding
of what I think is going on ;-)

Ian.

[-- Attachment #2: xen-hack.patch.bz2 --]
[-- Type: application/x-bzip, Size: 90631 bytes --]

[-- Attachment #3: Type: text/plain, Size: 137 bytes --]

_______________________________________________
SeaBIOS mailing list
SeaBIOS@seabios.org
http://www.seabios.org/mailman/listinfo/seabios

  reply	other threads:[~2011-05-24 11:02 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-13 15:59 [RFC] [PATCH 0/2] Basic SeaBIOS support for Xen HVM Ian Campbell
2011-05-13 15:59 ` [PATCH 1/2] Kconfig: Add option to enable support for running as a Xen HVM guests BIOS Ian Campbell
2011-05-13 15:59 ` [PATCH 2/2] Basic support for booting directly as Xen HVM firmware Ian Campbell
2011-05-14 14:02   ` Kevin O'Connor
2011-05-16  8:45     ` Ian Campbell
2011-05-14 13:36 ` [RFC] [PATCH 0/2] Basic SeaBIOS support for Xen HVM Kevin O'Connor
2011-05-16  8:44   ` [SeaBIOS] " Ian Campbell
2011-05-16 23:39     ` Kevin O'Connor
2011-05-17 15:59       ` Ian Campbell
2011-05-23 10:44         ` Re: [SeaBIOS] " Ian Campbell
2011-05-24  0:17           ` [Xen-devel] " Kevin O'Connor
2011-05-24 11:02             ` Ian Campbell [this message]
2011-05-24 12:38               ` [SeaBIOS] " Gerd Hoffmann
2011-05-25  2:44               ` Re: [SeaBIOS] " Kevin O'Connor
2011-05-26 15:13                 ` [SeaBIOS] " Ian Campbell
2011-05-27  1:20                   ` [Xen-devel] " Kevin O'Connor
2011-05-27  9:27                     ` Ian Campbell
2011-05-30 14:43                       ` Kevin O'Connor
2011-06-01  9:17                         ` Ian Campbell

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=1306234927.20576.155.camel@zakaz.uk.xensource.com \
    --to=ian.campbell@eu.citrix.com \
    --cc=anthony.perard@citrix.com \
    --cc=kevin@koconnor.net \
    --cc=seabios@seabios.org \
    --cc=xen-devel@lists.xensource.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).