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

[Xen-devel] Question about PV guest accessing /dev/mem

To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] Question about PV guest accessing /dev/mem
From: "Oehrlein, Scott" <scott.oehrlein@xxxxxxxxx>
Date: Tue, 27 Jul 2010 18:37:57 -0700
Accept-language: en-US
Acceptlanguage: en-US
Delivery-date: Tue, 27 Jul 2010 18:39:02 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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: Acst9YGPTsE2feJxRcmFfs6zneSRaw==
Thread-topic: Question about PV guest accessing /dev/mem

Hi all,

 

I am wondering if someone can explain to me the process involved when accessing MMIO from a PV guest via /dev/mem. In a native (non-VT) environment, if I take the BAR0 address of my device and perform the following two lines of code:

 

fd = fd = open("/dev/mem", O_RDWR);

logicaladdress = (unsigned long) mmap(NULL, (memoryspan + pagesize), PROT_READ|PROT_WRITE, MAP_SHARED, fd, (off_t)physicaladdress);

 

I can then read/write to the devices config space using logicaladdress. When using Xen’s PV functionality with pciback/pcifront to assign the device to the guest on a platform without VT-d support, an attempt to use logicaladdress results in the following error in ``xm dmesg’’:

 

(XEN) mm.c:1747:d23 Bad L1 flags 800000

 

Does this mean Xen’s mmu is not mapping gfn to mfn correctly? Or what is happening after the call to mmap that is different from native path?

 

Any insight would be appreciated. I’m using Xen 4.0 2.6.32.16 PVOPS dom0 and 2.6.34 domU from konrad’s repository.

 

Thanks,

Scott

 

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