From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v3 05/13] xen/passthrough: rework dom0_pvh_reqs to use it also on ARM Date: Tue, 18 Mar 2014 17:28:16 +0000 Message-ID: <53288230.1050708@linaro.org> References: <1394552999-14171-1-git-send-email-julien.grall@linaro.org> <1394552999-14171-6-git-send-email-julien.grall@linaro.org> <1395159777.11824.4.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.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WPxoK-0004Mr-Ec for xen-devel@lists.xenproject.org; Tue, 18 Mar 2014 17:28:20 +0000 Received: by mail-wi0-f170.google.com with SMTP id bs8so2957057wib.1 for ; Tue, 18 Mar 2014 10:28:18 -0700 (PDT) In-Reply-To: <1395159777.11824.4.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, tim@xen.org, Xiantao Zhang , stefano.stabellini@citrix.com List-Id: xen-devel@lists.xenproject.org Hi Ian, On 03/18/2014 04:22 PM, Ian Campbell wrote: > On Tue, 2014-03-11 at 15:49 +0000, Julien Grall wrote: >> DOM0 on ARM will have the same requirements as DOM0 PVH when iommu is enabled. >> Both PVH and ARM guest has paging mode translate enabled, so Xen can use it >> to know if it needs to check the requirements. >> >> Rename the function and remove "pvh" word in the panic message. >> >> Signed-off-by: Julien Grall >> Acked-by: Jan Beulich >> Cc: Xiantao Zhang >> >> --- >> Changes in v2: >> - IOMMU can be disabled on ARM if the platform doesn't have >> IOMMU. >> --- >> xen/drivers/passthrough/iommu.c | 13 ++++++++----- >> 1 file changed, 8 insertions(+), 5 deletions(-) >> >> diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c >> index c70165a..3c63f87 100644 >> --- a/xen/drivers/passthrough/iommu.c >> +++ b/xen/drivers/passthrough/iommu.c >> @@ -130,13 +130,17 @@ int iommu_domain_init(struct domain *d) >> return hd->platform_ops->init(d); >> } >> >> -static __init void check_dom0_pvh_reqs(struct domain *d) >> +static __init void check_dom0_reqs(struct domain *d) >> { >> - if ( !iommu_enabled ) >> + if ( !paging_mode_translate(d) ) >> + return; >> + >> + if ( is_pvh_domain(d) && !iommu_enabled ) > > Is is_pvh_domain going to be exposed to common code on ARM? It will be exposed to common code. For now is_pvh_domain is part of xen/sched.h, do you plan to move it in asm-x86? > Or would a arch_check_dom0_reqs be useful here? I will update patch #7 to create this function. >> panic("Presently, iommu must be enabled for pvh dom0\n"); >> >> if ( iommu_passthrough ) >> - panic("For pvh dom0, dom0-passthrough must not be enabled\n"); >> + panic("Dom0 uses translate paging mode, dom0-passthrough must not be " > > "paging translated mode" reads more natural to me. I will change in the next version. Regards, -- Julien Grall