Re: [PATCH 1/3] KVM: Ioctls for init MSI-X entry

Marcelo Tosatti
2009-02-12T18:46:54Z

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 <sheng@linux.intel.com>

> + 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.