[PATCH 0/2] x86/hyperv/Swiotlb: Add swiotlb_alloc_from_low_pages switch

From: Tianyu Lan
Date: Wed Jan 26 2022 - 11:11:11 EST


From: Tianyu Lan <Tianyu.Lan@xxxxxxxxxxxxx>

Hyper-V Isolation VM may fail to allocate swiotlb bounce buffer due
to there is no enough contiguous memory from 0 to 4G in some cases.
Current swiotlb code allocate bounce buffer in the low end memory.
This patchset adds a switch "swiotlb_alloc_from_low_pages" and it's
set to true by default. Platform may clear it if necessary. Devices
in Hyper-V Isolation VM may use memory above 4G as DMA memory and set
the switch to false in order to avoid no enough contiguous memory in
low end address space.

Tianyu Lan (2):
Swiotlb: Add swiotlb_alloc_from_low_pages switch
x86/hyperv: Set swiotlb_alloc_from_low_pages to false

arch/x86/kernel/cpu/mshyperv.c | 1 +
include/linux/swiotlb.h | 1 +
kernel/dma/swiotlb.c | 13 +++++++++++--
3 files changed, 13 insertions(+), 2 deletions(-)

--
2.25.1