Re: Where do we stand with the Xen patches?

From: Ian Campbell
Date: Thu May 21 2009 - 06:29:28 EST


On Thu, 2009-05-21 at 11:27 +0100, Ian Campbell wrote:
> The corresponding the Xen updates will...
...follow.

Subject:swiotlb/xen: add implementation of swiotlb_range_needs_mapping hook

This function is now implemented via asm/dma-mapping.h rather than as
a weak hook in swiotlb.c

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

diff --git a/arch/x86/include/asm/dma-mapping.h b/arch/x86/include/asm/dma-mapping.h
index a80139a..ed51bd1 100644
--- a/arch/x86/include/asm/dma-mapping.h
+++ b/arch/x86/include/asm/dma-mapping.h
@@ -315,9 +315,15 @@ static inline int is_buffer_dma_capable(struct device *dev, u64 mask,
return addr + size <= mask;
}

+#ifdef CONFIG_PCI_XEN
+extern int xen_range_needs_mapping(phys_addr_t paddr, size_t size);
+#else
+static inline int xen_range_needs_mapping(phys_addr_t paddr, size_t size) { return 0; }
+#endif
+
static int inline swiotlb_range_needs_mapping(phys_addr_t paddr, size_t size)
{
- return 0;
+ return xen_range_needs_mapping(paddr, size);
}

#endif
diff --git a/arch/x86/xen/pci-swiotlb.c b/arch/x86/xen/pci-swiotlb.c
index 5a46418..e23b00b 100644
--- a/arch/x86/xen/pci-swiotlb.c
+++ b/arch/x86/xen/pci-swiotlb.c
@@ -43,11 +43,3 @@ phys_addr_t swiotlb_bus_to_phys(struct device *hwdev, dma_addr_t baddr)

return baddr;
}
-
-int swiotlb_arch_range_needs_mapping(phys_addr_t paddr, size_t size)
-{
- if (xen_pv_domain())
- return xen_range_needs_mapping(paddr, size);
-
- return 0;
-}
diff --git a/drivers/pci/xen-iommu.c b/drivers/pci/xen-iommu.c
index 41c276f..003ffe3 100644
--- a/drivers/pci/xen-iommu.c
+++ b/drivers/pci/xen-iommu.c
@@ -132,6 +132,8 @@ static int range_straddles_page_boundary(phys_addr_t p, size_t size)

int xen_range_needs_mapping(phys_addr_t paddr, size_t size)
{
+ if (!xen_pv_domain())
+ return 0;
return range_straddles_page_boundary(paddr, size);
}



--
Ian Campbell
Current Noise: Isis - Wills Dissolve

"Hey Ivan, check your six."
-- Sidewinder missile jacket patch, showing a Sidewinder driving up the tail
of a Russian Su-27

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