From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dor Laor Subject: Re: [PATCH 1/6] virtio interace Date: Sun, 23 Sep 2007 13:20:11 +0200 Message-ID: <46F64BEB.8040307@qumranet.com> References: <1190289808.7262.223.camel@localhost.localdomain> <200709211622.22005.arnd@arndb.de> <1190454934.27805.80.camel@localhost.localdomain> <200709221201.33865.arnd@arndb.de> <1190536431.27805.109.camel@localhost.localdomain> Reply-To: dor.laor-atKUWr5tajBWk0Htik3J/w@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1077774748==" Cc: kvm-devel , lguest , virtualization-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Rusty Russell Return-path: In-Reply-To: <1190536431.27805.109.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org This is a multi-part message in MIME format. --===============1077774748== Content-Type: multipart/alternative; boundary="------------090500040602090702090600" This is a multi-part message in MIME format. --------------090500040602090702090600 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Rusty Russell wrote: > On Sat, 2007-09-22 at 12:01 +0200, Arnd Bergmann wrote: > >> On Saturday 22 September 2007, Rusty Russell wrote: >> >>> But now each virtio device has two "struct device"s, not one. And >>> you've made up a fictional bus to do it. >>> >>> Yet for PCI systems, it really is a PCI device; exposing a second bus to >>> userspace just because we put a layer in our implementation is poor >>> form. >>> >>> Perhaps this is the easiest way of doing it. But it's still wrong. >>> >> I think it's just a matter of perspective. In the model I'm advocating, >> the PCI device is not the same as the virtio device but rather a virtio >> host bridge, very much like USB or SATA works. >> >> We could easily have multiple virtio devices behind one PCI device, but >> since virtual PCI devices are cheap, a one-to-one mapping makes sense >> for simplicity. >> > > This is still retro-justification. The simplest way for PCI systems to > represent a virtio device as a PCI device; this makes life easy for any > guest OS. > > I just know we're going to regret this... > Rusty. > > > I'm not sure what's best, maybe this can help: With the virtio_find_driver you need to place all virtio drivers under the same pci device or suggest new mapping. Using Arnd's solution (actually I implemented it for KVM before the new patch set) and 1-1 mapping for pci and virtio devices makes life simpler. Dor. --------------090500040602090702090600 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Rusty Russell wrote:
On Sat, 2007-09-22 at 12:01 +0200, Arnd Bergmann wrote:
  
On Saturday 22 September 2007, Rusty Russell wrote:
    
But now each virtio device has two "struct device"s, not one.   And
you've made up a fictional bus to do it.

Yet for PCI systems, it really is a PCI device; exposing a second bus to
userspace just because we put a layer in our implementation is poor
form.

Perhaps this is the easiest way of doing it.  But it's still wrong.
      
I think it's just a matter of perspective. In the model I'm advocating,
the PCI device is not the same as the virtio device but rather a virtio
host bridge, very much like USB or SATA works.

We could easily have multiple virtio devices behind one PCI device, but
since virtual PCI devices are cheap, a one-to-one mapping makes sense
for simplicity.
    

This is still retro-justification.  The simplest way for PCI systems to
represent a virtio device as a PCI device; this makes life easy for any
guest OS.

I just know we're going to regret this...
Rusty.


  
I'm not sure what's best, maybe this can help:
With the virtio_find_driver you need to place all virtio drivers under the same pci device or suggest new mapping.
Using Arnd's solution (actually I implemented it for KVM before the new patch set) and  1-1 mapping for pci and virtio
devices makes life simpler.
Dor.

--------------090500040602090702090600-- --===============1077774748== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ --===============1077774748== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ kvm-devel mailing list kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org https://lists.sourceforge.net/lists/listinfo/kvm-devel --===============1077774748==--