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

Re: [Xen-devel] MMIO ioremap() error with PCI passthrough

To: Andy Burns <lists.xensource.com@xxxxxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] MMIO ioremap() error with PCI passthrough
From: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Date: Tue, 01 Jul 2008 14:31:26 +0100
Cc:
Delivery-date: Tue, 01 Jul 2008 06:31:52 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <486A2E13.3080808@xxxxxxxxxxxxxx>
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
Thread-index: AcjbfsLDASKaSkdyEd24uwAX8io7RQ==
Thread-topic: [Xen-devel] MMIO ioremap() error with PCI passthrough
User-agent: Microsoft-Entourage/11.4.0.080122
On 1/7/08 14:16, "Andy Burns" <lists.xensource.com@xxxxxxxxxxxxxx> wrote:

>> The functions look like they should map the correct range of pages (in this
>> case only the page covering FEBFF000-FEBFFFFF)
> 
> Built and installed kernel/modules/initrd, rebooted, when it loads the
> saa7134 driver I see this
> 
> REMAP: phys=0xfebffc00, len=4096
> REMAPPFN: addr=0xffffc20000038000, mfn=0xfebff, size=8192
> 
> So the 1K mapping has been rounded up to 4K (x86_64 page size?) before
> passing to __ioremap() and then rounded up again to 8K by the time it
> gets passed to __direct_remap_pfn_range() is that right?

Well, your analysis is correct, and the size argument to __ioremap() is
bogus. It shouldn't have been rounded up to 4096 without also rounding down
the base address. I don't think this would happen with out linux-2.6.18-xen
tree. In there, ioremap() is defined in include/asm-x86_64/mach-xen/io.h as
a thin wrapper around __ioremap() which does not modify the size parameter.

So, could be a bug specific to the FC8 kernel. I don't have its sources to
hand to pinpoint where the size is getting changed from 0x400 to 0x1000. You
should be able to dig up that detail pretty easily though.

 -- Keir



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