Revert "xen/swiotlb: add alignment check for dma buffers"
authorBen Hutchings <ben@decadent.org.uk>
Mon, 24 Feb 2025 01:02:26 +0000 (02:02 +0100)
committerBen Hutchings <benh@debian.org>
Mon, 19 May 2025 17:24:37 +0000 (19:24 +0200)
Bug-Debian: https://bugs.debian.org/1087807
Bug-Debian: https://bugs.debian.org/1088159
Bug-Debian: https://bugs.debian.org/1093371

This reverts commit a0a8b7bebe1b1f9017b09e1e045f16725e871f9c, which
was commit 9f40ec84a7976d95c34e7cc070939deb103652b0 upstream.  This
caused regressions for a number of drivers under Xen.

Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name revert-xen-swiotlb-add-alignment-check-for-dma-buffe.patch

drivers/xen/swiotlb-xen.c

index 000d02ea4f7d8a7a9ba8282968e9082694a61666..ad3ee4857e154ee6be967551fe772abb679bc727 100644 (file)
@@ -91,15 +91,9 @@ static inline int range_straddles_page_boundary(phys_addr_t p, size_t size)
 {
        unsigned long next_bfn, xen_pfn = XEN_PFN_DOWN(p);
        unsigned int i, nr_pages = XEN_PFN_UP(xen_offset_in_page(p) + size);
-       phys_addr_t algn = 1ULL << (get_order(size) + PAGE_SHIFT);
 
        next_bfn = pfn_to_bfn(xen_pfn);
 
-       /* If buffer is physically aligned, ensure DMA alignment. */
-       if (IS_ALIGNED(p, algn) &&
-           !IS_ALIGNED((phys_addr_t)next_bfn << XEN_PAGE_SHIFT, algn))
-               return 1;
-
        for (i = 1; i < nr_pages; i++)
                if (pfn_to_bfn(++xen_pfn) != ++next_bfn)
                        return 1;