From: Keir Fraser Subject: Re: MMIO ioremap() error with PCI passthrough Date: Tue, 01 Jul 2008 10:45:46 +0100 Message-ID: References: <4869F1BF.2030705@adslpipe.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4869F1BF.2030705@adslpipe.co.uk> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Andy Burns , xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On 1/7/08 09:58, "Andy Burns" wrote: >> It looks like fec00000 is past the end of the device's mmio region. > > > Well 0xFEBFFC00 + 1K = 0xFEC00000, is this some sort of off-by-one > error, where it should only extend to 0xFEBFFFFF? > > Is it worth me attempting a change in the driver code from > > dev->lmmio = ioremap(pci_resource_start(pci_dev,0), 0x1000); > > to > > dev->lmmio = ioremap(pci_resource_start(pci_dev,0), 0xFFF); It shouldn't be necessary, since the range specified to ioremap is by base address and length and covers the inclusive range 'base' to 'base+length-1'. It's rather odd that the kernel tries to map FEC00000 at all. If you're happy changing kernel code, you might try adding printk() instrumentation to __ioremap() and __direct_remap_pfn_range() in arch/i386/mm/ioremap-xen.c. The functions look like they should map the correct range of pages (in this case only the page covering FEBFF000-FEBFFFFF) but perhaps there is an off-by-one error lurking. Or perhaps the mapping attempt of FEC00000 comes from somewhere else in the kernel. -- Keir