From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v3 08/13] xen/passthrough: iommu: Basic support of device tree assignment Date: Wed, 19 Mar 2014 10:42:50 +0000 Message-ID: <532974AA.8080703@linaro.org> References: <1394552999-14171-1-git-send-email-julien.grall@linaro.org> <1394552999-14171-9-git-send-email-julien.grall@linaro.org> <1395160425.11824.11.camel@kazak.uk.xensource.com> <5328A296.8030301@linaro.org> <1395223971.10203.39.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WQDxW-0003z4-LH for xen-devel@lists.xenproject.org; Wed, 19 Mar 2014 10:42:54 +0000 Received: by mail-wi0-f182.google.com with SMTP id d1so4844013wiv.9 for ; Wed, 19 Mar 2014 03:42:52 -0700 (PDT) In-Reply-To: <1395223971.10203.39.camel@kazak.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: xen-devel@lists.xenproject.org, Jan Beulich , tim@xen.org, Xiantao Zhang , stefano.stabellini@citrix.com List-Id: xen-devel@lists.xenproject.org Hi Ian, On 19/03/14 10:12, Ian Campbell wrote: >> On 03/18/2014 04:33 PM, Ian Campbell wrote: >>> On Tue, 2014-03-11 at 15:49 +0000, Julien Grall wrote: >>>> Add IOMMU helpers to support device tree assignment/deassignment. This patch >>>> introduces 2 new fields in the dt_device_node: >>>> - is_protected: Does the device is protected by an IOMMU >>>> - next_assigned: Pointer to the next device assigned to the same >>>> domain >>> >>> Am I correct that this list is not maintained for dom0? The behaviour of >>> dt_assign_device and dt_deassign_device seems to rely on it? >> >> DOM0 will call dt_assign_device for every device protected by the IOMMU >> (see patch #9). So it will itself have a list maintained. > > Does this not mean that iommu_assign_dt_device will refuse to assign the > device to another domain (next_assigned list is not empty). Yes. After thinking, I'm not sure we want maintain a list for dom0. At least the iommu_deassign_dt_device function is wrong because the device is not reassigned to dom0 (from the list point of view). > BTW, next_assigned is not a very good name for this list, since the > "nextness" is abstracted away. Consider just device_list. I found device_list too generic. We don't know if it's the list of all the devices or just the ones of a specific domain. What about domain_device_list? Regards, -- Julien Grall