[vbox-dev] Guest controlled scatter/gather of a virtual PCI memory region

Brandon Fliflet realtimeddd at yahoo.com
Wed Dec 8 15:34:34 PST 2010

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?



More information about the vbox-dev mailing list