Skip to contentSkip to conversation

Host virtual to target physical memory addresses

Qemu-devel Christoffer Dall 1 participant 1 message Oct 16, 2009

lore
Share & tools
lore
#0 lore raw

I am trying to find out how emulated physical addresses relate to host allocated virtual addresses for ARM system emulation.

Specifically, given a host virtual address allocated by QEMU for some memory region, I would like to find the corresponding guest (target) physical address.

I have gone through the code for the integrator board and for the main memory I can see that both qemu_ram_alloc and cpu_register_physical_memory are called. I understand that the first deals with actually allocating the virtual addresses needed for the memory area and the second registers the memory with the virtual CPU.

During cpu_register_physical_memory, eventually phys_page_find_alloc is called, and I can see that it is related to the software mmu code in target-arm/helper.c, but I am getting somewhat lost in the concepts RAMBlock, ram_offset and PhysPageDesc.

Is there some documentation on this that I can study or can anyone give me a quick run-down on the concepts?

Any help will be greatly appreciated.

Thank you.

Best regards,
Christoffer Dall