summaryrefslogtreecommitdiffstats
path: root/drivers/xen
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2021-03-01 08:44:27 +0100
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2021-03-17 00:33:52 +0000
commit16bc75f3aa3963588b13b01f6dad589f85d9f733 (patch)
treed63b6af55beb3993e58b12ca0eaa1348f3b3721f /drivers/xen
parent80808d273a3f075196d1a26463f65d4c9d2891c8 (diff)
downloadlinux-16bc75f3aa3963588b13b01f6dad589f85d9f733.tar.gz
linux-16bc75f3aa3963588b13b01f6dad589f85d9f733.tar.bz2
linux-16bc75f3aa3963588b13b01f6dad589f85d9f733.zip
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>
Diffstat (limited to 'drivers/xen')
-rw-r--r--drivers/xen/swiotlb-xen.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c
index 4e8a4e14942a..bffb35993c9d 100644
--- a/drivers/xen/swiotlb-xen.c
+++ b/drivers/xen/swiotlb-xen.c
@@ -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
* in our domain. Therefore _only_ check address within our domain.
*/
- if (pfn_valid(PFN_DOWN(paddr))) {
- return paddr >= virt_to_phys(xen_io_tlb_start) &&
- paddr < virt_to_phys(xen_io_tlb_end);
- }
+ if (pfn_valid(PFN_DOWN(paddr)))
+ return is_swiotlb_buffer(paddr);
return 0;
}