From: Andy Burns Subject: Re: MMIO ioremap() error with PCI passthrough Date: Tue, 01 Jul 2008 14:16:03 +0100 Message-ID: <486A2E13.3080808@adslpipe.co.uk> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On 01/07/2008 10:45, Keir Fraser wrote: > If you're > happy changing kernel code, you might try adding printk() instrumentation to > __ioremap() printk(KERN_DEBUG "REMAP: phys=0x%lx, len=%lu\n", phys_addr, size); and __direct_remap_pfn_range() in arch/i386/mm/ioremap-xen.c. printk(KERN_DEBUG "REMAPPFN: addr=0x%lx, mfn=0x%lx, size=%lu\n", address, mfn, size); > 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? I can manage to build a kernel, but I'm out of my depth in terms of knowing what would be good or bad with physical addresses and page mappings ...