Skip to contentSkip to conversation

MMU and Physical<->Virtual address conversion

Qemu-devel Shane Hummer-Smith 2 participants 2 messages Jun 21, 2007

lore
Share & tools
lore
#0 lore raw

Hello,

I am trying to experiment with the memory management unit in QEMU, but I don't seem to be able to wrap my head around the source code. Can somebody help me figure out how the physical to virtual address translation and vice-versa is implemented in QEMU? Any pointer would be appreciated. Thanks much!

--S

#1 lore raw
Quoted 7 lines · Shane Hummer-Smith

Hello,

I am trying to experiment with the memory management unit in QEMU, but I don't seem to be able to wrap my head around the source code. Can somebody help me figure out how the physical to virtual address translation and vice-versa is implemented in QEMU? Any pointer would be appreciated. Thanks much!

-------------------------
The address translation things in full system mode is handled by the so called SoftMMU, which translate gVA->hEA. gEA->gVA is known as address calculation and handled in insn translation. gVA->gPA is handled by SoftMMU using Guest Page Table, gPA->hEA is handled by SoftMMU using two-level-table of PhyPageDesc structures. There is again TLB which translate gVA->hEA directly.

SoftMMU code is mainly in softmmu_header.h, softmmu_template.h, things related to PhyPageDesc...

Signature · 8 lines
《东郊》
作者:韦应物
吏舍局终年,出郊旷清曙。
杨柳散和风,青山澹吾虑。
依丛适自憩,缘涧还复去。
微雨霭芳原,春鸠鸣何处。
乐幽心屡止,遵事迹犹遽。
终罢斯结庐,慕陶真可庶。