[PATCH 0/8][v2] MSI-X mask emulation support for assigned device

2010-10-20 Thread Sheng Yang
Here is v2. Changelog: v1->v2 The major change from v1 is I've added the in-kernel MSI-X mask emulation support, as well as adding shortcuts for reading MSI-X table. I've taken Michael's advice to use mask/unmask directly, but unsure about exporting irq_to_desc() for module... Also add flush_w

Re: [PATCH 0/8][v2] MSI-X mask emulation support for assigned device

2010-10-20 Thread Avi Kivity
On 10/20/2010 10:26 AM, Sheng Yang wrote: Here is v2. Changelog: v1->v2 The major change from v1 is I've added the in-kernel MSI-X mask emulation support, as well as adding shortcuts for reading MSI-X table. I've taken Michael's advice to use mask/unmask directly, but unsure about exporting

Re: [PATCH 0/8][v2] MSI-X mask emulation support for assigned device

2010-10-20 Thread Michael S. Tsirkin
On Wed, Oct 20, 2010 at 11:51:01AM +0200, Avi Kivity wrote: > On 10/20/2010 10:26 AM, Sheng Yang wrote: > >Here is v2. > > > >Changelog: > > > >v1->v2 > > > >The major change from v1 is I've added the in-kernel MSI-X mask emulation > >support, as well as adding shortcuts for reading MSI-X table. >

Re: [PATCH 0/8][v2] MSI-X mask emulation support for assigned device

2010-10-20 Thread Avi Kivity
On 10/20/2010 12:44 PM, Michael S. Tsirkin wrote: > > Any performance numbers? What are the affected guests? just RHEL > 4, or any others? Likely any old linux. I meant that people are likely to virtualize and expect high performance from. What about RHEL 3? Does it support msi? How

Re: [PATCH 0/8][v2] MSI-X mask emulation support for assigned device

2010-10-20 Thread Michael S. Tsirkin
On Wed, Oct 20, 2010 at 12:59:42PM +0200, Avi Kivity wrote: > On 10/20/2010 12:44 PM, Michael S. Tsirkin wrote: > >> > >> Any performance numbers? What are the affected guests? just RHEL > >> 4, or any others? > > > >Likely any old linux. > > I meant that people are likely to virtualize and e

Re: [PATCH 0/8][v2] MSI-X mask emulation support for assigned device

2010-10-20 Thread Alex Williamson
On Wed, 2010-10-20 at 12:44 +0200, Michael S. Tsirkin wrote: > On Wed, Oct 20, 2010 at 11:51:01AM +0200, Avi Kivity wrote: > > On 10/20/2010 10:26 AM, Sheng Yang wrote: > > >Here is v2. > > > > > >Changelog: > > > > > >v1->v2 > > > > > >The major change from v1 is I've added the in-kernel MSI-X ma

Re: [PATCH 0/8][v2] MSI-X mask emulation support for assigned device

2010-10-20 Thread Michael S. Tsirkin
On Wed, Oct 20, 2010 at 08:47:14AM -0600, Alex Williamson wrote: > On Wed, 2010-10-20 at 12:44 +0200, Michael S. Tsirkin wrote: > > On Wed, Oct 20, 2010 at 11:51:01AM +0200, Avi Kivity wrote: > > > On 10/20/2010 10:26 AM, Sheng Yang wrote: > > > >Here is v2. > > > > > > > >Changelog: > > > > > > >

Re: [PATCH 0/8][v2] MSI-X mask emulation support for assigned device

2010-10-20 Thread Alex Williamson
On Wed, 2010-10-20 at 15:43 +0200, Michael S. Tsirkin wrote: > On Wed, Oct 20, 2010 at 12:59:42PM +0200, Avi Kivity wrote: > > How far away is vfio? If it's merged soon, we might avoid making > > changes to the old assigned device infrastructure and instead update > > vfio. > > Hard to be sure, h

Re: [PATCH 0/8][v2] MSI-X mask emulation support for assigned device

2010-10-20 Thread Michael S. Tsirkin
On Wed, Oct 20, 2010 at 08:58:38AM -0600, Alex Williamson wrote: > On Wed, 2010-10-20 at 15:43 +0200, Michael S. Tsirkin wrote: > > On Wed, Oct 20, 2010 at 12:59:42PM +0200, Avi Kivity wrote: > > > How far away is vfio? If it's merged soon, we might avoid making > > > changes to the old assigned d

Re: [PATCH 0/8][v2] MSI-X mask emulation support for assigned device

2010-10-20 Thread Alex Williamson
On Wed, 2010-10-20 at 16:46 +0200, Michael S. Tsirkin wrote: > On Wed, Oct 20, 2010 at 08:47:14AM -0600, Alex Williamson wrote: > > On Wed, 2010-10-20 at 12:44 +0200, Michael S. Tsirkin wrote: > > > On Wed, Oct 20, 2010 at 11:51:01AM +0200, Avi Kivity wrote: > > > > On 10/20/2010 10:26 AM, Sheng Y

