From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Williamson Subject: Re: [RFC PATCH 3/6] vfio: Extend iommu-info to return MSIs automap state Date: Mon, 05 Oct 2015 16:45:02 -0600 Message-ID: <1444085102.26107.364.camel@redhat.com> References: <1443624989-24346-1-git-send-email-Bharat.Bhushan@freescale.com> <1443624989-24346-3-git-send-email-Bharat.Bhushan@freescale.com> <1443825961.26107.188.camel@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: "kvmarm@lists.cs.columbia.edu" , "kvm@vger.kernel.org" , "christoffer.dall@linaro.org" , "eric.auger@linaro.org" , "pranavkumar@linaro.org" , "marc.zyngier@arm.com" , "will.deacon@arm.com" To: Bhushan Bharat Return-path: Received: from mx1.redhat.com ([209.132.183.28]:37536 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752135AbbJEWpD (ORCPT ); Mon, 5 Oct 2015 18:45:03 -0400 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On Mon, 2015-10-05 at 06:00 +0000, Bhushan Bharat wrote: > > -1138,6 +1156,8 @@ > > > static long vfio_iommu_type1_ioctl(void *iommu_data, > > > } > > > } else if (cmd == VFIO_IOMMU_GET_INFO) { > > > struct vfio_iommu_type1_info info; > > > + struct iommu_domain_msi_maps msi_maps; > > > + int ret; > > > > > > minsz = offsetofend(struct vfio_iommu_type1_info, > > iova_pgsizes); > > > > > > @@ -1149,6 +1169,18 @@ static long vfio_iommu_type1_ioctl(void > > > *iommu_data, > > > > > > info.flags = 0; > > > > > > + ret = vfio_domains_get_msi_maps(iommu, &msi_maps); > > > + if (ret) > > > + return ret; > > > > And now ioctl(VFIO_IOMMU_GET_INFO) no longer works for any IOMMU > > implementing domain_get_attr but not supporting > > DOMAIN_ATTR_MSI_MAPPING. > > With this current patch version this will get the default assumed behavior as you commented on previous patch. How so? + msi_maps->automap = true; + msi_maps->override_automap = false; + + if (domain->ops->domain_get_attr) + ret = domain->ops->domain_get_attr(domain, attr, data); If domain_get_attr is implemented, but DOMAIN_ATTR_MSI_MAPPING is not, ret should be an error code.