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

Re: [Xen-devel] [PATCH 3/4] x86/iommu: reorder conditions used in the inclusive iommu mappings



On Tue, Jul 31, 2018 at 08:29:20AM +0100, Paul Durrant wrote:
> > -----Original Message-----
> > From: Xen-devel [mailto:xen-devel-bounces@xxxxxxxxxxxxxxxxxxxx] On Behalf
> > @@ -179,6 +169,13 @@ void __hwdom_init arch_iommu_hwdom_init(struct
> > domain *d)
> >           */
> >          if ( iommu_dom0_strict &&
> >               page_is_ram_type(pfn, RAM_TYPE_CONVENTIONAL) )
> > +            map = false;
> > +        else if ( iommu_inclusive && pfn <= max_pfn )
> > +            map = !page_is_ram_type(pfn, RAM_TYPE_UNUSABLE);
> > +        else
> > +            map = page_is_ram_type(pfn, RAM_TYPE_CONVENTIONAL);
> > +
> 
> Maybe better as...
> 
> If ( page_is_ram_type(pfn, RAM_TYPE_CONVENTIONAL) )
>   map = !iommu_dom0_strict;
> else if ( !page_is_ram_type(pfn, RAM_TYPE_UNUSABLE) )
>   map = (iommu_inclusive && pfn <= max_pfn);
> else
>   map = false; 
> 
> (I think that logic is correct).

Yes I think it's correct. Should have looked more closely when moving
this code around.

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®.