On 5/2/19 7:58 AM, Jan Beulich wrote:
> This is what both callers of guest_physmap_add_page() in memory.c want
> (for the !paging_mode_translate() case), and it is also what both
> callers in gnttab_transfer() need (but have been lacking). The other
> (x86-specific) callers are all HVM-only, and hence unaffected by this
> change.
> 
> Sadly this isn't enough yet to drop Arm's dummy macro, as there's one
> more use in page_alloc.c.
> 
> Signed-off-by: Jan Beulich <[email protected]>
> 
> --- a/xen/arch/x86/mm/p2m.c
> +++ b/xen/arch/x86/mm/p2m.c
> @@ -841,15 +841,19 @@ guest_physmap_add_entry(struct domain *d
>           * any guest-requested type changes succeed and remove the IOMMU
>           * entry).
>           */
> -        if ( !need_iommu_pt_sync(d) || t != p2m_ram_rw )
> +        if ( t != p2m_ram_rw )
>              return 0;

So, you seem to be claiming that the only way to get here is via
guest_physmap_add_page(), which will always call this function with
p2m_ram_rw.  So then what's the point of this conditional at all
anymore?  Would it be better to add an ASSERT(t == p2m_ram_rw) here?

And if we ever *do* get here with t == p2m_ram_rw, do we really not want
to call set_gpfn_from_mfn()?

 -George

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reply via email to