Hi Brandon,

Without knowing what exactly doesn't work it's hard to give advices, but one thing where real RAM diffiers from MMIO memory is cacheability property - usually MMIO memory is noncacheable and shall be mapped as such.

   Nikolay

On 12/9/10 2:34 AM, Brandon Fliflet wrote:
I am working on a project that provides a scatter/gather memory like logic for 
a virtual device. In this usage, the guest driver provides pinned memory that 
plugs into a PCI memory range such that accesses through that memory range get 
translated into the physical page provided by the guest driver. For the most 
part, things are working but there are some issues that make me wonder if 
something might be wrong with the implementation. To perform this behavior I 
needed to remap the HC physical page in the MMIO2 range with a new HC physical 
page (converted from the guest provided pinned memory). As such, we used the 
following interfaces.

//
// Remap page of memory region
//
// Inputs are GCPhys and regionOffset (offset from PCI BAR) where only 4K pages 
are mapped
rc = PGMPhysGCPhys2HCPhys(pVM, GCPhys,&HCPhys);
// Error handling
rc = PGMR3PhysMMIO2SetHCPhys(pVM, pDevIns, 0, regionOffset, HCPhys);
// Error handling

Where PGMR3PhysMMIO2SetHCPhys was adapted from PGMR3PhysMMIO2GetHCPhys.  Actual 
code used was in my forum post.

My questions to the devs here are: Do you forsee any issues with updating the 
HC physical page of an MMIO2 range? Is there a better way to remap a page in 
the MMIO2 given that the page is provided by the guest driver?

Regards,
Brandon





_______________________________________________
vbox-dev mailing list
[email protected]
http://vbox.innotek.de/mailman/listinfo/vbox-dev


_______________________________________________
vbox-dev mailing list
[email protected]
http://vbox.innotek.de/mailman/listinfo/vbox-dev

Reply via email to