path: root/arch/arm64
diff options
authorChristoph Hellwig <>2021-05-12 13:18:22 -0700
committerJuergen Gross <>2021-05-14 15:52:08 +0200
commit687842ec50342b716953f5847a49dd337cb6de8c (patch)
tree4d397f4607db86256af76edcb180b0aa194ba43a /arch/arm64
parentcb6f6b3384d7825d2a43f2256c5200e3b3956fc8 (diff)
arm64: do not set SWIOTLB_NO_FORCE when swiotlb is required
Although SWIOTLB_NO_FORCE is meant to allow later calls to swiotlb_init, today dma_direct_map_page returns error if SWIOTLB_NO_FORCE. For now, without a larger overhaul of SWIOTLB_NO_FORCE, the best we can do is to avoid setting SWIOTLB_NO_FORCE in mem_init when we know that it is going to be required later (e.g. Xen requires it). CC: CC: CC: CC: CC: Fixes: 2726bf3ff252 ("swiotlb: Make SWIOTLB_NO_FORCE perform no allocation") Signed-off-by: Christoph Hellwig <> Signed-off-by: Stefano Stabellini <> Reviewed-by: Juergen Gross <> Acked-by: Catalin Marinas <> Link: Signed-off-by: Juergen Gross <>
Diffstat (limited to 'arch/arm64')
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c
index 16a2b2b1c54d..e55409caaee3 100644
--- a/arch/arm64/mm/init.c
+++ b/arch/arm64/mm/init.c
@@ -43,6 +43,7 @@
#include <linux/sizes.h>
#include <asm/tlb.h>
#include <asm/alternative.h>
+#include <asm/xen/swiotlb-xen.h>
* We need to be able to catch inadvertent references to memstart_addr
@@ -482,7 +483,7 @@ void __init mem_init(void)
if (swiotlb_force == SWIOTLB_FORCE ||
max_pfn > PFN_DOWN(arm64_dma_phys_limit))
- else
+ else if (!xen_swiotlb_detect())
swiotlb_force = SWIOTLB_NO_FORCE;
set_max_mapnr(max_pfn - PHYS_PFN_OFFSET);