Re: [PATCH 0/8][v2] MSI-X mask emulation support for assigned device

2010-10-20 Thread Alex Williamson
On Wed, 2010-10-20 at 16:58 +0200, Michael S. Tsirkin wrote: > On Wed, Oct 20, 2010 at 08:58:38AM -0600, Alex Williamson wrote: > > On Wed, 2010-10-20 at 15:43 +0200, Michael S. Tsirkin wrote: > > > On Wed, Oct 20, 2010 at 12:59:42PM +0200, Avi Kivity wrote: > > > > How far away is vfio? If it's m

Re: [PATCH 0/8][v2] MSI-X mask emulation support for assigned device

2010-10-20 Thread Avi Kivity
On 10/20/2010 03:43 PM, Michael S. Tsirkin wrote: > >If instead of eventfd we had a file descriptor that can pass vector > >information from vfio to kvm and back, that would fix it, > >as we would not need to set us GSIs at all, > >and not need for userspace to handle MSIX specially. > > >

Re: [PATCH 0/8][v2] MSI-X mask emulation support for assigned device

2010-10-20 Thread Michael S. Tsirkin
On Wed, Oct 20, 2010 at 09:07:12AM -0600, Alex Williamson wrote: > On Wed, 2010-10-20 at 16:46 +0200, Michael S. Tsirkin wrote: > > On Wed, Oct 20, 2010 at 08:47:14AM -0600, Alex Williamson wrote: > > > On Wed, 2010-10-20 at 12:44 +0200, Michael S. Tsirkin wrote: > > > > On Wed, Oct 20, 2010 at 11:

Re: [PATCH 0/8][v2] MSI-X mask emulation support for assigned device

2010-10-20 Thread Alex Williamson
On Wed, 2010-10-20 at 17:17 +0200, Avi Kivity wrote: > On 10/20/2010 03:43 PM, Michael S. Tsirkin wrote: > > > >If instead of eventfd we had a file descriptor that can pass vector > > > >information from vfio to kvm and back, that would fix it, > > > >as we would not need to set us GSIs at all,

Re: [PATCH 0/8][v2] MSI-X mask emulation support for assigned device

2010-10-20 Thread Avi Kivity
On 10/20/2010 04:47 PM, Alex Williamson wrote: > > With current VFIO we would catch mask writes in qemu and > call a KVM ioctl. We would also need an ioctl to retrieve > pending bits long term. Ugh, no. VFIO us currently independent of KVM. I'd like to keep it that way. Me, too. Perhaps

Re: [PATCH 0/8][v2] MSI-X mask emulation support for assigned device

2010-10-20 Thread Avi Kivity
On 10/20/2010 05:22 PM, Alex Williamson wrote: On Wed, 2010-10-20 at 17:17 +0200, Avi Kivity wrote: > On 10/20/2010 03:43 PM, Michael S. Tsirkin wrote: > > > >If instead of eventfd we had a file descriptor that can pass vector > > > >information from vfio to kvm and back, that would fix

Re: [PATCH 0/8][v2] MSI-X mask emulation support for assigned device

2010-10-20 Thread Alex Williamson
On Wed, 2010-10-20 at 17:26 +0200, Avi Kivity wrote: > On 10/20/2010 05:22 PM, Alex Williamson wrote: > > On Wed, 2010-10-20 at 17:17 +0200, Avi Kivity wrote: > > > On 10/20/2010 03:43 PM, Michael S. Tsirkin wrote: > > > > > >If instead of eventfd we had a file descriptor that can pass > > >

Re: [PATCH 0/8][v2] MSI-X mask emulation support for assigned device

2010-10-20 Thread Alex Williamson
On Wed, 2010-10-20 at 17:23 +0200, Avi Kivity wrote: > On 10/20/2010 04:47 PM, Alex Williamson wrote: > > > > > > With current VFIO we would catch mask writes in qemu and > > > call a KVM ioctl. We would also need an ioctl to retrieve > > > pending bits long term. > > > > Ugh, no. VFIO us curre

Re: [PATCH 0/8][v2] MSI-X mask emulation support for assigned device

2010-10-20 Thread Avi Kivity
On 10/20/2010 05:38 PM, Alex Williamson wrote: > > We'll need to optimize interrupt injection and eoi via KVM, > > but it should only be a performance optimization, not a functional > > requirement. > > For level-triggered interrupts only, yes? MSI EOI does not involve any > device or i

Re: [PATCH 0/8][v2] MSI-X mask emulation support for assigned device

2010-10-20 Thread Michael S. Tsirkin
On Wed, Oct 20, 2010 at 05:54:20PM +0200, Avi Kivity wrote: > On 10/20/2010 05:38 PM, Alex Williamson wrote: > >> > We'll need to optimize interrupt injection and eoi via KVM, > >> > but it should only be a performance optimization, not a functional > >> > requirement. > >> > >> For level-t

Re: [PATCH 0/8][v2] MSI-X mask emulation support for assigned device

