From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 1/3] KVM: Ioctls for init MSI-X entry Date: Wed, 11 Feb 2009 14:44:57 +0200 Message-ID: <4992C849.9020103@redhat.com> References: <1234339731-3195-1-git-send-email-sheng@linux.intel.com> <1234339731-3195-2-git-send-email-sheng@linux.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]:44746 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755533AbZBKMpD (ORCPT ); Wed, 11 Feb 2009 07:45:03 -0500 In-Reply-To: <1234339731-3195-2-git-send-email-sheng@linux.intel.com> Sender: kvm-owner@vger.kernel.org List-ID: Sheng Yang wrote: > Introduce KVM_SET_MSIX_NR and KVM_SET_MSIX_ENTRY two ioctls. > > This two ioctls are used by userspace to specific guest device MSI-X entry > number and correlate MSI-X entry with GSI during the initialization stage. > > MSI-X should be well initialzed before enabling. > > Don't support change MSI-X entry number for now. > > Signed-off-by: Sheng Yang > --- > include/linux/kvm.h | 14 +++++++ > include/linux/kvm_host.h | 3 + > virt/kvm/kvm_main.c | 96 ++++++++++++++++++++++++++++++++++++++++++++++ > 3 files changed, 113 insertions(+), 0 deletions(-) > > diff --git a/include/linux/kvm.h b/include/linux/kvm.h > index c1425ab..5200768 100644 > --- a/include/linux/kvm.h > +++ b/include/linux/kvm.h > @@ -474,6 +474,8 @@ struct kvm_irq_routing { > #define KVM_ASSIGN_IRQ _IOR(KVMIO, 0x70, \ > struct kvm_assigned_irq) > #define KVM_REINJECT_CONTROL _IO(KVMIO, 0x71) > +#define KVM_SET_MSIX_NR _IOR(KVMIO, 0x72, struct kvm_assigned_msix_nr) > +#define KVM_SET_MSIX_ENTRY _IOR(KVMIO, 0x73, struct kvm_assigned_msix_entry) > > /* > * ioctls for vcpu fds > @@ -594,4 +596,16 @@ struct kvm_assigned_irq { > #define KVM_DEV_IRQ_ASSIGN_MSI_ACTION KVM_DEV_IRQ_ASSIGN_ENABLE_MSI > #define KVM_DEV_IRQ_ASSIGN_ENABLE_MSI (1 << 0) > > +struct kvm_assigned_msix_nr { > + __u32 assigned_dev_id; > + __u16 entry_nr; > +}; > + > +struct kvm_assigned_msix_entry { > + __u32 assigned_dev_id; > + __u32 gsi; > + __u16 entry; > + __u16 pos; > +} I'm guessing the intent here is "msi-x number 'pos' on the host assigned device will be injected to the guest as gsi 'gsi'"? What's the meaning of 'entry' and 'pos'? Both structures need better padding and some documentation. -- error compiling committee.c: too many arguments to function