mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-15 03:57:07 +07:00
b4dca15129
Now that we know we always have the dma-noncoherent.h helpers available if we are on an architecture with support for non-coherent devices, we can just call them directly, and remove the calls to the dma-direct routines, including the fact that we call the dma_direct_map_page routines but ignore the value returned from it. Instead we now have Xen wrappers for the arch_sync_dma_for_{device,cpu} helpers that call the special Xen versions of those routines for foreign pages. Note that the new helpers get the physical address passed in addition to the dma address to avoid another translation for the local cache maintainance. The pfn_valid checks remain on the dma address as in the old code, even if that looks a little funny. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org> Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
16 lines
533 B
C
16 lines
533 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef __LINUX_SWIOTLB_XEN_H
|
|
#define __LINUX_SWIOTLB_XEN_H
|
|
|
|
#include <linux/swiotlb.h>
|
|
|
|
void xen_dma_sync_for_cpu(struct device *dev, dma_addr_t handle,
|
|
phys_addr_t paddr, size_t size, enum dma_data_direction dir);
|
|
void xen_dma_sync_for_device(struct device *dev, dma_addr_t handle,
|
|
phys_addr_t paddr, size_t size, enum dma_data_direction dir);
|
|
|
|
extern int xen_swiotlb_init(int verbose, bool early);
|
|
extern const struct dma_map_ops xen_swiotlb_dma_ops;
|
|
|
|
#endif /* __LINUX_SWIOTLB_XEN_H */
|