From mboxrd@z Thu Jan 1 00:00:00 1970 From: Manish Subject: Re: [PATCH for 4.6 13/13] xen/iommu: smmu: Add Xen specific code to be able to use the driver Date: Thu, 19 Feb 2015 12:46:33 +0530 Message-ID: <54E58DD1.7070009@caviumnetworks.com> References: <1418760534-18163-1-git-send-email-julien.grall@linaro.org> <1418760534-18163-14-git-send-email-julien.grall@linaro.org> <54E3E49D.7000109@caviumnetworks.com> <54E47BE2.5030908@linaro.org> <54E47D60.7010608@linaro.org> <1424280633785.32004@caviumnetworks.com> <54E4D85C.6090600@linaro.org> <54E550B2.1090605@caviumnetworks.com> <54E57C46.2030008@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YOLM3-0002Q5-Ug for xen-devel@lists.xenproject.org; Thu, 19 Feb 2015 07:17:00 +0000 In-Reply-To: <54E57C46.2030008@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Julien Grall Cc: "stefano.stabellini@citrix.com" , "Jaggi, Manish" , "tim@xen.org" , "ian.campbell@citrix.com" , "xen-devel@lists.xenproject.org" List-Id: xen-devel@lists.xenproject.org On 19/02/15 11:31 am, Julien Grall wrote: > > > On 19/02/2015 02:55, Manish wrote: >> >> On 18/02/15 11:52 pm, Julien Grall wrote: >>> >>> >>> On 18/02/2015 17:30, Jaggi, Manish wrote: >>>> [manish] There are general comments on the data structures >>>> (a) I don't see a use case where for same domain (VM) there would be >>>> different context banks , so linked list may not be required. >>> >>> I guess you mean the list in arm_smmu_xen_domain? All the devices >>> pass-through to a domain may not be protected by the same SMMU. >>> Therefore the context banks are different. >> you are right. For each smmu the context bank instance for a xen domain >> is duplicated with just a change in context bank id. I was thinking can >> it be minimized. >>> >>> Also, for now a context is allocated per-device. It should be rework >>> to share the context between multiple device protected by the same >>> SMMU and pass-through to the same domain. >> Yes, this is exactly I an doing at my end. >>> >>>> (b) Also iommu group may not be relevant for the same reason. >>>> I am curious to find the use cases. >>> >>> The iommu_group is used to store the configuration of the device >>> protected by an SMMU (i.e the stream ids associated to this domain). >>> >>> I'm a bit surprised that you think they are not useful... >> How do we create an iommu_group in xen ? AFAIK an iommu group is a vfio >> group in linux which is assigned to a a VM. >> lkvm run -m 512 -k home/Image ... --vfio-groups=48, 51 > > > For Xen There are 2 ways of attaching devices using xl pci-attach > or in >> domU cfg file. Should they create different iommu_groups ? > > Why are you talking about VFIO? The iommu_group is created by the SMMU > when a new device is added (see arm_smmu_device). At the time we are > speaking, Linux and Xen use one iommu group per-device. > No matters what VFIO does. > > Even though we have two ways to attach PCI on the toolstack, both are > using the same hypercall at the end. > > Regards, > I think we can have a discussion over it, parallely I will send RFC patches on your current state of xen-unstable smmu code.