|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH] xen/swiotlb: Check the segment boundary in range_straddles_page_boundary()
On 18.11.26 12:25, Ross Lagerwall wrote: On 11/13/26 12:47 PM, Lin Liu wrote:The block layer applies a device's DMA segment boundary to pseudo-physical addresses, but in a Xen PV domain the bus address is the machine address. A range that is contiguous in both spaces can still cross the boundary in machine space and reach the device. AHCI declares a 4 GiB boundary, and controllers that do not carry across it (e.g. Marvell 88SE9230) then DMA the tail of the transfer 4 GiB too low. Make range_straddles_page_boundary() also reject a contiguous range that crosses the device's segment boundary in bus space, so all its callers cover it. Streaming mappings are bounced; coherent allocations are already naturally aligned via range_requires_alignment(). Signed-off-by: Lin Liu <lin.liu01@xxxxxxxxxx> --- drivers/xen/swiotlb-xen.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c index e2538824e..181f8cef2 100644 --- a/drivers/xen/swiotlb-xen.c +++ b/drivers/xen/swiotlb-xen.c@@ -82,10 +82,13 @@ static inline bool range_requires_alignment(phys_addr_t p, size_t size) Hmm, agreed. Juergen Attachment:
OpenPGP_signature.asc
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |