From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 4/4] KVM: x86: Enable MSI for assigned device Date: Sun, 05 Oct 2008 12:27:20 +0200 Message-ID: <48E89688.1010500@redhat.com> References: <> <1222406255-27727-5-git-send-email-sheng.yang@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, "" , "" To: Sheng Yang Return-path: Received: from mx2.redhat.com ([66.187.237.31]:36548 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752687AbYJEK10 (ORCPT ); Sun, 5 Oct 2008 06:27:26 -0400 In-Reply-To: <1222406255-27727-5-git-send-email-sheng.yang@intel.com> Sender: kvm-owner@vger.kernel.org List-ID: Sheng Yang wrote: > As well as export ioapic_get_delivery_bitmask(). > > @@ -132,8 +177,12 @@ static void kvm_assigned_dev_interrupt_work_handler(struct work_struct *work) > * finer-grained lock, update this > */ > mutex_lock(&assigned_dev->kvm->lock); > - kvm_set_irq(assigned_dev->kvm, > - assigned_dev->guest_irq, 1); > + if (assigned_dev->guest_intr_type == KVM_ASSIGNED_DEV_INTR) > + kvm_set_irq(assigned_dev->kvm, assigned_dev->guest_irq, 1); > + else if (assigned_dev->guest_intr_type == KVM_ASSIGNED_DEV_MSI) { > + assigned_device_msi_dispatch(assigned_dev); > + enable_irq(assigned_dev->host_irq); > + } > What happens if the host interrupt is level triggered pci and the guest interrupt is msi? Or do we not support this combination? If not, how do we prevent it? > diff --git a/include/linux/kvm.h b/include/linux/kvm.h > index 4269be1..a9b408b 100644 > --- a/include/linux/kvm.h > +++ b/include/linux/kvm.h > @@ -493,9 +493,13 @@ struct kvm_assigned_irq { > __u32 assigned_dev_id; > __u32 host_irq; > __u32 guest_irq; > + __u16 guest_msi_data; > Need padding here, just to be safe. > + __u32 guest_msi_addr; > Is u32 enough for the msi address? Including ia64? > __u32 flags; > }; > > diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h > index e24280b..dc6a046 100644 > --- a/include/linux/kvm_host.h > +++ b/include/linux/kvm_host.h > @@ -300,8 +300,11 @@ struct kvm_assigned_dev_kernel { > int host_busnr; > int host_devfn; > int host_irq; > + u16 guest_msi_addr; > u32? or even u64? -- error compiling committee.c: too many arguments to function