xen/swiotlb: Pass addresses rather than frame numbers to xen_arch_need_swiotlb

With 64KB page granularity support, the frame number will be different.

It will be easier to modify the behavior in a single place rather than
in each caller.

Signed-off-by: Julien Grall <julien.grall@citrix.com>
Reviewed-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
This commit is contained in:
Julien Grall
2015-09-09 15:17:33 +01:00
committed by David Vrabel
parent 250c9af3d8
commit 291be10fd7
4 changed files with 11 additions and 8 deletions

View File

@ -138,9 +138,12 @@ void __xen_dma_sync_single_for_device(struct device *hwdev,
}
bool xen_arch_need_swiotlb(struct device *dev,
unsigned long pfn,
unsigned long bfn)
phys_addr_t phys,
dma_addr_t dev_addr)
{
unsigned long pfn = PFN_DOWN(phys);
unsigned long bfn = PFN_DOWN(dev_addr);
return (!hypercall_cflush && (pfn != bfn) && !is_device_dma_coherent(dev));
}