|
|
|
|
|
|
|
|
|
|
xen-devel
[Xen-devel] [PATCH 05 of 14] swiotlb: add comment where we handle the ov
From: Ian Campbell <ian.campbell@xxxxxxxxxx>
Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@xxxxxxxxxx>
---
lib/swiotlb.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lib/swiotlb.c b/lib/swiotlb.c
--- a/lib/swiotlb.c
+++ b/lib/swiotlb.c
@@ -301,6 +301,10 @@
start_dma_addr = virt_to_bus(io_tlb_start) & mask;
offset_slots = ALIGN(start_dma_addr, 1 << IO_TLB_SHIFT) >> IO_TLB_SHIFT;
+
+ /*
+ * Carefully handle integer overflow which can occur when mask == ~0UL.
+ */
max_slots = mask + 1
? ALIGN(mask + 1, 1 << IO_TLB_SHIFT) >> IO_TLB_SHIFT
: 1UL << (BITS_PER_LONG - IO_TLB_SHIFT);
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
<Prev in Thread] |
Current Thread |
[Next in Thread>
|
- [Xen-devel] [PATCH 00 of 14] swiotlb/x86: lay groundwork for xen dom0 use of swiotlb, Jeremy Fitzhardinge
- [Xen-devel] [PATCH 05 of 14] swiotlb: add comment where we handle the overflow of a dma mask on 32 bit,
Jeremy Fitzhardinge <=
- [Xen-devel] [PATCH 06 of 14] swiotlb: allow architectures to override phys<->bus<->phys conversions, Jeremy Fitzhardinge
- [Xen-devel] [PATCH 07 of 14] swiotlb: add arch hook to force mapping, Jeremy Fitzhardinge
- [Xen-devel] [PATCH 08 of 14] swiotlb: factor out copy to/from device, Jeremy Fitzhardinge
- [Xen-devel] [PATCH 10 of 14] swiotlb: consolidate swiotlb info message printing, Jeremy Fitzhardinge
- [Xen-devel] [PATCH 11 of 14] x86: add swiotlb allocation functions, Jeremy Fitzhardinge
- [Xen-devel] [PATCH 13 of 14] x86/swiotlb: add default phys<->bus conversion, Jeremy Fitzhardinge
- [Xen-devel] [PATCH 12 of 14] x86: unify pci iommu setup and allow swiotlb to compile for 32 bit, Jeremy Fitzhardinge
- [Xen-devel] [PATCH 14 of 14] x86/swiotlb: add default swiotlb_arch_range_needs_mapping, Jeremy Fitzhardinge
- [Xen-devel] [PATCH 09 of 14] swiotlb: support bouncing of HighMem pages, Jeremy Fitzhardinge
- [Xen-devel] Re: [PATCH 00 of 14] swiotlb/x86: lay groundwork for xen dom0 use of swiotlb, Ingo Molnar
|
|
|
|
|