| 1 | Virtual to Physical Address Translator |
| 2 | ====================================== |
| 3 | |
| 4 | Purpose and Operation |
| 5 | --------------------- |
| 6 | |
| 7 | ``virt2phys`` driver allows user-mode processes to obtain physical address |
| 8 | of a given virtual address in their address space. |
| 9 | Virtual addresses must belong to regions from process private working set. |
| 10 | These regions must be physically contiguous. |
| 11 | The driver ensures that memory regions with translated addresses |
| 12 | are not swapped out as long as the process has access to this memory. |
| 13 | |
| 14 | It is not safe to administratively unload the driver |
| 15 | while there are processes that have used virt2phys to translate addresses. |
| 16 | Doing so will permanently leak RAM occupied by all memory regions |
| 17 | that contain translated addresses. |
| 18 | Terminate all such processes before unloading the driver. |
| 19 | |
| 20 | Configuration |
| 21 | ------------- |
| 22 | |
| 23 | ``virt2phys`` is configured at loading time via registry key |
| 24 | ``HKLM\SYSTEM\ControlSet001\Services\virt2phys\Parameters``. |
| 25 | |
| 26 | * ``ProcessCountLimit`` (default 16) |
| 27 | |
| 28 | Maximum number of processes that can have access to memory regions |
| 29 | with translated addresses. When this limit is reached, no more processes |
| 30 | can translate addresses using ``virt2phys``. Large number of tracked |
| 31 | processes may slow down system operation. Set limit to 0 to disable it. |
| 32 | |
| 33 | * ``ProcessMemoryLimitMB`` (default 16384, i.e. 16 GB) |
| 34 | |
| 35 | Maximum amount of memory in all regions that contain translated addresses, |
| 36 | total per process. When this limit is reached, the process can not translate |
| 37 | addresses from new regions. Large values can cause RAM exhaustion. |
| 38 | Set limit to 0 to disable it. |