All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony Liguori <aliguori-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
To: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: [RFC] virtio-blk PCI backend
Date: Thu, 08 Nov 2007 10:22:17 -0600	[thread overview]
Message-ID: <473337B9.8040503@us.ibm.com> (raw)
In-Reply-To: <473328EC.4090905-atKUWr5tajBWk0Htik3J/w@public.gmane.org>

Avi Kivity wrote:
>> There's no reason that the PIO operations couldn't be handled in the 
>> kernel.  You'll already need some level of cooperation in userspace 
>> unless you plan on implementing the PCI bus in kernel space too.  
>> It's easy enough in the pci_map function in QEMU to just notify the 
>> kernel that it should listen on a particular PIO range.
>>
>>   
>
> This is a config space write, right?  If so, the range is the regular 
> 0xcf8-0xcff and it has to be very specially handled.

This is a per-device IO slot and as best as I can tell, the PCI device 
advertises the size of the region and the OS then identifies a range of 
PIO space to use and tells the PCI device about it.  So we would just 
need to implement a generic userspace virtio PCI device in QEMU that did 
an ioctl to the kernel when this happened to tell the kernel what region 
to listen on for a particular device.

>> vmcalls will certainly get faster but I doubt that the cost 
>> difference between vmcall and pio will ever be greater than a few 
>> hundred cycles.  The only performance sensitive operation here would 
>> be the kick and I don't think a few hundred cycles in the kick path 
>> is ever going to be that significant for overall performance.
>>
>>   
>
> Why do you think the different will be a few hundred cycles?

The only difference in hardware between a PIO exit and a vmcall is that 
you don't have write out an exit reason in the VMC[SB].  So the 
performance difference between PIO/vmcall shouldn't be that great (and 
if it were, the difference would probably be obvious today).  That's 
different from, say, a PF exit because with a PF, you also have to 
attempt to resolve it by walking the guest page table before determining 
that you do in fact need to exit.

>   And if you have a large number of devices, searching the list 
> becomes expensive too.

The PIO address space is relatively small.  You could do a radix tree or 
even a direct array lookup if you are concerned about performance.

>> So why introduce the extra complexity?
>>   
>
> Overall I think it reduces comlexity if we have in-kernel devices.  
> Anyway we can add additional signalling methods later.

In-kernel virtio backends add quite a lot of complexity.  Just the 
mechanism to setup the device is complicated enough.  I suspect that 
it'll be necessary down the road for performance but I certainly don't 
think it's a simplification.

Regards,

Anthony Liguori


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/

  parent reply	other threads:[~2007-11-08 16:22 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-08  2:51 [RFC] virtio-blk PCI backend Anthony Liguori
     [not found] ` <11944902733951-git-send-email-aliguori-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2007-11-08  6:24   ` Avi Kivity
     [not found]     ` <4732ABA0.5090603-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-11-08 13:57       ` Anthony Liguori
     [not found]         ` <473315DB.9030803-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2007-11-08 14:02           ` Avi Kivity
     [not found]             ` <4733170B.70206-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-11-08 15:09               ` Anthony Liguori
     [not found]                 ` <473326B4.2080307-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2007-11-08 15:19                   ` Avi Kivity
     [not found]                     ` <473328EC.4090905-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-11-08 16:22                       ` Anthony Liguori [this message]
     [not found]                         ` <473337B9.8040503-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2007-11-09  0:13                           ` Dor Laor
     [not found]                             ` <4733A635.1080004-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-11-20  8:39                               ` Christian Borntraeger
     [not found]                                 ` <200711200939.19410.borntraeger-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org>
2007-11-20 10:00                                   ` Avi Kivity
     [not found]                                     ` <4742B053.8080301-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-11-20 10:17                                       ` Arnd Bergmann
     [not found]                                         ` <200711201117.17900.arnd-r2nGTMty4D4@public.gmane.org>
2007-11-20 11:05                                           ` Carsten Otte
2007-11-11  9:23                           ` Avi Kivity
2007-11-08 15:31                   ` Avi Kivity
     [not found]                     ` <47332BB7.2000900-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-11-08 19:02                       ` Anthony Liguori
2007-11-09  0:25   ` Dor Laor
     [not found]     ` <4733A917.5000303-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-11-09  1:38       ` Anthony Liguori

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=473337B9.8040503@us.ibm.com \
    --to=aliguori-r/jw6+rmf7hqt0dzr+alfa@public.gmane.org \
    --cc=avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org \
    --cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.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.