virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Liguori <aliguori@us.ibm.com>
To: Avi Kivity <avi@qumranet.com>
Cc: Eric Van Hensbergen <ericvanhensbergen@us.ibm.com>,
	lguest <lguest@ozlabs.org>,
	kvm-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org,
	virtualization@lists.osdl.org
Subject: Re: [kvm-devel] [PATCH 3/3] virtio PCI device
Date: Mon, 26 Nov 2007 13:18:11 -0600	[thread overview]
Message-ID: <474B1BF3.20901@us.ibm.com> (raw)
In-Reply-To: <4747122F.1070905@qumranet.com>

Avi Kivity wrote:
> rx and tx are closely related. You rarely have one without the other.
>
> In fact, a turned implementation should have zero kicks or interrupts 
> for bulk transfers. The rx interrupt on the host will process new tx 
> descriptors and fill the guest's rx queue; the guest's transmit 
> function can also check the receive queue. I don't know if that's 
> achievable for Linuz guests currently, but we should aim to make it 
> possible.

ATM, the net driver does a pretty good job of disabling kicks/interrupts 
unless they are needed.  Checking for rx on tx and vice versa is a good 
idea and could further help there.  I'll give it a try this week.

> Another point is that virtio still has a lot of leading zeros in its 
> mileage counter. We need to keep things flexible and learn from others 
> as much as possible, especially when talking about the ABI.

Yes, after thinking about it over holiday, I agree that we should at 
least introduce a virtio-pci feature bitmask.  I'm not inclined to 
attempt to define a hypercall ABI or anything like that right now but 
having the feature bitmask will at least make it possible to do such a 
thing in the future.

>> I'm wary of introducing the notion of hypercalls to this device 
>> because it makes the device VMM specific.  Maybe we could have the 
>> device provide an option ROM that was treated as the device "BIOS" 
>> that we could use for kicking and interrupt acking?  Any idea of how 
>> that would map to Windows?  Are there real PCI devices that use the 
>> option ROM space to provide what's essentially firmware?  
>> Unfortunately, I don't think an option ROM BIOS would map well to 
>> other architectures.
>>
>>   
>
> The BIOS wouldn't work even on x86 because it isn't mapped to the 
> guest address space (at least not consistently), and doesn't know the 
> guest's programming model (16, 32, or 64-bits? segmented or flat?)
>
> Xen uses a hypercall page to abstract these details out. However, I'm 
> not proposing that. Simply indicate that we support hypercalls, and 
> use some layer below to actually send them. It is the responsibility 
> of this layer to detect if hypercalls are present and how to call them.
>
> Hey, I think the best place for it is in paravirt_ops. We can even 
> patch the hypercall instruction inline, and the driver doesn't need to 
> know about it.

Yes, paravirt_ops is attractive for abstracting the hypercall calling 
mechanism but it's still necessary to figure out how hypercalls would be 
identified.  I think it would be necessary to define a virtio specific 
hypercall space and use the virtio device ID to claim subspaces.

For instance, the hypercall number could be (virtio_devid << 16) | (call 
number).  How that translates into a hypercall would then be part of the 
paravirt_ops abstraction.  In KVM, we may have a single virtio hypercall 
where we pass the virtio hypercall number as one of the arguments or 
something like that.

>>>>> Not much of an argument, I know.
>>>>>
>>>>>
>>>>> wrt. number of queues, 8 queues will consume 32 bytes of pci space 
>>>>> if all you store is the ring pfn.
>>>>>             
>>>> You also at least need a num argument which takes you to 48 or 64 
>>>> depending on whether you care about strange formatting.  8 queues 
>>>> may not be enough either.  Eric and I have discussed whether the 9p 
>>>> virtio device should support multiple mounts per-virtio device and 
>>>> if so, whether each one should have it's own queue.  Any devices 
>>>> that supports this sort of multiplexing will very quickly start 
>>>> using a lot of queues.
>>>>         
>>> Make it appear as a pci function?  (though my feeling is that 
>>> multiple mounts should be different devices; we can then hotplug 
>>> mountpoints).
>>>     
>>
>> We may run out of PCI slots though :-/
>>   
>
> Then we can start selling virtio extension chassis.

:-)  Do you know if there is a hard limit on the number of devices on a 
PCI bus?  My concern was that it was limited by something stupid like an 
8-bit identifier.

