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
Mapping guest physical memory to host virtual memory
-
- Site Moderator
- Posts: 5227
- Joined: 13. Jan 2012, 11:14
- Primary OS: Debian other
- VBox Version: OSE Debian
- Guest OSses: Debian, Win 2k8, Win 7
- Contact:
Re: Mapping guest physical memory to host virtual memory
Moved to "VirtualBox OSE".
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
Manage your VirtualBox infrastructure the free way!
Re: Mapping guest physical memory to host virtual memory
I also encountered the same problem, but I have not found a suitable solution. Does the virtualbox have a function similar to the cpu_physical_memory_map() ?
Using MMR3HyperMapGCPhys will crash when accessing 'if (pVM->mm.s.offHyperNextStatic + cbAligned >= pVM->mm.s.cbHyperArea)' .
Using MMR3HyperMapGCPhys will crash when accessing 'if (pVM->mm.s.offHyperNextStatic + cbAligned >= pVM->mm.s.cbHyperArea)' .