From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v2 10/15] xen/passthrough: iommu: Basic support of device tree assignment Date: Mon, 24 Feb 2014 13:07:59 +0000 Message-ID: <530B442F.7030200@linaro.org> References: <1393193792-20008-1-git-send-email-julien.grall@linaro.org> <1393193792-20008-11-git-send-email-julien.grall@linaro.org> <530B314D020000780011EAB4@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" 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 1WHvGV-0000hf-AJ for xen-devel@lists.xenproject.org; Mon, 24 Feb 2014 13:08:11 +0000 Received: by mail-ea0-f178.google.com with SMTP id a15so3165387eae.9 for ; Mon, 24 Feb 2014 05:08:02 -0800 (PST) In-Reply-To: <530B314D020000780011EAB4@nat28.tlf.novell.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: Jan Beulich Cc: xen-devel@lists.xenproject.org, stefano.stabellini@citrix.com, ian.campbell@citrix.com, tim@xen.org List-Id: xen-devel@lists.xenproject.org Hi Jan, On 02/24/2014 10:47 AM, Jan Beulich wrote: >>>> On 23.02.14 at 23:16, 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 >> >> Signed-off-by: Julien Grall >> >> --- >> Changes in v2: >> - Patch added >> --- >> xen/common/device_tree.c | 4 ++ >> xen/drivers/passthrough/Makefile | 1 + >> xen/drivers/passthrough/device_tree.c | 106 +++++++++++++++++++++++++++++++++ >> xen/drivers/passthrough/iommu.c | 10 ++++ >> xen/include/xen/device_tree.h | 14 +++++ >> xen/include/xen/hvm/iommu.h | 6 ++ >> xen/include/xen/iommu.h | 16 +++++ > > No matter how small the changes to generic IOMMU code, you should > Cc the maintainers. Oops, sorry. >> --- a/xen/drivers/passthrough/iommu.c >> +++ b/xen/drivers/passthrough/iommu.c >> @@ -123,6 +123,12 @@ int iommu_domain_init(struct domain *d) >> if ( ret ) >> return ret; >> >> +#if HAS_DEVICE_TREE >> + ret = iommu_dt_domain_init(d); >> + if ( ret ) >> + return ret; >> +#endif > > Why can this not be part of arch_iommu_domain_init()? I didn't think about this solution. I will move in arch_iommu_domain_init in the next version. >> @@ -198,6 +204,10 @@ void iommu_domain_destroy(struct domain *d) >> if ( need_iommu(d) ) >> iommu_teardown(d); >> >> +#ifdef HAS_DEVICE_TREE >> + iommu_dt_domain_destroy(d); >> +#endif >> + >> arch_iommu_domain_destroy(d); > > And the former one here part of the latter? Ok. >> @@ -28,6 +29,11 @@ struct hvm_iommu { >> >> /* iommu_ops */ >> const struct iommu_ops *platform_ops; >> + >> + #ifdef HAS_DEVICE_TREE >> + /* List of DT devices assigned to this domain */ >> + struct list_head dt_devices; >> + #endif > > Indentation. Will do. Cheers, -- Julien Grall