From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [RFC 10/19] xen/passthrough: Introduce iommu_buildup Date: Thu, 03 Jul 2014 12:55:26 +0100 Message-ID: <53B544AE.5080604@linaro.org> References: <1402935486-29136-1-git-send-email-julien.grall@linaro.org> <1402935486-29136-11-git-send-email-julien.grall@linaro.org> <1404387912.17859.25.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1X2fbu-0003HH-Sf for xen-devel@lists.xenproject.org; Thu, 03 Jul 2014 11:55:31 +0000 Received: by mail-wg0-f46.google.com with SMTP id y10so108860wgg.17 for ; Thu, 03 Jul 2014 04:55:29 -0700 (PDT) In-Reply-To: <1404387912.17859.25.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, stefano.stabellini@citrix.com, tim@xen.org List-Id: xen-devel@lists.xenproject.org On 07/03/2014 12:45 PM, Ian Campbell wrote: > On Mon, 2014-06-16 at 17:17 +0100, Julien Grall wrote: >> This new function will correctly initialize the IOMMU page table for the >> current domain. > > _setup, _configure, _initialise, _construct etc would be more normal > names I think. I will rename to iommu_construct. The function is used to construct the page table and set to 1 need_iommu(d). > "buildup" is the half hour of mindless blather from pundits that you > have to watch before a televised sporting event begins ;-) > >> Also use it in iommu_assign_dt_device even though the current IOMMU >> implementation on ARM shares P2M with the processor. >> --- >> xen/drivers/passthrough/arm/iommu.c | 6 ++++++ >> xen/drivers/passthrough/device_tree.c | 7 +++++++ >> xen/drivers/passthrough/iommu.c | 25 +++++++++++++++++++++++++ >> xen/drivers/passthrough/pci.c | 12 ++++-------- >> xen/include/xen/iommu.h | 2 ++ >> 5 files changed, 44 insertions(+), 8 deletions(-) >> >> diff --git a/xen/drivers/passthrough/arm/iommu.c b/xen/drivers/passthrough/arm/iommu.c >> index 3007b99..de4ed64 100644 >> --- a/xen/drivers/passthrough/arm/iommu.c >> +++ b/xen/drivers/passthrough/arm/iommu.c >> @@ -68,3 +68,9 @@ void arch_iommu_domain_destroy(struct domain *d) >> { >> iommu_dt_domain_destroy(d); >> } >> + >> +int arch_iommu_populate_page_table(struct domain *d) >> +{ >> + /* The IOMMU share the p2m with the CPU */ > > "shares" Ok. >> + return -ENOSYS; >> +} [..] >> +int iommu_buildup(struct domain *d) > > Is there really not such a function already? How does x86 setup the > iommu then? There is a function to initialize the IOMMU but the activation and the setup of page table are down later, I guess to avoid using memory for nothing. Regards, -- Julien Grall