virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: Zachary Amsden <zach@vmware.com>
To: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Andrew Morton <akpm@osdl.org>, Zachary Amsden <zamsden@gmail.com>,
	Andi Kleen <ak@muc.de>, Petr Vandrovec <petr@vmware.com>,
	Chris Wright <chrisw@sous-sol.org>,
	Virtualization Mailing List <virtualization@lists.osdl.org>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	Ingo Molnar <mingo@elte.hu>
Subject: Re: [RFC, PATCH 5/5] Paravirt_ops export.patch
Date: Mon, 23 Apr 2007 14:54:01 -0700	[thread overview]
Message-ID: <462D2AF9.9010609@vmware.com> (raw)
In-Reply-To: <462D252D.5090008@goop.org>

Jeremy Fitzhardinge wrote:
>
> Well, the BUG is if the patch-size is smaller than sizeof(indirect
> call).  Or more generally, if the patch site contains bogus crud.  But I
> don't think checking for that in the patcher makes a great deal of sense.
>   

True, it may not make a lot of sense to check there.  But it is the only 
place where we can check it at runtime.  Unless you want some kind of 
compile time checking in the code which generates the patch data, say 
perhaps a .abort.  Still, that is not safe against modules which have 
broken paravirt-ops embedding.

> Currently the invariants on pv_ops patch sites are initially:
>
>    1. the sequence is always at least an indirect call to an
>       implementation of the operations, and
>    2. it will always have appropriate register save/restores which allow
>       a call to C code to work at that site
>
> As a result, it is always OK to execute without doing any patching.
>
> The callsite clobbers may be smaller than those needed for a naked C
> call, but that means the site will have push/pops around the indirect
> call.  This gives the patcher more space to work with if it wants to
> inline something; if it just wants to generate a call to C code, it must
> also generate its own register saves.
>   

Since there are so few of these sites, and they are performance 
critical, the placement of a BUG() here verifying the clobbers are ok 
effectively makes it the paravirt-op backend's responsibility to ensure 
that these sites get patched.  This is what would allow the removal of 
dependence on the paravirt_ops symbol for the most important interrupt 
control operations.

> It's semantically no different from updating the paravirt_ops structure
> followed by patching.  If the kernel comes up with all the sites
> prelinked to the native versions, then its the same as booting on the
> current kernel, with paravirt_ops initialized to the native versions.
>   

It's semantically the same, but the code needs to be re-usable later, 
which is where the problems arise - you can't simply cram the prelink 
code into head.S, but have to write it to be properly callable later on.

Zach

  reply	other threads:[~2007-04-23 21:54 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-20  1:53 [RFC, PATCH 5/5] Paravirt_ops export.patch Zachary Amsden
2007-04-20  5:10 ` Jeremy Fitzhardinge
2007-04-22 14:28   ` Eric W. Biederman
2007-04-22 16:20     ` Jeremy Fitzhardinge
2007-04-22 16:59     ` Zachary Amsden
2007-04-22 17:31       ` Jeremy Fitzhardinge
2007-04-23 20:53         ` Zachary Amsden
2007-04-23 21:14           ` Eric W. Biederman
2007-04-23 21:40             ` Zachary Amsden
2007-04-23 21:29           ` Jeremy Fitzhardinge
2007-04-23 21:54             ` Zachary Amsden [this message]
2007-04-23 22:15               ` Jeremy Fitzhardinge
2007-04-23 22:24                 ` Zachary Amsden
2007-04-23 22:29                   ` Andi Kleen
2007-04-22 23:57     ` Rusty Russell

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=462D2AF9.9010609@vmware.com \
    --to=zach@vmware.com \
    --cc=ak@muc.de \
    --cc=akpm@osdl.org \
    --cc=chrisw@sous-sol.org \
    --cc=ebiederm@xmission.com \
    --cc=jeremy@goop.org \
    --cc=mingo@elte.hu \
    --cc=petr@vmware.com \
    --cc=virtualization@lists.osdl.org \
    --cc=zamsden@gmail.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).