|
|
|
|
|
|
|
|
|
|
xen-devel
[Xen-devel] [PATCH 06/10] swiotlb: use swiotlb_alloc_boot to allocate em
To: |
Ingo Molnar <mingo@xxxxxxx> |
Subject: |
[Xen-devel] [PATCH 06/10] swiotlb: use swiotlb_alloc_boot to allocate emergency pool |
From: |
Jeremy Fitzhardinge <jeremy@xxxxxxxx> |
Date: |
Tue, 12 May 2009 14:50:47 -0700 |
Cc: |
Jeremy Fitzhardinge <jeremy@xxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, Joerg Roedel <joerg.roedel@xxxxxxx>, the arch/x86 maintainers <x86@xxxxxxxxxx>, Linux Kernel Mailing List <linux-kernel@xxxxxxxxxxxxxxx>, FUJITA Tomonori <fujita.tomonori@xxxxxxxxxxxxx>, Jeremy Fitzhardinge <jeremy.fitzhardinge@xxxxxxxxxx>, Matthew Wilcox <willy@xxxxxxxxxxxxxxx> |
Delivery-date: |
Tue, 12 May 2009 16:35:49 -0700 |
Envelope-to: |
www-data@xxxxxxxxxxxxxxxxxxx |
In-reply-to: |
<1242165051-6636-1-git-send-email-jeremy@xxxxxxxx> |
List-help: |
<mailto:xen-devel-request@lists.xensource.com?subject=help> |
List-id: |
Xen developer discussion <xen-devel.lists.xensource.com> |
List-post: |
<mailto:xen-devel@lists.xensource.com> |
List-subscribe: |
<http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> |
List-unsubscribe: |
<http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> |
References: |
<1242165051-6636-1-git-send-email-jeremy@xxxxxxxx> |
Sender: |
xen-devel-bounces@xxxxxxxxxxxxxxxxxxx |
Also fix xen_swiotlb_fixup() to deal with sub-slab-sized allocations.
[ Impact: bugfix ]
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@xxxxxxxxxx>
Acked-by: FUJITA Tomonori <fujita.tomonori@xxxxxxxxxxxxx>
---
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 678a0e5..bc64397 100644
--- a/drivers/pci/xen-iommu.c
+++ b/drivers/pci/xen-iommu.c
@@ -48,16 +48,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 2b0b5a7..a69834c 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] [GIT PULL] Xen dom0 swiotlb updates, Jeremy Fitzhardinge
- [Xen-devel] [PATCH 07/10] xen/swiotlb: improve comment on gfp flags in xen_alloc_coherent(), Jeremy Fitzhardinge
- [Xen-devel] [PATCH 08/10] xen/swiotlb: add sync functions, Jeremy Fitzhardinge
- [Xen-devel] [PATCH 01/10] xen: make sure swiotlb allocation is physically contigious, Jeremy Fitzhardinge
- [Xen-devel] [PATCH 02/10] xen swiotlb: fixup swiotlb is chunks smaller than MAX_CONTIG_ORDER, Jeremy Fitzhardinge
- [Xen-devel] [PATCH 03/10] xen: add hooks for mapping phys<->bus addresses in swiotlb, Jeremy Fitzhardinge
- [Xen-devel] [PATCH 04/10] xen/swiotlb: add hook for swiotlb_arch_range_needs_mapping, Jeremy Fitzhardinge
- [Xen-devel] [PATCH 06/10] swiotlb: use swiotlb_alloc_boot to allocate emergency pool,
Jeremy Fitzhardinge <=
- [Xen-devel] [PATCH 10/10] xen/swiotlb: define xen_wants_swiotlb when PCI_XEN is not enabled, Jeremy Fitzhardinge
- [Xen-devel] [PATCH 09/10] xen/swiotlb: make sure prototypes are in scope for swiotlb functions, Jeremy Fitzhardinge
- [Xen-devel] [PATCH 05/10] xen: enable swiotlb for xen domain 0., Jeremy Fitzhardinge
|
|
|
|
|