Regards,

Anthony Liguori

  reply	other threads:[~2007-11-26 19:18 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-08  2:46 [PATCH 0/3] virtio PCI driver Anthony Liguori
     [not found] ` <11944899922822-git-send-email-aliguori-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2007-11-08  2:46   ` [PATCH 1/3] Export vring functions for modules to use Anthony Liguori
     [not found]     ` <11944900141678-git-send-email-aliguori-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2007-11-08  2:46       ` [PATCH 2/3] Put the virtio under the virtualization menu Anthony Liguori
     [not found]         ` <11944900152750-git-send-email-aliguori-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2007-11-08  2:46           ` [PATCH 3/3] virtio PCI device Anthony Liguori
     [not found]             ` <11944900163817-git-send-email-aliguori-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2007-11-08  6:12               ` Avi Kivity
     [not found]                 ` <4732A8E5.6090307-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-11-08 13:54                   ` Anthony Liguori
     [not found]                     ` <47331531.8070709-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2007-11-08 14:37                       ` Avi Kivity
     [not found]                         ` <47331F47.70304-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-11-08 15:06                           ` Anthony Liguori
     [not found]                             ` <473325EB.5090907-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2007-11-08 15:13                               ` Avi Kivity
2007-11-08 23:43                       ` Dor Laor
2007-11-08 17:46               ` Arnd Bergmann
     [not found]                 ` <200711081846.36821.arnd-r2nGTMty4D4@public.gmane.org>
2007-11-08 19:04                   ` Anthony Liguori
     [not found]                     ` <47335DC6.7090603-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2007-11-09 11:03                       ` Arnd Bergmann
2007-11-09  0:39               ` Dor Laor
     [not found]                 ` <4733AC3A.20701-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-11-09  2:17                   ` Anthony Liguori
2007-11-20 15:01             ` [kvm-devel] " Avi Kivity
2007-11-20 15:43               ` Anthony Liguori
     [not found]                 ` <474300AD.4060509-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2007-11-20 16:12                   ` Avi Kivity
     [not found]                     ` <4743076F.8000105-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-11-20 22:16                       ` Anthony Liguori
     [not found]                         ` <47435CCB.1050506-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2007-11-21  7:13                           ` Avi Kivity
     [not found]                             ` <4743DAA4.70800-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-11-21 18:22                               ` Zachary Amsden
     [not found]                                 ` <1195669377.6352.247.camel-cxY/u30q8FloTgUnLF1by8fTvwmfpRNyZeezCHUQhQ4@public.gmane.org>
2007-11-22  7:32                                   ` Avi Kivity
2007-11-23 16:51                               ` [kvm-devel] " Anthony Liguori
     [not found]                                 ` <4747051C.3090903-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2007-11-23 17:47                                   ` Avi Kivity
2007-11-26 19:18                                     ` Anthony Liguori [this message]
     [not found]                                       ` <474B1BF3.20901-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2007-11-27  9:02                                         ` Avi Kivity
     [not found]                                           ` <474BDD28.7050801-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-11-27  9:09                                             ` Carsten Otte
     [not found]                                               ` <474BDEDE.6060603-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org>
2007-11-27  9:27                                                 ` [kvm-devel] " Avi Kivity
     [not found]                                                   ` <474BE319.502-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-11-27 10:12                                                     ` Carsten Otte
     [not found]                                                       ` <474BEDAB.3000305-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org>
2007-11-27 10:19                                                         ` Avi Kivity
     [not found]                                                           ` <474BEF28.9010005-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-11-27 10:28                                                             ` Carsten Otte
     [not found]                                                               ` <474BF157.3080709-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org>
2007-11-27 13:27                                                                 ` [kvm-devel] " Dor Laor
2007-11-27  9:25                                             ` Arnd Bergmann
2007-11-08  6:49           ` [PATCH 2/3] Put the virtio under the virtualization menu Avi Kivity

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=474B1BF3.20901@us.ibm.com \
    --to=aliguori@us.ibm.com \
    --cc=avi@qumranet.com \
    --cc=ericvanhensbergen@us.ibm.com \
    --cc=kvm-devel@lists.sourceforge.net \
    --cc=lguest@ozlabs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=virtualization@lists.osdl.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;
as well as URLs for NNTP newsgroup(s).