From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 8/8] KVM: Emulation MSI-X mask bits for assigned devices Date: Wed, 20 Oct 2010 11:49:46 +0200 Message-ID: <4CBEBB3A.90908@redhat.com> References: <1287563192-29685-1-git-send-email-sheng@linux.intel.com> <1287563192-29685-9-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: Marcelo Tosatti , kvm@vger.kernel.org, "Michael S. Tsirkin" To: Sheng Yang Return-path: Received: from mx1.redhat.com ([209.132.183.28]:12417 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751395Ab0JTJtu (ORCPT ); Wed, 20 Oct 2010 05:49:50 -0400 In-Reply-To: <1287563192-29685-9-git-send-email-sheng@linux.intel.com> Sender: kvm-owner@vger.kernel.org List-ID: On 10/20/2010 10:26 AM, Sheng Yang wrote: > This patch enable per-vector mask for assigned devices using MSI-X. > > > @@ -1087,6 +1087,28 @@ of 4 instructions that make up a hypercall. > If any additional field gets added to this structure later on, a bit for that > additional piece of information will be set in the flags bitmap. > > +4.47 KVM_ASSIGN_REG_MSIX_MMIO > + > +Capability: KVM_CAP_DEVICE_MSIX_MASK > +Architectures: x86 > +Type: vm ioctl > +Parameters: struct kvm_assigned_msix_mmio (in) > +Returns: 0 on success, !0 on error > + > +struct kvm_assigned_msix_mmio { > + /* Assigned device's ID */ > + __u32 assigned_dev_id; > + /* MSI-X table MMIO address */ > + __u64 base_addr; > + /* Must be 0 */ > + __u32 flags; > + /* Must be 0, reserved for future use */ > + __u64 reserved; > +}; > + > +This ioctl would enable in-kernel MSI-X emulation, which would handle MSI-X > +mask bit in the kernel. Need to clarify what happens for non-mask bits. > @@ -2717,6 +2719,10 @@ static int kvm_vcpu_ioctl_enable_cap(struct kvm_vcpu *vcpu, > return -EINVAL; > > switch (cap->cap) { > + case KVM_CAP_DEVICE_MSIX_EXT: > + vcpu->kvm->arch.msix_flags_enabled = true; > + r = 0; > + break; It's strange to enable a per-vm capability with a vcpu ioctl. -- error compiling committee.c: too many arguments to function