xen/arm: remove xen_dma_ops
arm and arm64 can just use xen_swiotlb_dma_ops directly like x86, no need for a pointer indirection. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Julien Grall <julien.grall@arm.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
This commit is contained in:
@@ -36,6 +36,7 @@
|
|||||||
#include <asm/mach/map.h>
|
#include <asm/mach/map.h>
|
||||||
#include <asm/system_info.h>
|
#include <asm/system_info.h>
|
||||||
#include <asm/dma-contiguous.h>
|
#include <asm/dma-contiguous.h>
|
||||||
|
#include <xen/swiotlb-xen.h>
|
||||||
|
|
||||||
#include "dma.h"
|
#include "dma.h"
|
||||||
#include "mm.h"
|
#include "mm.h"
|
||||||
@@ -2315,7 +2316,7 @@ void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size,
|
|||||||
|
|
||||||
#ifdef CONFIG_XEN
|
#ifdef CONFIG_XEN
|
||||||
if (xen_initial_domain())
|
if (xen_initial_domain())
|
||||||
dev->dma_ops = xen_dma_ops;
|
dev->dma_ops = &xen_swiotlb_dma_ops;
|
||||||
#endif
|
#endif
|
||||||
dev->archdata.dma_ops_setup = true;
|
dev->archdata.dma_ops_setup = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -162,16 +162,12 @@ void xen_destroy_contiguous_region(phys_addr_t pstart, unsigned int order)
|
|||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(xen_destroy_contiguous_region);
|
EXPORT_SYMBOL_GPL(xen_destroy_contiguous_region);
|
||||||
|
|
||||||
const struct dma_map_ops *xen_dma_ops;
|
|
||||||
EXPORT_SYMBOL(xen_dma_ops);
|
|
||||||
|
|
||||||
int __init xen_mm_init(void)
|
int __init xen_mm_init(void)
|
||||||
{
|
{
|
||||||
struct gnttab_cache_flush cflush;
|
struct gnttab_cache_flush cflush;
|
||||||
if (!xen_initial_domain())
|
if (!xen_initial_domain())
|
||||||
return 0;
|
return 0;
|
||||||
xen_swiotlb_init(1, false);
|
xen_swiotlb_init(1, false);
|
||||||
xen_dma_ops = &xen_swiotlb_dma_ops;
|
|
||||||
|
|
||||||
cflush.op = 0;
|
cflush.op = 0;
|
||||||
cflush.a.dev_bus_addr = 0;
|
cflush.a.dev_bus_addr = 0;
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
#include <linux/cache.h>
|
#include <linux/cache.h>
|
||||||
#include <linux/dma-noncoherent.h>
|
#include <linux/dma-noncoherent.h>
|
||||||
#include <linux/dma-iommu.h>
|
#include <linux/dma-iommu.h>
|
||||||
|
#include <xen/swiotlb-xen.h>
|
||||||
|
|
||||||
#include <asm/cacheflush.h>
|
#include <asm/cacheflush.h>
|
||||||
|
|
||||||
@@ -52,6 +53,6 @@ void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size,
|
|||||||
|
|
||||||
#ifdef CONFIG_XEN
|
#ifdef CONFIG_XEN
|
||||||
if (xen_initial_domain())
|
if (xen_initial_domain())
|
||||||
dev->dma_ops = xen_dma_ops;
|
dev->dma_ops = &xen_swiotlb_dma_ops;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,8 +19,6 @@ static inline enum paravirt_lazy_mode paravirt_get_lazy_mode(void)
|
|||||||
return PARAVIRT_LAZY_NONE;
|
return PARAVIRT_LAZY_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern const struct dma_map_ops *xen_dma_ops;
|
|
||||||
|
|
||||||
#ifdef CONFIG_XEN
|
#ifdef CONFIG_XEN
|
||||||
void __init xen_early_init(void);
|
void __init xen_early_init(void);
|
||||||
#else
|
#else
|
||||||
|
|||||||
Reference in New Issue
Block a user