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] PCI MMIO issue

To: "Haw-Yuan Yang" <hawyuan@xxxxxxxxx>
Subject: Re: [Xen-devel] PCI MMIO issue
From: "Stephen Donnelly" <sfdonnelly@xxxxxxxxx>
Date: Tue, 20 Mar 2007 13:43:39 +1200
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Mon, 19 Mar 2007 18:42:39 -0700
Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=X06yR1awDvw+XfIqrlwS+g8j3QBCJJNVwSkTaTDPRlHT2GevMPSpvt0kRmbcjQZ6iyygFzfTUURPpUbiq6UrRcQux/v6akk12Ibvd2Jn7ORdJnwlXJf8nF1BrSRo1vLOaGPwFTveZF0UNHengSNwzBPTW3FKCGDOZlvsMSHi1o0=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=MF1JEdcLmqqK3N8d4ev0q7VofplB1Zf051LYKb0qd+D5c2YhnmIt7KXZQgMEFcbn9Lxt0+c29dfzBOPP2t2sxm7eRHJ9zAF6ki+myx+cf5hQ+bF/vvXCoz8MF1bhotooW/IgU9ZXHLHDtKjm6KpVaDeKC5iywZqVhFqGA8QCW3w=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <63c711180703191713v78c2ee29o8b7c9b5f2f5cb004@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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <5f370d430703191540y17e764c3ifba85d10dc902b5b@xxxxxxxxxxxxxx> <63c711180703191713v78c2ee29o8b7c9b5f2f5cb004@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
You are absolutely correct, the code now works fine with mmap. Thank you!

But I don't understand how this change works, since in include/asm/pgtable.h:

#define io_remap_pfn_range(vma, vaddr, pfn, size, prot)        \
        remap_pfn_range(vma, vaddr, pfn, size, prot)

Stephen.

On 3/20/07, Haw-Yuan Yang <hawyuan@xxxxxxxxx > wrote:
I have the same issue. Keir help me to solve the problem. Use io_remap_pfn_range() in your mmap handler to map the mmio.
 
hyang

 
On 3/19/07, Stephen Donnelly < sfdonnelly@xxxxxxxxx > wrote:
I posted this to the xen-users list first, they suggested I ask here.

I understood that in a Driver Domain that has access to a (PCI) device, 'native' drivers can be used, but I am having some problems with memory mapped IO from user space.

I have a PCI device that has a 64kB mmio range at PCI_BAR_0. This address space contains the registers for the device. My Linux driver provides a char device that allows read/write/seek, and mmap for this space. In Linux you can use either read/write/seek to access the space, or memory map it via mmap and access it directly.

When using the driver in dom0 under Xen 3.0.4, the read/write/seek method works fine but the mmap does not. None of the related functions return errors, but the mmap does not appear to access the correct memory. Is there anything I am missing?

The mmap is performed by a remap_pfn_range() by the driver, and mmap() in the user space code.

I am running Ubuntu 6.10 AMD64 Server and I built Xen 3.0.4 from source, including the 2.6.16.33-xen kernel. The driver is running in dom0, no other domains are present.

Thanks,
Stephen.


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



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>