From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:43920) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S2zNK-0002dO-Q5 for qemu-devel@nongnu.org; Thu, 01 Mar 2012 01:20:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S2zNI-00035i-P6 for qemu-devel@nongnu.org; Thu, 01 Mar 2012 01:20:26 -0500 Received: from [222.73.24.84] (port=56690 helo=song.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S2zNI-00035E-Dp for qemu-devel@nongnu.org; Thu, 01 Mar 2012 01:20:24 -0500 Message-ID: <4F4F1571.8040505@cn.fujitsu.com> Date: Thu, 01 Mar 2012 14:21:37 +0800 From: Wen Congyang MIME-Version: 1.0 References: <4F4EE080.9060307@cn.fujitsu.com> <4F4EE1EB.9080409@cn.fujitsu.com> <20120301.151336.434290214.d.hatayama@jp.fujitsu.com> In-Reply-To: <20120301.151336.434290214.d.hatayama@jp.fujitsu.com> Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [Qemu-devel] [RFC][PATCH 03/14 v7] target-i386: implement cpu_get_memory_mapping() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: HATAYAMA Daisuke Cc: jan.kiszka@siemens.com, anderson@redhat.com, qemu-devel@nongnu.org, eblake@redhat.com, lcapitulino@redhat.com At 03/01/2012 02:13 PM, HATAYAMA Daisuke Wrote: > From: Wen Congyang > Subject: [RFC][PATCH 03/14 v7] target-i386: implement cpu_get_memory_mapping() > Date: Thu, 01 Mar 2012 10:41:47 +0800 > >> +int cpu_get_memory_mapping(MemoryMappingList *list, CPUState *env) >> +{ >> + if (env->cr[4] & CR4_PAE_MASK) { >> +#ifdef TARGET_X86_64 >> + if (env->hflags & HF_LMA_MASK) { >> + target_phys_addr_t pml4e_addr; >> + >> + pml4e_addr = (env->cr[3] & ~0xfff) & env->a20_mask; >> + walk_pml4e(list, pml4e_addr, env->a20_mask); >> + } else >> +#endif >> + { >> + target_phys_addr_t pdpe_addr; >> + >> + pdpe_addr = (env->cr[3] & ~0x1f) & env->a20_mask; >> + walk_pdpe2(list, pdpe_addr, env->a20_mask); >> + } >> + } else { >> + target_phys_addr_t pde_addr; >> + bool pse; >> + >> + pde_addr = (env->cr[3] & ~0xfff) & env->a20_mask; >> + pse = !!(env->cr[4] & CR4_PSE_MASK); >> + walk_pde2(list, pde_addr, env->a20_mask, pse); >> + } >> + >> + return 0; >> +} > > Does this assume paging mode? I don't know qemu very well, but qemu > dump command runs externally to guest machine, so I think the machine > could be in the state with paging disabled where CR4 doesn't refer to > page table as expected. CR4? I think you want to say CR3. Yes, the guest may be in the state without paging mode. I will fix it. Thanks Wen Congyang > > Thanks. > HATAYAMA, Daisuke > >