From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [PATCH 1/3] KVM: Ioctls for init MSI-X entry Date: Thu, 12 Feb 2009 16:46:24 -0200 Message-ID: <20090212184624.GB19653@amt.cnet> References: <200902121428.48607.sheng@linux.intel.com> <1234433268-1299-1-git-send-email-sheng@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Avi Kivity , kvm@vger.kernel.org To: Sheng Yang Return-path: Received: from mx2.redhat.com ([66.187.237.31]:48063 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758086AbZBLSqy (ORCPT ); Thu, 12 Feb 2009 13:46:54 -0500 Content-Disposition: inline In-Reply-To: <1234433268-1299-1-git-send-email-sheng@linux.intel.com> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Feb 12, 2009 at 06:07:48PM +0800, 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 > + adev->host_msix_entries = kzalloc(sizeof(struct msix_entry) * > + entry_nr->entry_nr, > + GFP_KERNEL); > + if (!adev->host_msix_entries) { Please verify its within a sane limit. Like the msr entry ioctl code. Also free host_msix_entries if guest_msix_entries allocation fails. Otherwise seems OK.