From: Konrad Rzeszutek Wilk on
Refer to "swiotlb-xen: Make 'xen_swiotlb_[map|unmap]_page' work." for
details why we want to use our own address translation mechanism.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk(a)oracle.com>
---
lib/swiotlb-xen.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/swiotlb-xen.c b/lib/swiotlb-xen.c
index ca6c537..d457f7e 100644
--- a/lib/swiotlb-xen.c
+++ b/lib/swiotlb-xen.c
@@ -343,10 +343,11 @@ xen_swiotlb_map_sg_attrs(struct device *hwdev, struct scatterlist *sgl,

for_each_sg(sgl, sg, nelems, i) {
phys_addr_t paddr = sg_phys(sg);
- dma_addr_t dev_addr = phys_to_dma(hwdev, paddr);
+ dma_addr_t dev_addr = xen_phys_to_bus(hwdev, paddr);

if (swiotlb_force ||
- !dma_capable(hwdev, dev_addr, sg->length)) {
+ !dma_capable(hwdev, dev_addr, sg->length) ||
+ range_straddles_page_boundary(paddr, sg->length)) {
void *map = xen_map_single(hwdev, sg_phys(sg),
sg->length, dir);
if (!map) {
--
1.7.0.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/