xen-devel
[Xen-devel] [PATCH 16/27] swiotlb: use swiotlb_alloc_boot to allocate em
Also fix xen_swiotlb_fixup() to deal with sub-slab-sized allocations.
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@xxxxxxxxxx>
---
drivers/pci/xen-iommu.c | 12 +++++++++---
lib/swiotlb.c | 3 ++-
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/drivers/pci/xen-iommu.c b/drivers/pci/xen-iommu.c
index 608b8e2..7b6fd3e 100644
--- a/drivers/pci/xen-iommu.c
+++ b/drivers/pci/xen-iommu.c
@@ -47,16 +47,22 @@ void xen_swiotlb_fixup(void *buf, size_t size, unsigned
long nslabs)
buf, size);
dma_bits = get_order(IO_TLB_SEGSIZE << IO_TLB_SHIFT) + PAGE_SHIFT;
- for (i = 0; i < nslabs; i += IO_TLB_SEGSIZE) {
+
+ i = 0;
+ do {
+ int slabs = min(nslabs - i, (unsigned long)IO_TLB_SEGSIZE);
+
do {
rc = xen_create_contiguous_region(
(unsigned long)buf + (i << IO_TLB_SHIFT),
- get_order(IO_TLB_SEGSIZE << IO_TLB_SHIFT),
+ get_order(slabs << IO_TLB_SHIFT),
dma_bits);
} while (rc && dma_bits++ < max_dma_bits);
if (rc)
panic(KERN_ERR "xen_create_contiguous_region failed\n");
- }
+
+ i += slabs;
+ } while(i < nslabs);
}
int xen_wants_swiotlb(void)
diff --git a/lib/swiotlb.c b/lib/swiotlb.c
index 32e2bd3..8e6f6c8 100644
--- a/lib/swiotlb.c
+++ b/lib/swiotlb.c
@@ -202,7 +202,8 @@ swiotlb_init_with_default_size(size_t default_size)
/*
* Get the overflow emergency buffer
*/
- io_tlb_overflow_buffer = alloc_bootmem_low(io_tlb_overflow);
+ io_tlb_overflow_buffer = swiotlb_alloc_boot(io_tlb_overflow,
+ io_tlb_overflow >>
IO_TLB_SHIFT);
if (!io_tlb_overflow_buffer)
panic("Cannot allocate SWIOTLB overflow buffer!\n");
--
1.6.0.6
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
<Prev in Thread] |
Current Thread |
[Next in Thread>
|
- [Xen-devel] [PATCH 08/27] x86/pci: make sure _PAGE_IOMAP it set on pci mappings, (continued)
- [Xen-devel] [PATCH 12/27] xen: add hooks for mapping phys<->bus addresses in swiotlb, Jeremy Fitzhardinge
- [Xen-devel] [PATCH 11/27] xen swiotlb: fixup swiotlb is chunks smaller than MAX_CONTIG_ORDER, Jeremy Fitzhardinge
- [Xen-devel] [PATCH 16/27] swiotlb: use swiotlb_alloc_boot to allocate emergency pool,
Jeremy Fitzhardinge <=
- [Xen-devel] [PATCH 14/27] xen: enable swiotlb for xen domain 0., Jeremy Fitzhardinge
- [Xen-devel] [PATCH 17/27] xen/swiotlb: improve comment on gfp flags in xen_alloc_coherent(), Jeremy Fitzhardinge
- [Xen-devel] [PATCH 07/27] Xen/x86/PCI: Add support for the Xen PCI subsytem, Jeremy Fitzhardinge
- [Xen-devel] [PATCH 19/27] xen: set callout_map to make mtrr work, Jeremy Fitzhardinge
- [Xen-devel] [PATCH 18/27] xen/swiotlb: add sync functions, Jeremy Fitzhardinge
- [Xen-devel] [PATCH 15/27] xen/swiotlb: use dma_alloc_from_coherent to get device coherent memory, Jeremy Fitzhardinge
- [Xen-devel] [PATCH 20/27] xen mtrr: Use specific cpu_has_foo macros instead of generic cpu_has(), Jeremy Fitzhardinge
- [Xen-devel] [PATCH 24/27] xen mtrr: Kill some unneccessary includes, Jeremy Fitzhardinge
- [Xen-devel] [PATCH 25/27] x86: define arch_vm_get_page_prot to set _PAGE_IOMAP on VM_IO vmas, Jeremy Fitzhardinge
- [Xen-devel] [PATCH 26/27] agp: use more dma-ops-like operations for agp memory, Jeremy Fitzhardinge
|
|
|