[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] x86/p2m: fix non-translated handling of iommu mappings



On Tue, Jul 23, 2019 at 10:32:41AM +0000, Jan Beulich wrote:
> On 22.07.2019 17:32, Roger Pau Monne wrote:
> > The current usage of need_iommu_pt_sync in p2m for non-translated
> > guests is wrong because it doesn't correctly handle a relaxed PV
> > hardware domain, that has need_sync set to false, but still need
> > entries to be added from calls to {set/clear}_identity_p2m_entry.
> > 
> > Adjust the code in guest_physmap_add_page to also check whether the
> > domain has an iommu instead of whether it needs syncing or not in
> > order to take a reference to a page to be mapped.
> 
> Why this seemingly unrelated change? I ask because ...
> 
> > --- a/xen/arch/x86/mm/p2m.c
> > +++ b/xen/arch/x86/mm/p2m.c
> > @@ -836,7 +836,7 @@ guest_physmap_add_page(struct domain *d, gfn_t gfn, 
> > mfn_t mfn,
> >            */
> >           for ( i = 0; i < (1UL << page_order); ++i, ++page )
> >           {
> > -            if ( !need_iommu_pt_sync(d) )
> > +            if ( !has_iommu_pt(d) )
> >                   /* nothing */;
> >               else if ( get_page_and_type(page, d, PGT_writable_page) )
> >                   put_page_and_type(page);
> 
> ... this parallels the code in iommu_hwdom_init(), which similarly
> uses need_iommu_pt_sync() (and during the prior discussion you did
> agree with Paul that it shouldn't be changed). IOW the patch for
> now can have my R-b only with this change and the respective part
> of the description dropped.

OK, this is again not needed for a relaxed PV hardware domain because
all RAM is already mapped on the iommu page tables.

Let me update the commit and resend.

Thanks, Roger.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.