Re: [PATCH] KVM: Allow host IRQ sharing for assigned PCI 2.3 devices

2012-01-11 Thread Michael S. Tsirkin
On Tue, Jan 10, 2012 at 04:41:50PM -0700, Alex Williamson wrote: > > The guest driver will never see such an interrupt as we will notice on > > its arrival that there is some mask pending. > > Right, I was thinking more about the affect at the hardware level. In theory a broken device might assum

Re: [PATCH] KVM: Allow host IRQ sharing for assigned PCI 2.3 devices

2012-01-10 Thread Alex Williamson
On Tue, 2012-01-10 at 14:47 +0100, Jan Kiszka wrote: > On 2012-01-09 23:05, Alex Williamson wrote: > > On Mon, 2012-01-09 at 22:25 +0100, Jan Kiszka wrote: > >> On 2012-01-09 20:45, Alex Williamson wrote: > >>> On Mon, 2012-01-09 at 15:03 +0100, Jan Kiszka wrote: > +static int kvm_vm_ioctl_set

Re: [PATCH] KVM: Allow host IRQ sharing for assigned PCI 2.3 devices

2012-01-10 Thread Michael S. Tsirkin
On Tue, Jan 10, 2012 at 10:18:12PM +0100, Jan Kiszka wrote: > On 2012-01-10 21:44, Michael S. Tsirkin wrote: > > On Tue, Jan 10, 2012 at 08:40:59PM +0100, Jan Kiszka wrote: > >> On 2012-01-10 20:04, Michael S. Tsirkin wrote: > > But IMO this > > shows it is a more generic interface. >

Re: [PATCH] KVM: Allow host IRQ sharing for assigned PCI 2.3 devices

2012-01-10 Thread Jan Kiszka
On 2012-01-10 21:44, Michael S. Tsirkin wrote: > On Tue, Jan 10, 2012 at 08:40:59PM +0100, Jan Kiszka wrote: >> On 2012-01-10 20:04, Michael S. Tsirkin wrote: > But IMO this > shows it is a more generic interface. I'm worried about adding something new that will soon become obsol

Re: [PATCH] KVM: Allow host IRQ sharing for assigned PCI 2.3 devices

2012-01-10 Thread Michael S. Tsirkin
On Tue, Jan 10, 2012 at 08:40:59PM +0100, Jan Kiszka wrote: > On 2012-01-10 20:04, Michael S. Tsirkin wrote: > >>> But IMO this > >>> shows it is a more generic interface. > >> > >> I'm worried about adding something new that will soon become obsolete > >> again. That's wasted effort IMHO unless w

Re: [PATCH] KVM: Allow host IRQ sharing for assigned PCI 2.3 devices

2012-01-10 Thread Jan Kiszka
On 2012-01-10 20:04, Michael S. Tsirkin wrote: >>> But IMO this >>> shows it is a more generic interface. >> >> I'm worried about adding something new that will soon become obsolete >> again. That's wasted effort IMHO unless we say today that there will be >> no in-kernel MSI-X support. >> >> Jan

Re: [PATCH] KVM: Allow host IRQ sharing for assigned PCI 2.3 devices

2012-01-10 Thread Michael S. Tsirkin
On Tue, Jan 10, 2012 at 07:43:36PM +0100, Jan Kiszka wrote: > On 2012-01-10 19:31, Michael S. Tsirkin wrote: > > On Tue, Jan 10, 2012 at 07:21:01PM +0100, Jan Kiszka wrote: > >>> ATM writes to msi/msix mask bit have no effect for assigned > >>> devices. For virtio, they are implemented by deassigni

Re: [PATCH] KVM: Allow host IRQ sharing for assigned PCI 2.3 devices

2012-01-10 Thread Jan Kiszka
On 2012-01-10 19:31, Michael S. Tsirkin wrote: > On Tue, Jan 10, 2012 at 07:21:01PM +0100, Jan Kiszka wrote: >>> ATM writes to msi/msix mask bit have no effect for assigned >>> devices. For virtio, they are implemented by deassigning irqfd >>> which is a very slow operation (rcu write side). >>> >>

Re: [PATCH] KVM: Allow host IRQ sharing for assigned PCI 2.3 devices

2012-01-10 Thread Michael S. Tsirkin
On Tue, Jan 10, 2012 at 07:21:01PM +0100, Jan Kiszka wrote: > > ATM writes to msi/msix mask bit have no effect for assigned > > devices. For virtio, they are implemented by deassigning irqfd > > which is a very slow operation (rcu write side). > > > > Instead, When guest writes to mask, qemu can s

Re: [PATCH] KVM: Allow host IRQ sharing for assigned PCI 2.3 devices

