From mboxrd@z Thu Jan 1 00:00:00 1970 From: Manish Jaggi Subject: Re: [PATCH v2] xen/passthrough: Support a single iommu_domain per xen domain per SMMU Date: Mon, 30 Mar 2015 16:34:41 +0530 Message-ID: <55192DC9.6060206@caviumnetworks.com> References: <1427118384-7312-1-git-send-email-robert.vanvossen@dornerworks.com> <55114563.2050400@caviumnetworks.com> <55116EED.8010704@dornerworks.com> <5512405F.7080005@caviumnetworks.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YcXVK-0004p9-Lo for xen-devel@lists.xenproject.org; Mon, 30 Mar 2015 11:05:14 +0000 In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Stefano Stabellini Cc: edgar.iglesias@xilinx.com, Ian.Campbell@citrix.com, Robert VanVossen , julien.grall@citrix.com, Josh.Whitehead@dornerworks.com, xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org On Wednesday 25 March 2015 11:05 PM, Stefano Stabellini wrote: > On Wed, 25 Mar 2015, Manish Jaggi wrote: >> On Tuesday 24 March 2015 07:34 PM, Robert VanVossen wrote: >>> On 3/24/2015 7:07 AM, Manish Jaggi wrote: >>>> On Monday 23 March 2015 07:16 PM, Robbie VanVossen wrote: >>>>> If multiple devices are being passed through to the same domain and they >>>>> share a single SMMU, then they only require a single iommu_domain. >>>>> >>>>> In arm_smmu_assign_dev, before a new iommu_domain is created, the >>>>> xen_domain->contexts is checked for any iommu_domains that are already >>>>> assigned to device that uses the same SMMU as the current device. If one >>>>> is found, attach the device to that iommu_domain. If a new one isn't >>>>> found, create a new iommu_domain just like before. >>>>> >>>>> The arm_smmu_deassign_dev function assumes that there is a single >>>>> device per iommu_domain. This meant that when the first device was >>>>> deassigned, the iommu_domain was freed and when another device was >>>>> deassigned a crash occured in xen. >>>>> >>>>> To fix this, a reference counter was added to the iommu_domain struct. >>>>> When an arm_smmu_xen_device references an iommu_domain, the >>>>> iommu_domains ref is incremented. When that reference is removed, the >>>>> iommu_domains ref is decremented. The iommu_domain will only be freed >>>>> when the ref is 0. >>>>> >>>>> Signed-off-by: Robbie VanVossen >>>> Hi, >>>> Are you adding a PCI passthrough support to Xen ?. I am in process of >>>> sending smmu driver patches based on juliens latest code. >>>> >>> Nope, I am just working on what this patch describes >> Your patch is doing similar thing what am working on. As per the Xen 4.6 >> release I took smmu for pci-passthorugh. I didnt send smmu patches so far as >> there are other dependency patches I need to send first like pci_host_bridge >> register hypercall patch. >> >> Julien/Ian could you please hold the merge of this patch. > Sorry Manish, but the Xen community works on a first come first served > basis: if/when this patch is considered in good condition and ready to > be merged, is likely to be merged. > Unless you have a specific concern about the code of course. Ok. I will incorporate robert's patch in my patch set. > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel