From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: kvm-ppc@vger.kernel.org
Subject: RE: kvm BookE and SPRGs
Date: Fri, 10 Jul 2009 09:25:23 +0000 [thread overview]
Message-ID: <1247217923.15530.45.camel@pasglop> (raw)
In-Reply-To: <1247207486.15530.23.camel@pasglop>
On Fri, 2009-07-10 at 19:17 +1000, Benjamin Herrenschmidt wrote:
> On Fri, 2009-07-10 at 17:15 +0800, Liu Yu-B13201 wrote:
> > Sounds reasonable.
> >
> > There are some old patchset which implemented the binary patch as Ben
> > described.
> >
> > http://marc.info/?l=kvm-ppc&m\x122154653905212&w=2
> > http://marc.info/?l=kvm-ppc&m\x122154657905306&w=2
> >
>
> Interesting. Any reason why that wasn't merged ?
Ok, I had a look and it seems like he's rewriting the guest instructions
from the hypervisor.
I prefer having the guest rewrite it's own instructions. That does mean
that the layout inside the magic page has to be fixed to a certain
extent (or we need the hypervisor to at least pass some kind of
description of where the various fields are) but that's a much better
approach I believe.
The main reason is because of the user-readable SPRG4..7. Because the
guest will -not- trap when reading them, it will be able to read the
value from the real underlying registers. However, when the writes to
them are replaced by writing to the magic page, the underlying register
is not kept in sync and things will break.
Thus I prefer having the guest itself replace those instructions with
magic page accesses in both case (stores and loads), it becomes the
guest responsibility to ensure it's properly using the magic page -only-
and doesn't trap on the actual instructions.
We would thus continue trapping on the normal instructions and emulate
them the old way (though we can probably move that emulation to asm
code that is run before the switch back to the linux mm via the magic
page :-) and thus make the emulation much faster, but that's a different
deal.
But still, the bulk of the patches for adding the cleaner paravirt
interfaces, the magic page etc... seems sane.
Cheers,
Ben.
next prev parent reply other threads:[~2009-07-10 9:25 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-10 6:31 kvm BookE and SPRGs Benjamin Herrenschmidt
2009-07-10 8:10 ` Benjamin Herrenschmidt
2009-07-10 8:42 ` Alexander Graf
2009-07-10 9:09 ` Benjamin Herrenschmidt
2009-07-10 9:15 ` Liu Yu-B13201
2009-07-10 9:17 ` Benjamin Herrenschmidt
2009-07-10 9:25 ` Benjamin Herrenschmidt [this message]
2009-07-10 9:39 ` Benjamin Herrenschmidt
2009-07-10 9:42 ` Benjamin Herrenschmidt
2009-07-10 9:43 ` Alexander Graf
2009-07-10 10:50 ` Benjamin Herrenschmidt
2009-07-10 16:31 ` Hollis Blanchard
2009-07-10 16:40 ` Hollis Blanchard
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=1247217923.15530.45.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=kvm-ppc@vger.kernel.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