Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

swiotlb-xen: remove start_dma_addr

It is not strictly needed. Call virt_to_phys on xen_io_tlb_start
instead. It will be useful not to have a start_dma_addr around with the
next patches.

Note that virt_to_phys is not the same as xen_virt_to_bus but actually
it is used to compared again __pa(xen_io_tlb_start) as passed to
swiotlb_init_with_tbl, so virt_to_phys is actually what we want.

Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Tested-by: Corey Minyard <cminyard@mvista.com>
Tested-by: Roman Shaposhnik <roman@zededa.com>
Link: https://lore.kernel.org/r/20200710223427.6897-2-sstabellini@kernel.org
Signed-off-by: Juergen Gross <jgross@suse.com>

authored by

Stefano Stabellini and committed by
Juergen Gross
ae4f0a17 8b1e868f

+2 -5
+2 -5
drivers/xen/swiotlb-xen.c
··· 52 52 * Quick lookup value of the bus address of the IOTLB. 53 53 */ 54 54 55 - static u64 start_dma_addr; 56 - 57 55 /* 58 56 * Both of these functions should avoid XEN_PFN_PHYS because phys_addr_t 59 57 * can be 32bit when dma_addr_t is 64bit leading to a loss in ··· 239 241 m_ret = XEN_SWIOTLB_EFIXUP; 240 242 goto error; 241 243 } 242 - start_dma_addr = xen_virt_to_bus(xen_io_tlb_start); 243 244 if (early) { 244 245 if (swiotlb_init_with_tbl(xen_io_tlb_start, xen_io_tlb_nslabs, 245 246 verbose)) ··· 389 392 */ 390 393 trace_swiotlb_bounced(dev, dev_addr, size, swiotlb_force); 391 394 392 - map = swiotlb_tbl_map_single(dev, start_dma_addr, phys, 393 - size, size, dir, attrs); 395 + map = swiotlb_tbl_map_single(dev, virt_to_phys(xen_io_tlb_start), 396 + phys, size, size, dir, attrs); 394 397 if (map == (phys_addr_t)DMA_MAPPING_ERROR) 395 398 return DMA_MAPPING_ERROR; 396 399