qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Get host virtual address corresponding to guest physical address?
@ 2012-08-24  3:14 陳韋任 (Wei-Ren Chen)
  2012-08-25  8:02 ` Blue Swirl
  2012-08-25 10:56 ` Peter Maydell
  0 siblings, 2 replies; 6+ messages in thread
From: 陳韋任 (Wei-Ren Chen) @ 2012-08-24  3:14 UTC (permalink / raw)
  To: qemu-devel

Hi all,

  I would like to know if there is a function in QEMU which converts
a guest physical address into corresponding host virtual address. I
guess cpu_physical_memory_map (exec.c) can do the job, but I have a
few questions.

  1. I am running x86 guest on a x86_64 host and using the cod below
     to get the host virtual address, I am not sure what value of len
     should be.

        static inline void *gpa2hva(target_phys_addr_t addr)
        {
            target_phys_addr_t len = 4;
            return cpu_physical_memory_map(addr, &len, 0);
        }

  2. There is a function "cpu_physical_memory_unmap", the comment
     of it says,

       Unmaps a memory region previously mapped by cpu_physical_memory_map().

     That makes me not sure if I use cpu_physical_memory_map correctly,
     does it do what I want to do?

Regards,
chenwj

-- 
Wei-Ren Chen (陳韋任)
Computer Systems Lab, Institute of Information Science,
Academia Sinica, Taiwan (R.O.C.)
Tel:886-2-2788-3799 #1667
Homepage: http://people.cs.nctu.edu.tw/~chenwj

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-08-26 17:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-24  3:14 [Qemu-devel] Get host virtual address corresponding to guest physical address? 陳韋任 (Wei-Ren Chen)
2012-08-25  8:02 ` Blue Swirl
2012-08-25 10:56 ` Peter Maydell
2012-08-25 13:17   ` 陳韋任 (Wei-Ren Chen)
2012-08-25 14:32     ` Peter Maydell
2012-08-26 17:45     ` Blue Swirl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).