Received: from eggs.gnu.org ([208.118.235.92]:48192) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T4OW2-0000ph-TI for qemu-devel@nongnu.org; Wed, 22 Aug 2012 23:55:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T4OW0-0005cG-GG for qemu-devel@nongnu.org; Wed, 22 Aug 2012 23:55:30 -0400 Received: from csmailer.cs.nctu.edu.tw ([140.113.235.130]:42862) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T4OVz-0005WT-Ve for qemu-devel@nongnu.org; Wed, 22 Aug 2012 23:55:28 -0400 Date: Thu, 23 Aug 2012 11:55:19 +0800 From: =?utf-8?B?6Zmz6Z+L5Lu7IChXZWktUmVuIENoZW4p?= Message-ID: <20120823035519.GA29310@cs.nctu.edu.tw> References: <20120821072134.GA81486@cs.nctu.edu.tw> <20120823025337.GA27969@cs.nctu.edu.tw> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20120823025337.GA27969@cs.nctu.edu.tw> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] Dump guest page table inside QEMU makes system hang List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Filippov Cc: Blue Swirl , qemu-devel@nongnu.org > It's quite embarrassing. The code I posted before is buggy, and it du= mps 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 fin= e 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 su= ch > 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 =3D (env->cr[3] + 32 * 4) & env->a20_mask; target_phys_addr_t len =3D 4; void *ptr =3D 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 --=20 Wei-Ren Chen (=E9=99=B3=E9=9F=8B=E4=BB=BB) 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