virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: Andi Kleen <ak@suse.de>
To: Zachary Amsden <zach@vmware.com>
Cc: Andi Kleen <ak@suse.de>, Andrew Morton <akpm@osdl.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Virtualization Mailing List <virtualization@lists.osdl.org>,
	Rusty Russell <rusty@rustcorp.com.au>,
	Chris Wright <chrisw@sous-sol.org>, Avi Kivity <avi@qumranet.com>,
	Jeremy Fitzhardinge <jeremy@goop.org>
Subject: Re: [PATCH] Add I/O hypercalls for i386 paravirt
Date: Thu, 23 Aug 2007 00:04:51 +0200	[thread overview]
Message-ID: <20070822220451.GJ8058@bingen.suse.de> (raw)
In-Reply-To: <46CC9FF2.3040406@vmware.com>

> No, you can't ignore it.  The page protections won't change between the 
> GP and the decoder execution, but the instruction can, causing you to 
> decode into the next page where the processor would not have.  !P 
> becomes obvious, but failure to respect NX or U/S is an exploitable 
> bug.  Put a 1 byte instruction at the end of a page crossing into a NX 
> (or supervisor page).  Remotely, change keep switching between the 
> instruction and a segment override.

Then you do this check only if the instruction crosses a page.
That is very cheap to test.

> Result: user executes instruction on supervisor code page, learning data 
> as a result of this; code on NX page gets executed.

Most systems probably have gaps between user and supervisor
(like Linux), but ok.

> We already have drivers for all of our hardware in Linux.  Most of the 
> hardware we emulate is physical hardware, and there are no virtual 
> drivers for it.  Should we take the BusLogic driver and "paravirtualize" 
> it by adding VMI hypercalls? 

You're proposing instead to paravirtualize all drivers, even if 99.99%
of those will never ever have a driver model.

> We might benefit from it, but would the 
> BusLogic driver?  It sets a nasty precedent for maintenance as different 
> hypervisors and emulators hack up different drivers for their own 
> performance.

I still think it's preferable to change some drivers than everybody.

AFAIK BusLogic as real hardware is pretty much dead anyways,
so you're probably the only primary user of it anyways.
Go wild on it!

If you worry about it do your own drivers like the other hypervisors.
I still suspect you could go faster if you use a paravirtualy
optimized driver, but and I'm not going to speculate on the 
reasons why you don't want to do that.


> Our SCSI and IDE emulation and thus the drivers used by Linux are pretty 
> much fixed in stone; we are not going to go about changing a tricky 
> hardware interface to a virtual one, it is simply too risky for 

You wouldn't need to change it; just add a very simple new one
(e.g. the lguest interface is nearly trivial) 

> There is great advantage in talking to our existing device layer faster, 
> and this is something that is valuable today.

Well that might be. I just think it would be a mistake
to design paravirt_ops based on someone's short term release engineering
considerations.

> 
> >Really LinuxHAL^wparavirt ops is already so complicated that
> >any new hooks need an extremly good justification and that is
> >just not here for this.
> >
> >We can add it if you find an equivalent number of hooks
> >to eliminate.
> >  
> 
> Interesting trade.  What if I sanitized the whole I/O messy macros into 
> something fun and friendly:

That would be a cool project anyways. e.g. just moving 
the NUMAQ support separately would clean it up. But probably not enough
on its own, sorry.

But you'll need separate interfaces anyways if you want to
go down the BusLogic change path. That could well be coupled
with a cleanup.

> We might even be able to get rid of the umpteen different 
> places where drivers wrap iospace access with their own byte / word / 
> long functions so they can switch between port I/O and memory mapped I/O 
> by moving it all into common infrastructure.

I thought we had that already?  But can't find it now :/

> 
> We could make similar (unwelcome?) advances on the pte functions if it 
> were not for the regrettable disconnect between pte_high / pte_low and 
> the rest.  Perhaps if it was hidden in macros?

You want to do what exactly? 

If you mean PAE and non PAE In the same binary: that would likely
need abstracted page tables first.

-Andi

  reply	other threads:[~2007-08-22 22:04 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-22  5:23 [PATCH] Add I/O hypercalls for i386 paravirt Zachary Amsden
2007-08-22  5:34 ` Avi Kivity
2007-08-22  5:40   ` Zachary Amsden
2007-08-22  8:37     ` Avi Kivity
2007-08-22 16:16       ` Zachary Amsden
2007-08-22  6:25   ` Rusty Russell
2007-08-22 10:35     ` Andi Kleen
2007-08-22  9:51       ` Avi Kivity
2007-08-22 11:08         ` Andi Kleen
2007-08-22 10:23           ` Avi Kivity
2007-08-22 11:23             ` Andi Kleen
2007-08-22 12:09               ` Avi Kivity
2007-08-22 13:15                 ` Andi Kleen
2007-08-22 12:32                   ` Avi Kivity
2007-08-22 16:11             ` Jeff Garzik
     [not found]     ` <1188237281.5972.69.camel@localhost.localdomain>
     [not found]       ` <46D3C60B.3050605@vmware.com>
2007-08-28 11:18         ` Benjamin Herrenschmidt
2007-08-22  6:00 ` H. Peter Anvin
2007-08-22  6:03   ` Zachary Amsden
2007-08-24 12:20     ` Pavel Machek
2007-08-22 10:22 ` Andi Kleen
2007-08-22 16:48   ` Zachary Amsden
2007-08-22 17:59     ` Andi Kleen
2007-08-22 17:07       ` Zachary Amsden
2007-08-22 19:46         ` Andi Kleen
2007-08-22 20:43           ` Zachary Amsden
2007-08-22 22:04             ` Andi Kleen [this message]
2007-08-22 21:25               ` Alan Cox
2007-08-22 21:41                 ` Zachary Amsden
2007-08-23  5:34                 ` Rusty Russell
2007-08-22 21:45               ` Zachary Amsden
2007-08-22 17:34       ` Alan Cox
2007-08-22 21:54 ` Jeremy Fitzhardinge
2007-08-22 22:15   ` James Courtier-Dutton
2007-08-22 22:20     ` Chris Wright
2007-08-22 22:29       ` James Courtier-Dutton
2007-08-22 22:34         ` Chris Wright
2007-08-22 23:14         ` Jeremy Fitzhardinge
2007-08-23  0:47           ` Andi Kleen
2007-08-23  0:38             ` Jeremy Fitzhardinge
2007-08-23  2:34               ` Andi Kleen

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=20070822220451.GJ8058@bingen.suse.de \
    --to=ak@suse.de \
    --cc=akpm@osdl.org \
    --cc=avi@qumranet.com \
    --cc=chrisw@sous-sol.org \
    --cc=jeremy@goop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    --cc=virtualization@lists.osdl.org \
    --cc=zach@vmware.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).