[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v5 5/8] x86/iommu: switch the hwdom mapping function to use page_get_type
>>> On 14.08.18 at 15:43, <roger.pau@xxxxxxxxxx> wrote: > +static bool __hwdom_init hwdom_iommu_map(const struct domain *d, Unused function parameter? > + unsigned long pfn, > + unsigned long max_pfn) > +{ > + /* > + * Set up 1:1 mapping for dom0. Default to include only conventional RAM > + * areas and let RMRRs include needed reserved regions. When set, the > + * inclusive mapping additionally maps in every pfn up to 4GB except > those > + * that fall in unusable ranges. > + */ > + if ( (pfn > max_pfn && !mfn_valid(_mfn(pfn))) || xen_in_range(pfn) ) > + return false; > + > + switch ( page_get_type(pfn) ) > + { > + case RAM_TYPE_UNUSABLE: > + return false; > + > + case RAM_TYPE_CONVENTIONAL: > + if ( iommu_hwdom_strict ) > + return false; > + break; Simply "return !iommu_hwdom_strict", to make it yet easier to follow what happens in which case? But depending on your thoughts on my remarks on the previous patch, this may change all over again anyway. > + default: > + if ( !iommu_hwdom_inclusive || pfn > max_pfn ) > + return false; And then a plain return statement here too? Jan _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |