From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NMfIA-0003Rg-Bi for qemu-devel@nongnu.org; Mon, 21 Dec 2009 05:15:06 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NMfI9-0003RC-MV for qemu-devel@nongnu.org; Mon, 21 Dec 2009 05:15:05 -0500 Received: from [199.232.76.173] (port=38482 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NMfI9-0003R2-Bw for qemu-devel@nongnu.org; Mon, 21 Dec 2009 05:15:05 -0500 Received: from hall.aurel32.net ([88.191.82.174]:55254) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NMfI8-0000WR-QW for qemu-devel@nongnu.org; Mon, 21 Dec 2009 05:15:05 -0500 Date: Mon, 21 Dec 2009 11:15:03 +0100 From: Aurelien Jarno Subject: Re: [Qemu-devel] [PATCH] PPC64: Fix timebase Message-ID: <20091221101503.GZ24729@hall.aurel32.net> References: <1261354932-28003-1-git-send-email-agraf@suse.de> <20091221092455.GA4990@volta.aurel32.net> <10B77430-E0AC-47B8-AB71-8BD528A11C5F@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <10B77430-E0AC-47B8-AB71-8BD528A11C5F@suse.de> Sender: Aurelien Jarno List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: qemu-devel@nongnu.org On Mon, Dec 21, 2009 at 10:39:39AM +0100, Alexander Graf wrote: > > On 21.12.2009, at 10:24, Aurelien Jarno wrote: > > > On Mon, Dec 21, 2009 at 01:22:12AM +0100, Alexander Graf wrote: > >> On PPC we have a 64-bit time base. Usually (PPC32) this is accessed using > >> two separate 32 bit SPR accesses to SPR_TBU and SPR_TBL. > >> > >> On PPC64 the SPR_TBL register acts as 64 bit though, so we get the full > >> 64 bits as return value. If we only take the lower ones, fine. But Linux > >> wants to see all 64 bits or it breaks. > > > > Good catch! However, I think this patch it's not fully complete and can > > be improved a bit > > - it's probably better to return a target_ulong value from > > cpu_ppc_load_tbl() with an explicit cast here, so that we don't have > > an implicit cast from 64-bit to 32-bit on qemu-system-powerpc (GCC may > > warn on that with some flags or in future versions). > > ppc.c is in hw, so I suspect it's in the target independent makefile part? Otherwise we should move all TB stuff to target-ppc. Correct. then let's return uint64_t for cpu_ppc_load_tbl(), but do the explicit cast in the helper. -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net