All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: kvm-ppc@vger.kernel.org
Subject: Re: re-writing on powerpc
Date: Tue, 14 Dec 2010 15:48:13 +0000	[thread overview]
Message-ID: <4D0791BD.1000604@redhat.com> (raw)
In-Reply-To: <FD1A71B048BD854792EE753E0E9F27DE80A7@az33exm20>

On 12/14/2010 05:45 PM, Yoder Stuart-B08248 wrote:
> >  -----Original Message-----
> >  From: Avi Kivity [mailto:avi@redhat.com]
> >  Sent: Tuesday, December 14, 2010 2:49 AM
> >  To: Hollis Blanchard
> >  Cc: Yoder Stuart-B08248; Alexander Graf; kvm-ppc@vger.kernel.org
> >  Subject: Re: re-writing on powerpc
> >
> >  On 12/13/2010 07:17 PM, Hollis Blanchard wrote:
> >  >>  Rewriting is dangerous if the guest is unaware of it.  As soon as
> it
> >  >>  is made aware of it, it might as well actually do it in the best
> way
> >  >>  that suits it.
> >  >
> >  >  Can you list some examples of dangerous scenarios?
> >  >
> >
> >  - guest checksums own kernel pages
> >  - clever compiler reuses code for constant pool
> >  - guest patches itself (a la linux alternatives), surprised when it
> sees a
> >  different instruction
> >  - guest jits own kernel code (like Singularity), gets confused when it
> >  reads back something it didn't write
>
> One possible solution to hiding rewriting from guest if it must
> be hidden is to mark patched pages as execute only.  If a guest
> reads a patched page, the hypervisor can fix up the read.
>

Yes.  Something that is common to all the problems above is "using code 
as data".

However, execute only would only affect the page's mapping, not the page 
itself, yes?  So if the page has another mapping, this doesn't work.

Of course the guest is not completely unaware of patching, so we can 
say, if the guest requests patching it becomes its responsibility not to 
do silly stuff.  I still prefer guest patching though.

> For KVM on powerpc, I'm not sure that having the guest be
> completely unaware of the presence of a hypervisor is what
> we need to be necessarily shooting for.   What has been worked on in
> the embedded virtualization committee in power.org is that
> we expect there to be a /hypervisor node in the guest device
> tree with certain standard properties, including ones indicating
> if the hypervisor support a shared area or re-writing.  The
> guest makes an hcall indicating if it wants to enable rewriting.
>
> So the guest would need to be aware that it needs to checksum
> before enabling this.
>
> The problem is how much guest modification is needed--  some hcalls
> to enable rewriting seems manageable.  Changing every OS for
> the paravirt interface involves a lot more work.

If a spec exists for hypervisor controlled rewriting, that changes the 
picture considerably.  Presumably the spec lays out all the constraints 
in detail, so we don't have to worry about that.

-- 
error compiling committee.c: too many arguments to function


  parent reply	other threads:[~2010-12-14 15:48 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-13  4:45 re-writing on powerpc Yoder Stuart-B08248
2010-12-13  8:35 ` Avi Kivity
2010-12-13  8:42 ` Alexander Graf
2010-12-13  8:45 ` Avi Kivity
2010-12-13 17:12 ` Hollis Blanchard
2010-12-13 17:15 ` Avi Kivity
2010-12-13 17:17 ` Hollis Blanchard
2010-12-13 19:03 ` Scott Wood
2010-12-13 23:54 ` Alexander Graf
2010-12-14  0:18 ` Scott Wood
2010-12-14  0:24 ` Alexander Graf
2010-12-14  8:40 ` Avi Kivity
2010-12-14  8:42 ` Avi Kivity
2010-12-14  8:48 ` Avi Kivity
2010-12-14  9:08 ` Alexander Graf
2010-12-14 15:45 ` Yoder Stuart-B08248
2010-12-14 15:48 ` Avi Kivity [this message]
2010-12-14 16:55 ` Scott Wood
2010-12-14 17:48 ` Alexander Graf
2010-12-14 17:53 ` Hollis Blanchard
2010-12-14 18:37 ` Scott Wood
2010-12-14 18:41 ` Scott Wood
2010-12-14 20:04 ` Scott Wood
2010-12-14 23:00 ` Alexander Graf
2010-12-14 23:17 ` Scott Wood
2010-12-14 23:29 ` Alexander Graf
2010-12-15  0:00 ` Scott Wood
2010-12-15  0:13 ` Alexander Graf
2010-12-15  0:57 ` Andreas Färber
2010-12-15  9:48 ` Avi Kivity
2010-12-15 11:16 ` Sethi Varun-B16395
2010-12-15 11:18 ` Avi Kivity
2010-12-15 11:32 ` Sethi Varun-B16395
2010-12-15 12:25 ` Avi Kivity
2010-12-17 21:59 ` Benjamin Herrenschmidt
2010-12-17 22:00 ` Benjamin Herrenschmidt

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=4D0791BD.1000604@redhat.com \
    --to=avi@redhat.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.