Received: from eggs.gnu.org ([208.118.235.92]:41876) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T4qB9-0003AY-0a for qemu-devel@nongnu.org; Fri, 24 Aug 2012 05:27:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T4qB7-0004Pk-KX for qemu-devel@nongnu.org; Fri, 24 Aug 2012 05:27:46 -0400 Received: from csmailer.cs.nctu.edu.tw ([140.113.235.130]:40498) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T4qB7-0004PF-2w for qemu-devel@nongnu.org; Fri, 24 Aug 2012 05:27:45 -0400 Date: Fri, 24 Aug 2012 17:27:40 +0800 From: =?utf-8?B?6Zmz6Z+L5Lu7IChXZWktUmVuIENoZW4p?= Message-ID: <20120824092740.GA70282@cs.nctu.edu.tw> References: <20120824033401.GB62168@cs.nctu.edu.tw> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: quoted-printable Subject: Re: [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: Peter Maydell Cc: qemu-devel@nongnu.org, =?utf-8?B?6Zmz6Z+L5Lu7IChXZWktUmVuIENoZW4p?= > In principle, yes, but you need to check the code carefully to make > sure your type change doesn't change any of the results. (Or if it > does, you then need to confirm against the specs that this was a bug > that is being fixed, not a new one being introduced). The thing you hav= e > to remember is that for the 32 bit x86 cores guest physical addresses > are only 32 bits but target_phys_addr_t is still a 64 bit type. Yes, I saw in configure x86 and x86_64 both have target_phys_bits set to 64. --- case "$target_arch2" in i386) target_phys_bits=3D64 ;; if test "$target_softmmu" =3D "yes" ; then echo "TARGET_PHYS_ADDR_BITS=3D$target_phys_bits" >> $config_target_mak --- So that in targphys.h, it typedef target_phys_addr_t to uint_64, #elif TARGET_PHYS_ADDR_BITS =3D=3D 64 typedef uint64_t target_phys_addr_t; > It may be we're deliberately (mis)using target_ulong to get the > right behaviour on both 32 and 64 bit cores. Need to be further investigated. :) 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