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 10:45:46 +0100
Cc:
Delivery-date: Tue, 01 Jul 2008 02:46:38 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4869F1BF.2030705@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: AcjbXzxLepCsFkdSEd271gAX8io7RQ==
Thread-topic: [Xen-devel] MMIO ioremap() error with PCI passthrough
User-agent: Microsoft-Entourage/11.4.0.080122
On 1/7/08 09:58, "Andy Burns" <lists.xensource.com@xxxxxxxxxxxxxx> 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



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