qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] PPC64: Fix timebase


From: Aurelien Jarno
Subject: Re: [Qemu-devel] [PATCH] PPC64: Fix timebase
Date: Mon, 21 Dec 2009 11:15:03 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

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
address@hidden                 http://www.aurel32.net




reply via email to

[Prev in Thread] Current Thread [Next in Thread]