From: "Jan Beulich" Subject: Re: [v4][PATCH 03/19] xen/vtd: create RMRR mapping Date: Tue, 23 Jun 2015 11:12:57 +0100 Message-ID: <55894D4902000078000881D3@mail.emea.novell.com> References: <1435053450-25131-1-git-send-email-tiejun.chen@intel.com> <1435053450-25131-4-git-send-email-tiejun.chen@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1435053450-25131-4-git-send-email-tiejun.chen@intel.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Tiejun Chen Cc: Yang Zhang , Kevin Tian , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org >>> On 23.06.15 at 11:57, wrote: > --- a/xen/drivers/passthrough/vtd/iommu.c > +++ b/xen/drivers/passthrough/vtd/iommu.c > @@ -1839,7 +1839,7 @@ static int rmrr_identity_mapping(struct domain *d, bool_t map, > > while ( base_pfn < end_pfn ) > { > - if ( intel_iommu_unmap_page(d, base_pfn) ) > + if ( guest_physmap_remove_page(d, base_pfn, base_pfn, 0) ) > ret = -ENXIO; > base_pfn++; > } > @@ -1855,8 +1855,7 @@ static int rmrr_identity_mapping(struct domain *d, bool_t map, > > while ( base_pfn < end_pfn ) > { > - int err = intel_iommu_map_page(d, base_pfn, base_pfn, > - IOMMUF_readable|IOMMUF_writable); > + int err = set_identity_p2m_entry(d, base_pfn, p2m_access_rw); Shouldn't the two continue to be the inverse of one another? Maybe guest_physmap_remove_page() does what you want, but it looks like at least an abuse. Jan