qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Host virtual address --> Guest physical address


From: Liaojianwei
Subject: [Qemu-devel] Host virtual address --> Guest physical address
Date: Wed, 29 Jul 2009 20:49:49 +0900
User-agent: Thunderbird 2.0.0.21 (X11/20090320)

hi,
i am using qemu 0.10.5, it is great. however, i was troubled by address translation doubt:
1) (void *ptr ) , which defined in cpu-all.h, is a host virtual address?
2) in exec.c, why i cannot get the guest physical address by calling qemu_ram_addr_from_host(ptr)? the variable called phys_ram_base is not exist. if i want get the guest physical address from host virtual address (ptr), how should i do?
here is a test example, it may make myself understood.
write (0x10000000, 1)------pseudocode, write char '1' to physical address 0x10000000. the following instruction will be called if this instruction is finished.
      int value = ldl_phys(0x10000000);
fprintf(fp, "ptr is %x, physaddr is %x, value at ptr is %c, value is %c\n", \
           ptr,  qemu_ram_addr_from_host(ptr), *ptr, value);
i will get:
"ptr is 9b44d879, physaddr is 893879, value at ptr is 1, value is 1" ,
no doubt that write is okay because i can get char '1'. however, why is the physaddr wrong? am i using incorrect function to do address transfer? thank you very much, any help will be appreciated! i do not subscribe to the mailing list, you can reply me directly.
best regards, for you,,also for me :)
tony,




reply via email to

[Prev in Thread] Current Thread [Next in Thread]