Mapping guest physical memory to host virtual memory

Discussions related to using the OSE version of VirtualBox.

Mapping guest physical memory to host virtual memory

Postby matthiasp » 15. Apr 2019, 08:40

Hi all,

I'm trying to implement a basic version of the virtio 1.0 standard which only supports PCI devices.
The implementation is based on the QEMU virtio implementation.

To achieve high efficiency it's necessary to map regions of the physical guest memory to virtual host memory to avoid copying data.
In QEMU, guest physical addresses can be mapped with cpu_physical_memory_map(). This allows any address range to be mapped to host memory.
The only equivalent functions I have found in VirtualBox (PDMDevHlpPhysGCPhys2CCPtr(), MMR3HyperMapGCPhys()) require the address to be page aligned.

It would be nice, if I don't have to deal with page alignment myself. Are there any functions I'm missing which allow any address range to be mapped from guest physical to host virtual memory?

Best,
matthias
matthiasp
 
Posts: 3
Joined: 28. Feb 2019, 09:40

Re: Mapping guest physical memory to host virtual memory

Postby noteirak » 11. Jul 2019, 13:18

Moved to "VirtualBox OSE".
Hyperbox - Virtual Infrastructure Manager - https://kamax.io/hbox/
Manage your VirtualBox infrastructure the free way!
noteirak
Site Moderator
 
Posts: 5198
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7


Return to VirtualBox OSE

Who is online

Users browsing this forum: No registered users and 1 guest