qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] Get host virtual address corresponding to guest physical ad


From: Wei-Ren Chen
Subject: [Qemu-devel] Get host virtual address corresponding to guest physical address?
Date: Fri, 24 Aug 2012 11:14:42 +0800
User-agent: Mutt/1.5.21 (2010-09-15)

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



reply via email to

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