2. 运行QEMU,static void render_memory_region(FlatView *view,
MemoryRegion *mr,
Int128 base,
AddrRange clip,
bool readonly){....
int alias = 0;
int sub = 0;.....if (mr->alias) {
alias = 1;
//printf("Liufeng: render_memory_region 1\n");
int128_subfrom(&base, int128_make64(mr->alias->addr));
int128_subfrom(&base, int128_make64(mr->alias_offset));
render_memory_region(view, mr->alias, base, clip, readonly);
return;
}
......
/* Render subregions in priority order. */
QTAILQ_FOREACH(subregion, &mr->subregions, subregions_link) {
sub = 1;
//printf("Liufeng: render_memory_region 2\n");
render_memory_region(view, subregion, base, clip, readonly);
}.....
/*这里加入是因为不用重复打印alias和sub, 因为它们是递归调用处理的*/
if(alias == 0 && sub == 0){
printf("Liufeng: render_memory_region mr.name = %s, offset_in_region = 0x%x\n",mr->name,offset_in_region);
}.....}
3. 在按照名字找各个memoryRegion在哪里注册的Liufeng: render_memory_region mr.name = vga.vram, offset_in_region = 0x8000
Liufeng: render_memory_region mr.name = vga.vram, offset_in_region = 0x0
Liufeng: render_memory_region mr.name = cirrus-low-memory, offset_in_region = 0x0
Liufeng: render_memory_region mr.name = hpet, offset_in_region = 0x0
Liufeng: render_memory_region mr.name = kvm-ioapic, offset_in_region = 0x0
Liufeng: render_memory_region mr.name = pc.ram, offset_in_region = 0xc0000000
Liufeng: render_memory_region mr.name = pc.ram, offset_in_region = 0x0
Liufeng: render_memory_region mr.name = msix-pba, offset_in_region = 0x0
Liufeng: render_memory_region mr.name = msix-table, offset_in_region = 0x0
Liufeng: render_memory_region mr.name = msix-pba, offset_in_region = 0x0
Liufeng: render_memory_region mr.name = msix-table, offset_in_region = 0x0
Liufeng: render_memory_region mr.name = cirrus-mmio, offset_in_region = 0x0
Liufeng: render_memory_region mr.name = vga.vram, offset_in_region = 0x0
Liufeng: render_memory_region mr.name = cirrus-bitblt-mmio, offset_in_region = 0x0
Liufeng: render_memory_region mr.name = cirrus-linear-io, offset_in_region = 0x0
Liufeng: render_memory_region mr.name = vga.vram, offset_in_region = 0x8000
Liufeng: render_memory_region mr.name = vga.vram, offset_in_region = 0x0
Liufeng: render_memory_region mr.name = cirrus-low-memory, offset_in_region = 0x0
Liufeng: render_memory_region mr.name = pc.rom, offset_in_region = 0x0
Liufeng: render_memory_region mr.name = pc.bios, offset_in_region = 0x20000
Liufeng: render_memory_region mr.name = pc.bios, offset_in_region = 0x0
Liufeng: render_memory_region mr.name = kvm-apic-msi, offset_in_region = 0x0
Liufeng: render_memory_region mr.name = pc.ram, offset_in_region = 0xcb000
Liufeng: render_memory_region mr.name = pc.ram, offset_in_region = 0xec000
Liufeng: render_memory_region mr.name = pc.ram, offset_in_region = 0xe8000
Liufeng: render_memory_region mr.name = pc.ram, offset_in_region = 0xe4000
Liufeng: render_memory_region mr.name = pc.ram, offset_in_region = 0xe0000
Liufeng: render_memory_region mr.name = pc.ram, offset_in_region = 0xdc000
Liufeng: render_memory_region mr.name = pc.ram, offset_in_region = 0xd8000
Liufeng: render_memory_region mr.name = pc.ram, offset_in_region = 0xd4000
Liufeng: render_memory_region mr.name = pc.ram, offset_in_region = 0xd0000
Liufeng: render_memory_region mr.name = pc.ram, offset_in_region = 0xcc000
Liufeng: render_memory_region mr.name = pc.ram, offset_in_region = 0xc8000
Liufeng: render_memory_region mr.name = pc.ram, offset_in_region = 0xc4000
Liufeng: render_memory_region mr.name = pc.ram, offset_in_region = 0xc0000
Liufeng: render_memory_region mr.name = pc.ram, offset_in_region = 0xf0000
Liufeng: render_memory_region mr.name = vga.vram, offset_in_region = 0x8000
Liufeng: render_memory_region mr.name = vga.vram, offset_in_region = 0x0
Liufeng: render_memory_region mr.name = cirrus-low-memory, offset_in_region = 0x0
Liufeng: render_memory_region mr.name = hpet, offset_in_region = 0x0
Liufeng: render_memory_region mr.name = kvm-ioapic, offset_in_region = 0x0
Liufeng: render_memory_region mr.name = pc.ram, offset_in_region = 0xc0000000
Liufeng: render_memory_region mr.name = pc.ram, offset_in_region = 0x0
Liufeng: render_memory_region mr.name = msix-pba, offset_in_region = 0x0
Liufeng: render_memory_region mr.name = msix-table, offset_in_region = 0x0
Liufeng: render_memory_region mr.name = msix-pba, offset_in_region = 0x0
Liufeng: render_memory_region mr.name = msix-table, offset_in_region = 0x0
Liufeng: render_memory_region mr.name = cirrus-mmio, offset_in_region = 0x0
Liufeng: render_memory_region mr.name = vga.vram, offset_in_region = 0x0
Liufeng: render_memory_region mr.name = cirrus-bitblt-mmio, offset_in_region = 0x0
Liufeng: render_memory_region mr.name = cirrus-linear-io, offset_in_region = 0x0
Liufeng: render_memory_region mr.name = vga.vram, offset_in_region = 0x8000
Liufeng: render_memory_region mr.name = vga.vram, offset_in_region = 0x0
Liufeng: render_memory_region mr.name = cirrus-low-memory, offset_in_region = 0x0
Liufeng: render_memory_region mr.name = pc.rom, offset_in_region = 0x0
Liufeng: render_memory_region mr.name = pc.bios, offset_in_region = 0x20000
Liufeng: render_memory_region mr.name = pc.bios, offset_in_region = 0x0
Liufeng: render_memory_region mr.name = kvm-apic-msi, offset_in_region = 0x0