On Mon, Dec 31, 2018 at 03:16:22PM +0000, Andrew Cooper wrote:
> diff --git a/xen/drivers/passthrough/x86/iommu.c
> b/xen/drivers/passthrough/x86/iommu.c
> index c68a722..0ccb754 100644
> --- a/xen/drivers/passthrough/x86/iommu.c
> +++ b/xen/drivers/passthrough/x86/iommu.c
> @@ -169,10 +169,10 @@ static bool __hwdom_init hwdom_iommu_map(const struct
> domain *d,
> default:
> if ( type & RAM_TYPE_RESERVED )
> {
> - if ( !iommu_hwdom_inclusive && !iommu_hwdom_reserved )
> + if ( !iommu_hwdom_reserved )
> return false;
> }
> - else if ( is_hvm_domain(d) || !iommu_hwdom_inclusive || pfn >
> max_pfn )
> + else if ( is_hvm_domain(d) || pfn > max_pfn )
> return false;
I think the switch can be simplified as:
switch ( type = page_get_ram_type(mfn) )
{
case RAM_TYPE_CONVENTIONAL:
if ( iommu_hwdom_strict )
return false;
break;
default:
if ( !(type & RAM_TYPE_RESERVED) )
return false;
/* fallthrough. */
case RAM_TYPE_RESERVED:
if ( !iommu_hwdom_reserved )
return false;
break;
}
And the max_pfn parameter is no longer needed.
Roger.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel