Skip to content
Commit 8d58aa48 authored by Alexey Kardashevskiy's avatar Alexey Kardashevskiy Committed by Christoph Hellwig
Browse files

swiotlb: reduce the swiotlb buffer size on allocation failure



At the moment the AMD encrypted platform reserves 6% of RAM for SWIOTLB
or 1GB, whichever is less. However it is possible that there is no block
big enough in the low memory which make SWIOTLB allocation fail and
the kernel continues without DMA. In such case a VM hangs on DMA.

This moves alloc+remap to a helper and calls it from a loop where
the size is halved on each iteration.

This updates default_nslabs on successful allocation which looks like
an oversight as not doing so should have broken callers of
swiotlb_size_or_default().

Signed-off-by: default avatarAlexey Kardashevskiy <aik@amd.com>
Reviewed-by: default avatarPankaj Gupta <pankaj.gupta@amd.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent 30a0b95b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment