xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Keir Fraser <keir@xen.org>
To: Ian Campbell <Ian.Campbell@citrix.com>,
	Tim Deegan <Tim.Deegan@eu.citrix.com>
Cc: Daniel Castro <evil.dani@gmail.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"seabios@seabios.org" <seabios@seabios.org>,
	Jan Beulich <JBeulich@novell.com>
Subject: Re: Ideas for PV on SeaBIOS
Date: Thu, 19 May 2011 16:02:01 +0100	[thread overview]
Message-ID: <C9FAEF79.2D62A%keir@xen.org> (raw)
In-Reply-To: <1305797813.20907.175.camel@zakaz.uk.xensource.com>

On 19/05/2011 10:36, "Ian Campbell" <Ian.Campbell@citrix.com> wrote:

> On Thu, 2011-05-19 at 09:20 +0100, Tim Deegan wrote:
>> As for how you tidy up cleanly, I can't think of anything better than
>> a sort of virtual SMM, where you register an area of code to be run in
>> a known sane environment and have Xen trigger it based on, e.g. the
>> disable-my-devices ioport write.   It's pretty ugly but at least it'd
>> be fairly self-contained compared to having Xen or qemu try to tear
>> down grant-table entries &c.
> 
> Tim and I just had a bit of a think about whether or not this could be
> done from AML }:-). (Lets ignore the fact that require ACPI support in
> the guest for this functionality would be a bit lame...)
> 
> Turns out it cannot (phew!) without adding some very hacky way to make
> hypercalls (e.g. via an I/O write), hypercalls are needed to kick the
> xenstore evtchn and also to close any other evtchns. The rest, such as
> clearing down grant entries and zeroing the xenstore ring could be done
> from AML, we reckon.

Yuk, no. The SMM type thing (maybe not really emulated SMM, but kidn of
inspired by the principle of SMM) is the best idea I have so far. That was
the kind of thing in my mind when I replied yesterday.

 -- Keir

> FWIW the set of things which needs to be done seems to be:
> 
>       * xenbus writes to move devices to state 5 (provoking backend
>         reset), notify xenbus evtchn, wait for responses to complete (or
>         otherwise interlock against the xenstore ring reset below).
>       * make hypercalls to close event channels
>       * clear grant table entries
>       * reset the xenstore ring ready for use by next OS.
> 
> So it looks like some sort of SMM alike thing is going to be the best
> answer here, although "real virtual" SMM looks like a complete snake/tar
> pit. A simpler callback with flat segments seems plausibly doable.
> 
> As an aside we will also need to handle the case where the guest is not
> PV aware and hence uses the emulated devices and never triggers any of
> the above activities. So we need to ensure that the backends are sync'd
> even if none of the above takes place. The PV devices will remain open
> but that needn't be a problem if the guest never uses them.
> 
> Possibly this means making sure all writes via this PV interface go
> straight to disk (using the appropriate barriers) or by having qemu do
> the necessary flush when the emulated device is first used.
> 
> Ian.
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel

  reply	other threads:[~2011-05-19 15:02 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-19  5:33 Ideas for PV on SeaBIOS Daniel Castro
2011-05-19  7:19 ` Keir Fraser
2011-05-19  8:01   ` [Xen-devel] " Ian Campbell
2011-05-21  7:39     ` Paolo Bonzini
2011-05-21  8:44       ` James Harper
2011-05-23  9:23         ` [Xen-devel] " Ian Campbell
2011-05-23 10:20           ` James Harper
2011-05-23 10:23             ` Ian Campbell
2011-05-19  7:44 ` James Harper
2011-05-19  8:08 ` Jan Beulich
2011-05-19  8:17   ` Juergen Gross
2011-05-19  8:20   ` Tim Deegan
2011-05-19  9:36     ` Ian Campbell
2011-05-19 15:02       ` Keir Fraser [this message]
2011-05-19 17:00       ` Ideas for PV on SeaBIOS - flush/barrier in QEMU Konrad Rzeszutek Wilk
2011-05-19  9:32   ` Ideas for PV on SeaBIOS James Harper
2011-05-21 13:38   ` [SeaBIOS] " Kevin O'Connor
2011-05-21 13:29 ` Kevin O'Connor
2011-05-23  5:24   ` Stefan Hajnoczi
2011-05-23  9:50     ` 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=C9FAEF79.2D62A%keir@xen.org \
    --to=keir@xen.org \
    --cc=Ian.Campbell@citrix.com \
    --cc=JBeulich@novell.com \
    --cc=Tim.Deegan@eu.citrix.com \
    --cc=evil.dani@gmail.com \
    --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).