2012-01-10 Thread Jan Kiszka
On 2012-01-10 19:10, Michael S. Tsirkin wrote: > On Tue, Jan 10, 2012 at 06:29:51PM +0100, Jan Kiszka wrote: >> On 2012-01-10 17:17, Michael S. Tsirkin wrote: >>> On Mon, Jan 09, 2012 at 03:03:00PM +0100, Jan Kiszka wrote: PCI 2.3 allows to generically disable IRQ sources at device level. This

Re: [PATCH] KVM: Allow host IRQ sharing for assigned PCI 2.3 devices

2012-01-10 Thread Michael S. Tsirkin
On Tue, Jan 10, 2012 at 06:29:51PM +0100, Jan Kiszka wrote: > On 2012-01-10 17:17, Michael S. Tsirkin wrote: > > On Mon, Jan 09, 2012 at 03:03:00PM +0100, Jan Kiszka wrote: > >> PCI 2.3 allows to generically disable IRQ sources at device level. This > >> enables us to share legacy IRQs of such devi

Re: [PATCH] KVM: Allow host IRQ sharing for assigned PCI 2.3 devices

2012-01-10 Thread Jan Kiszka
On 2012-01-10 17:17, Michael S. Tsirkin wrote: > On Mon, Jan 09, 2012 at 03:03:00PM +0100, Jan Kiszka wrote: >> PCI 2.3 allows to generically disable IRQ sources at device level. This >> enables us to share legacy IRQs of such devices with other host devices >> when passing them to a guest. >> >> T

Re: [PATCH] KVM: Allow host IRQ sharing for assigned PCI 2.3 devices

2012-01-10 Thread Michael S. Tsirkin
On Mon, Jan 09, 2012 at 03:03:00PM +0100, Jan Kiszka wrote: > PCI 2.3 allows to generically disable IRQ sources at device level. This > enables us to share legacy IRQs of such devices with other host devices > when passing them to a guest. > > The new IRQ sharing feature introduced here is optiona

Re: [PATCH] KVM: Allow host IRQ sharing for assigned PCI 2.3 devices

2012-01-10 Thread Jan Kiszka
On 2012-01-09 23:05, Alex Williamson wrote: > On Mon, 2012-01-09 at 22:25 +0100, Jan Kiszka wrote: >> On 2012-01-09 20:45, Alex Williamson wrote: >>> On Mon, 2012-01-09 at 15:03 +0100, Jan Kiszka wrote: +static int kvm_vm_ioctl_set_pci_irq_mask(struct kvm *kvm, + struct kvm_assig

Re: [PATCH] KVM: Allow host IRQ sharing for assigned PCI 2.3 devices

2012-01-09 Thread Jan Kiszka
On 2012-01-09 23:05, Alex Williamson wrote: > On Mon, 2012-01-09 at 22:25 +0100, Jan Kiszka wrote: >> On 2012-01-09 20:45, Alex Williamson wrote: >>> On Mon, 2012-01-09 at 15:03 +0100, Jan Kiszka wrote: +static int kvm_vm_ioctl_set_pci_irq_mask(struct kvm *kvm, + struct kvm_assig

Re: [PATCH] KVM: Allow host IRQ sharing for assigned PCI 2.3 devices

2012-01-09 Thread Alex Williamson
On Mon, 2012-01-09 at 22:25 +0100, Jan Kiszka wrote: > On 2012-01-09 20:45, Alex Williamson wrote: > > On Mon, 2012-01-09 at 15:03 +0100, Jan Kiszka wrote: > >> +static int kvm_vm_ioctl_set_pci_irq_mask(struct kvm *kvm, > >> + struct kvm_assigned_pci_dev *assigned_dev) > >> +{ > >> + int

Re: [PATCH] KVM: Allow host IRQ sharing for assigned PCI 2.3 devices

2012-01-09 Thread Jan Kiszka
On 2012-01-09 20:45, Alex Williamson wrote: > On Mon, 2012-01-09 at 15:03 +0100, Jan Kiszka wrote: >> PCI 2.3 allows to generically disable IRQ sources at device level. This >> enables us to share legacy IRQs of such devices with other host devices >> when passing them to a guest. >> >> The new IRQ

Re: [PATCH] KVM: Allow host IRQ sharing for assigned PCI 2.3 devices

2012-01-09 Thread Alex Williamson
On Mon, 2012-01-09 at 15:03 +0100, Jan Kiszka wrote: > PCI 2.3 allows to generically disable IRQ sources at device level. This > enables us to share legacy IRQs of such devices with other host devices > when passing them to a guest. > > The new IRQ sharing feature introduced here is optional, user

[PATCH] KVM: Allow host IRQ sharing for assigned PCI 2.3 devices

2012-01-09 Thread Jan Kiszka
PCI 2.3 allows to generically disable IRQ sources at device level. This enables us to share legacy IRQs of such devices with other host devices when passing them to a guest. The new IRQ sharing feature introduced here is optional, user space has to request it explicitly. Moreover, user space can i