From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v2] xen/iommu: fix usage of shared EPT/IOMMU page tables on PVH guests Date: Tue, 10 Mar 2015 13:18:43 +0000 Message-ID: <54FEEF33.7010201@linaro.org> References: <1425036812-23536-1-git-send-email-roger.pau@citrix.com> <54FEE8BA.8060505@linaro.org> <54FEFA5102000078000680F7@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" 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 1YVK45-0000Xo-Eo for xen-devel@lists.xenproject.org; Tue, 10 Mar 2015 13:19:17 +0000 Received: by wgha1 with SMTP id a1so1780872wgh.1 for ; Tue, 10 Mar 2015 06:19:16 -0700 (PDT) In-Reply-To: <54FEFA5102000078000680F7@mail.emea.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: Kevin Tian , Aravind Gopalakrishnan , Suravee Suthikulpanit , Yang Zhang , xen-devel@lists.xenproject.org, Roger Pau Monne List-Id: xen-devel@lists.xenproject.org On 10/03/15 13:06, Jan Beulich wrote: >>>> On 10.03.15 at 13:51, wrote: >> Hi, >> >> On 27/02/15 11:33, Roger Pau Monne wrote: >>> diff --git a/xen/drivers/passthrough/iommu.c >> b/xen/drivers/passthrough/iommu.c >>> index cc12735..7fcbbb1 100644 >>> --- a/xen/drivers/passthrough/iommu.c >>> +++ b/xen/drivers/passthrough/iommu.c >>> @@ -332,7 +332,8 @@ void iommu_share_p2m_table(struct domain* d) >>> { >>> const struct iommu_ops *ops = iommu_get_ops(); >>> >>> - if ( iommu_enabled && is_hvm_domain(d) ) >>> + ASSERT( hap_enabled(d) ); >> >> This line is breaking compilation on ARM. >> >> Shouldn't it be replaced by iommu_use_hap_pt? > > No, that's a different thing. But shouldn't ARM have a stub > hap_enabled() evaluating to constant true? I'm not sure if we should introduce hap_enabled. It's not something that we should used in general. What are we trying to catch with this ASSERT? I guess wrong caller? If so, every share_p2m callbacks have a check "if iommu_use_hap_pt()" which contains a check to hap_enabled on x86. So I don't think this check is worthwhile in the common iommu code. Regards, -- Julien Grall