[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] Dump guest page table inside QEMU makes system hang
From: |
Wei-Ren Chen |
Subject: |
Re: [Qemu-devel] Dump guest page table inside QEMU makes system hang |
Date: |
Thu, 23 Aug 2012 11:55:19 +0800 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
> It's quite embarrassing. The code I posted before is buggy, and it dumps all
> 1024 * 1024 page table entries. It takes a lot of time, so that I think the
> system hangs. Attach is the code snipt what I am using, which works fine now.
> Another question is, I would like to know the hva corresponding to gpa (i.e.,
> the guest page pointed by guest pte). Do you happen to know there is such
> gpa2hva function in QEMU?
I think I found one, cpu_physical_memory_map (exec.c). Below is how I
convert gpa to hva by using cpu_physical_memory_map.
target_ulong pde_addr = (env->cr[3] + 32 * 4) & env->a20_mask;
target_phys_addr_t len = 4;
void *ptr = cpu_physical_memory_map(pde_addr, &len, 0);
The only thing I am not sure about is what value of len I should use.
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