[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • 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
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • 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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.