I am writing a kernel module in a guest operating system that will run on a virtual machine using KVM. Here I want to allocate a memory page at a specific physical address. kmalloc () gives me memory, but at the physical address chosen by the OS.
Reference Information. I am writing a device emulation method in qemu that would not exit when a guest contacts the device (it goes, for example, to I / O cards, as well as to the displayed ports). The basic idea is this: the guest device driver will write to the specific (guest) address of the physical memory. The thread in the qemu process will continuously check it to check for new data (through some status bits, etc.). And take action accordingly, without causing an exit. Since there is no (existing) way in which a guest can tell the host which address is used by the device driver, I want a predefined memory page to be allocated for it.
source share