2010-10-20 Thread Avi Kivity
On 10/20/2010 05:59 PM, Michael S. Tsirkin wrote: > > One ugly way is to use two eventfds, one counting mask events, one > counting unmask events. The difference is the value if the masked > bit. > > Another option is to use > http://permalink.gmane.org/gmane.linux.kernel.commits.head/1880

Re: [PATCH 0/8][v2] MSI-X mask emulation support for assigned device

2010-10-20 Thread Michael S. Tsirkin
On Wed, Oct 20, 2010 at 06:13:53PM +0200, Avi Kivity wrote: > On 10/20/2010 05:59 PM, Michael S. Tsirkin wrote: > >> > >> One ugly way is to use two eventfds, one counting mask events, one > >> counting unmask events. The difference is the value if the masked > >> bit. > >> > >> Another optio

Re: [PATCH 0/8][v2] MSI-X mask emulation support for assigned device

2010-10-20 Thread Alex Williamson
On Wed, 2010-10-20 at 17:59 +0200, Michael S. Tsirkin wrote: > On Wed, Oct 20, 2010 at 05:54:20PM +0200, Avi Kivity wrote: > > On 10/20/2010 05:38 PM, Alex Williamson wrote: > > >> > We'll need to optimize interrupt injection and eoi via KVM, > > >> > but it should only be a performance optimi

Re: [PATCH 0/8][v2] MSI-X mask emulation support for assigned device

2010-10-20 Thread Marcelo Tosatti
On Wed, Oct 20, 2010 at 04:26:24PM +0800, Sheng Yang wrote: > Here is v2. > > Changelog: > > v1->v2 > > The major change from v1 is I've added the in-kernel MSI-X mask emulation > support, as well as adding shortcuts for reading MSI-X table. > > I've taken Michael's advice to use mask/unmask di

Re: [PATCH 0/8][v2] MSI-X mask emulation support for assigned device

2010-10-20 Thread Alex Williamson
On Wed, 2010-10-20 at 17:13 +0200, Michael S. Tsirkin wrote: > On Wed, Oct 20, 2010 at 09:07:12AM -0600, Alex Williamson wrote: > > On Wed, 2010-10-20 at 16:46 +0200, Michael S. Tsirkin wrote: > > > On Wed, Oct 20, 2010 at 08:47:14AM -0600, Alex Williamson wrote: > > > > It would probably make sens

Re: [PATCH 0/8][v2] MSI-X mask emulation support for assigned device

2010-10-20 Thread Michael S. Tsirkin
On Wed, Oct 20, 2010 at 02:13:01PM -0600, Alex Williamson wrote: > On Wed, 2010-10-20 at 17:13 +0200, Michael S. Tsirkin wrote: > > On Wed, Oct 20, 2010 at 09:07:12AM -0600, Alex Williamson wrote: > > > On Wed, 2010-10-20 at 16:46 +0200, Michael S. Tsirkin wrote: > > > > On Wed, Oct 20, 2010 at 08:

Re: [PATCH 0/8][v2] MSI-X mask emulation support for assigned device

2010-10-20 Thread Michael S. Tsirkin
On Wed, Oct 20, 2010 at 04:26:24PM +0800, Sheng Yang wrote: > Here is v2. > > Changelog: > > v1->v2 > > The major change from v1 is I've added the in-kernel MSI-X mask emulation > support, as well as adding shortcuts for reading MSI-X table. The major thing everyone here is asking is whether th

Re: [PATCH 0/8][v2] MSI-X mask emulation support for assigned device

2010-10-21 Thread Sheng Yang
On Thursday 21 October 2010 03:02:24 Marcelo Tosatti wrote: > On Wed, Oct 20, 2010 at 04:26:24PM +0800, Sheng Yang wrote: > > Here is v2. > > > > Changelog: > > > > v1->v2 > > > > The major change from v1 is I've added the in-kernel MSI-X mask emulation > > support, as well as adding shortcuts f

Re: [PATCH 0/8][v2] MSI-X mask emulation support for assigned device

2010-10-21 Thread Sheng Yang
On Wednesday 20 October 2010 17:51:01 Avi Kivity wrote: > On 10/20/2010 10:26 AM, Sheng Yang wrote: > > Here is v2. > > > > Changelog: > > > > v1->v2 > > > > The major change from v1 is I've added the in-kernel MSI-X mask emulation > > support, as well as adding shortcuts for reading MSI-X tab

Re: [PATCH 0/8][v2] MSI-X mask emulation support for assigned device

2010-10-21 Thread Michael S. Tsirkin
On Thu, Oct 21, 2010 at 03:10:19PM +0800, Sheng Yang wrote: > On Thursday 21 October 2010 03:02:24 Marcelo Tosatti wrote: > > On Wed, Oct 20, 2010 at 04:26:24PM +0800, Sheng Yang wrote: > > > Here is v2. > > > > > > Changelog: > > > > > > v1->v2 > > > > > > The major change from v1 is I've added