At the moment, Xen is assuming that all the devices are at least 32-bit
DMA capable. However, some SoC have devices that may be able to access
a much restricted range. For instance, the RPI has devices that can
only access the first 1GB of RAM.
The structure platform_desc is now extended to allow a platform to
override the DMA width. The new is used to implement
arch_get_dma_bit_size().
The prototype is now moved in asm-arm/mm.h as the function is not NUMA
specific. The implementation is done in platform.c so we don't have to
include platform.h everywhere. This should be fine as the function is
not expected to be called in hotpath.
Signed-off-by: Julien Grall <jgrall@amazon.com>
Reviewed-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
Tested-by: Corey Minyard <cminyard@mvista.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
return (dt_match_node(blacklist, node) != NULL);
}
+unsigned int arch_get_dma_bitsize(void)
+{
+ return ( platform && platform->dma_bitsize ) ? platform->dma_bitsize : 32;
+}
+
/*
* Local variables:
* mode: C
return -EOPNOTSUPP;
}
+unsigned int arch_get_dma_bitsize(void);
+
#endif /* __ARCH_ARM_MM__ */
/*
* Local variables:
#define node_start_pfn(nid) (mfn_x(first_valid_mfn))
#define __node_distance(a, b) (20)
-static inline unsigned int arch_get_dma_bitsize(void)
-{
- return 32;
-}
-
#endif /* __ARCH_ARM_NUMA_H */
/*
* Local variables:
* List of devices which must not pass-through to a guest
*/
const struct dt_device_match *blacklist_dev;
+ /* Override the DMA width (32-bit by default). */
+ unsigned int dma_bitsize;
};
/*