Jump to navigation Jump to search


Introduce a new API for registration RAM regions of memory.



We register all types of memory through a single API today (cpu_register_physical_memory). RAM memory is registered as IO_MEM_RAM but not all IO_MEM_RAM is RAM. In certain cases, PCI IO regions are mapped as IO_MEM_RAM as an optimization. While device memory tends to be transient, RAM mappings are almost always consistent throughout the life time of the VM.

All of our mapping APIs assume that all memory mappings are transient. This assumption is too conservative for a lot of applications (like virtio) and leads to a measurable performance overhead in constantly looking up the same mappings in the fast path.

This new API should provide an interface for registration RAM regions along with a new API to map RAM regions. This would allow devices to attempt to map what they think are RAM, and provided it succeeds, use the persistent mapping. For devices like virtio, if a ring is located in a non-RAM region, we can error out.