From: Stefano Stabellini Subject: Re: [PATCH v3 3/3] xen/arm: introduce XENFEAT_grant_map_identity Date: Thu, 24 Jul 2014 15:10:18 +0100 Message-ID: References: <1406208666-23547-3-git-send-email-stefano.stabellini@eu.citrix.com> <53D1292802000078000258E6@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 1XAJjv-0005Dp-FF for xen-devel@lists.xenproject.org; Thu, 24 Jul 2014 14:11:23 +0000 In-Reply-To: <53D1292802000078000258E6@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: julien.grall@citrix.com, xen-devel , Ian.Campbell@citrix.com, Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On Thu, 24 Jul 2014, Jan Beulich wrote: > >>> On 24.07.14 at 15:31, wrote: > > --- a/xen/common/grant_table.c > > +++ b/xen/common/grant_table.c > > @@ -727,7 +727,7 @@ __gnttab_map_grant_ref( > > > > double_gt_lock(lgt, rgt); > > > > - if ( gnttab_need_iommu_mapping(ld) ) > > + if ( gnttab_need_iommu_mapping(ld) || gnttab_need_identity_mapping(ld) ) > > As before I think this change is pointless. I don't understand how you propose to solve the problem. In fact the two are not the same. On ARM: #define gnttab_need_iommu_mapping(d) \ (is_domain_direct_mapped(d) && need_iommu(d)) #ifdef HAS_PASSTHROUGH #define need_iommu(d) ((d)->need_iommu) #else #define need_iommu(d) (0) #endif Also need_iommu is only set if an iommu is available. On the other hand: #define gnttab_need_identity_mapping(d) \ (is_domain_direct_mapped(d) && !need_iommu(d)) So gnttab_need_identity_mapping would cover the case of a direct_mapped dom0 with an iommu available.