Received: from eggs.gnu.org ([208.118.235.92]:36359) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T4keu-0002RD-HO for qemu-devel@nongnu.org; Thu, 23 Aug 2012 23:34:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T4ket-0003G4-7s for qemu-devel@nongnu.org; Thu, 23 Aug 2012 23:34:08 -0400 Received: from csmailer.cs.nctu.edu.tw ([140.113.235.130]:53036) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T4kes-0003Fz-AZ for qemu-devel@nongnu.org; Thu, 23 Aug 2012 23:34:07 -0400 Received: from csmailer.cs.nctu.edu.tw (localhost [127.0.0.1]) by csmailer.cs.nctu.edu.tw (Postfix) with ESMTP id 0BB60423 for ; Fri, 24 Aug 2012 11:34:03 +0800 (CST) Received: from alumni.cs.nctu.edu.tw (alumni.cs.nctu.edu.tw [140.113.235.116]) by csmailer.cs.nctu.edu.tw (Postfix) with ESMTP id E3500422 for ; Fri, 24 Aug 2012 11:34:02 +0800 (CST) Received: (from chenwj@localhost) by alumni.cs.nctu.edu.tw (8.14.4/8.14.4/Submit) id q7O3Y1vK063506 for qemu-devel@nongnu.org; Fri, 24 Aug 2012 11:34:01 +0800 (CST) (envelope-from chenwj) Date: Fri, 24 Aug 2012 11:34:01 +0800 From: =?utf-8?B?6Zmz6Z+L5Lu7IChXZWktUmVuIENoZW4p?= Message-ID: <20120824033401.GB62168@cs.nctu.edu.tw> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] What's the proper type of guest pde address, target_ulong or target_phys_addr_t? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Hi all, When I read cpu_get_phys_page_debug (target-i386/helper.c), I found the type of pde_addr and pte_addr might be not correct. See below, --- target_phys_addr_t cpu_get_phys_page_debug(CPUX86State *env, target_ulong= addr) { target_ulong pde_addr, pte_addr; ... pde_addr =3D ((pdpe & ~0xfff & ~(PG_NX_MASK | PG_HI_USER_MASK)) + (((addr >> 21) & 0x1ff) << 3)) & env->a20_mask; pde =3D ldq_phys(pde_addr); ... } --- HACKING says target_ulong is for guest virtual address and target_phys_ad= dr_t is for guest physical address. IIUC, pde_addr and pte_addr should be the guest physical address for guest page table and guest page respectively, right? If no one object, I'll send a patch which replaces target_ulong with target_phys_addr_t. Thanks. 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