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

Re: [Xen-devel] [PATCH 3/7] iommu: push use of type-safe BFN and MFN into iommu_ops



>>> On 12.02.18 at 11:47, <paul.durrant@xxxxxxxxxx> wrote:
> @@ -612,12 +612,12 @@ static int __must_check iommu_flush_iotlb(struct domain 
> *d,
>          if ( iommu_domid == -1 )
>              continue;
>  
> -        if ( page_count != 1 || bfn == bfn_x(INVALID_BFN) )
> +        if ( page_count != 1 || bfn_eq(bfn, INVALID_BFN) )
>              rc = iommu_flush_iotlb_dsi(iommu, iommu_domid,
>                                         0, flush_dev_iotlb);
>          else
>              rc = iommu_flush_iotlb_psi(iommu, iommu_domid,
> -                                       (paddr_t)bfn << PAGE_SHIFT_4K,
> +                                       (paddr_t)bfn_x(bfn) << PAGE_SHIFT_4K,

The latest at this point you'll need to introduce bfn_to_baddr(). I
also have a hard time seeing how this can then validly be cast to
paddr_t.

> @@ -676,7 +676,8 @@ static int __must_check dma_pte_clear_one(struct domain 
> *domain, u64 addr)
>      iommu_flush_cache_entry(pte, sizeof(struct dma_pte));
>  
>      if ( !this_cpu(iommu_dont_flush_iotlb) )
> -        rc = iommu_flush_iotlb_pages(domain, addr >> PAGE_SHIFT_4K, 1);
> +        rc = iommu_flush_iotlb_pages(domain, _bfn(addr >> PAGE_SHIFT_4K),

And baddr_to_bfn().

Jan


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