WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 10 of 14] swiotlb: consolidate swiotlb info message p

To: Ingo Molnar <mingo@xxxxxxx>
Subject: [Xen-devel] [PATCH 10 of 14] swiotlb: consolidate swiotlb info message printing
From: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Date: Tue, 16 Dec 2008 12:17:34 -0800
Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, Ian Campbell <ian.campbell@xxxxxxxxxx>, the arch/x86 maintainers <x86@xxxxxxxxxx>, linux-kernel@xxxxxxxxxxxxxxx, FUJITA Tomonori <fujita.tomonori@xxxxxxxxxxxxx>
Delivery-date: Tue, 16 Dec 2008 12:25:02 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1229458644@xxxxxxxxxxxxxxxxx>
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
From: Ian Campbell <ian.campbell@xxxxxxxxxx>

Remove duplicated swiotlb info printing, and make it more detailed.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@xxxxxxxxxx>
---
 lib/swiotlb.c |   33 ++++++++++++++++++++++++++++-----
 1 file changed, 28 insertions(+), 5 deletions(-)

diff --git a/lib/swiotlb.c b/lib/swiotlb.c
--- a/lib/swiotlb.c
+++ b/lib/swiotlb.c
@@ -156,6 +156,32 @@
        return swiotlb_phys_to_bus(page_to_phys(sg_page(sg)) + sg->offset);
 }
 
+static void swiotlb_print_info(unsigned long bytes)
+{
+       phys_addr_t pstart, pend;
+       dma_addr_t bstart, bend;
+
+       pstart = virt_to_phys(io_tlb_start);
+       pend = virt_to_phys(io_tlb_end);
+
+       bstart = swiotlb_phys_to_bus(pstart);
+       bend = swiotlb_phys_to_bus(pend);
+
+       printk(KERN_INFO "Placing %luMB software IO TLB between %p - %p\n",
+              bytes >> 20, io_tlb_start, io_tlb_end);
+       if (pstart != bstart || pend != bend)
+               printk(KERN_INFO "software IO TLB at phys %#llx - %#llx"
+                      " bus %#llx - %#llx\n",
+                      (unsigned long long)pstart,
+                      (unsigned long long)pend,
+                      (unsigned long long)bstart,
+                      (unsigned long long)bend);
+       else
+               printk(KERN_INFO "software IO TLB at phys %#llx - %#llx\n",
+                      (unsigned long long)pstart,
+                      (unsigned long long)pend);
+}
+
 /*
  * Statically reserve bounce buffer space and initialize bounce buffer data
  * structures for the software IO TLB used to implement the DMA API.
@@ -198,8 +224,7 @@
        if (!io_tlb_overflow_buffer)
                panic("Cannot allocate SWIOTLB overflow buffer!\n");
 
-       printk(KERN_INFO "Placing software IO TLB between 0x%lx - 0x%lx\n",
-              swiotlb_virt_to_bus(io_tlb_start), 
swiotlb_virt_to_bus(io_tlb_end));
+       swiotlb_print_info(bytes);
 }
 
 void __init
@@ -279,9 +304,7 @@
        if (!io_tlb_overflow_buffer)
                goto cleanup4;
 
-       printk(KERN_INFO "Placing %luMB software IO TLB between 0x%lx - "
-              "0x%lx\n", bytes >> 20,
-              swiotlb_virt_to_bus(io_tlb_start), 
swiotlb_virt_to_bus(io_tlb_end));
+       swiotlb_print_info(bytes);
 
        return 0;
 



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>