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: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] MMIO ioremap() error with PCI passthrough
From: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Date: Tue, 01 Jul 2008 11:52:39 -0700
Cc: Andy Burns <lists.xensource.com@xxxxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 01 Jul 2008 11:53:09 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <C48FF03E.235B9%keir.fraser@xxxxxxxxxxxxx>
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: <C48FF03E.235B9%keir.fraser@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.14 (X11/20080501)
Keir Fraser wrote:
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.

There was a kernel bug in which ioremap would add a 1 page redzone to the end of the mapping, and then pass that extra page to iounmap. It has been fixed for a while, but since F8.

   J

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