mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-02 15:18:19 +00:00
xen-swiotlb: use is_swiotlb_buffer in is_xen_swiotlb_buffer
Use the is_swiotlb_buffer to check if a physical address is a swiotlb buffer. This works because xen-swiotlb does use the same buffer as the main swiotlb code, and xen_io_tlb_{start,end} are just the addresses for it that went through phys_to_virt. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
This commit is contained in:
parent
80808d273a
commit
16bc75f3aa
1 changed files with 2 additions and 4 deletions
|
@ -111,10 +111,8 @@ static int is_xen_swiotlb_buffer(struct device *dev, dma_addr_t dma_addr)
|
||||||
* have the same virtual address as another address
|
* have the same virtual address as another address
|
||||||
* in our domain. Therefore _only_ check address within our domain.
|
* in our domain. Therefore _only_ check address within our domain.
|
||||||
*/
|
*/
|
||||||
if (pfn_valid(PFN_DOWN(paddr))) {
|
if (pfn_valid(PFN_DOWN(paddr)))
|
||||||
return paddr >= virt_to_phys(xen_io_tlb_start) &&
|
return is_swiotlb_buffer(paddr);
|
||||||
paddr < virt_to_phys(xen_io_tlb_end);
|
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue