qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: Aurelien Jarno <aurelien@aurel32.net>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] PPC64: Fix timebase
Date: Mon, 21 Dec 2009 17:04:19 +0100	[thread overview]
Message-ID: <4B2F9C83.8060004@suse.de> (raw)
In-Reply-To: <20091221150558.GC4990@volta.aurel32.net>

Aurelien Jarno wrote:
> On Mon, Dec 21, 2009 at 12:15:42PM +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).
>>> - the store function also has to be fixed.
>>> - the same changes should be done for the alternate timebase.
>>>       
>
> They are defined in the Book II, and corresponds to atbl and atbu
> functions.
>
>   
>> Uuuh:
>>
>> __attribute__ (( unused ))
>> static void spr_read_atbl (void *opaque, int gprn, int sprn)
>> {
>>     gen_helper_load_atbl(cpu_gpr[gprn]);
>> }
>>
>> And that attribute is correct. There is no caller.
>>
>>     
>
> Ok. I have committed a fix anyway, so that if someone enable it later,
> he/she doesn't spend to much time fixing the bug.
>   

Thanks :-).

Alex

  reply	other threads:[~2009-12-21 16:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-21  0:22 [Qemu-devel] [PATCH] PPC64: Fix timebase Alexander Graf
2009-12-21  9:24 ` Aurelien Jarno
2009-12-21  9:39   ` Alexander Graf
2009-12-21 10:15     ` Aurelien Jarno
2009-12-21 20:19       ` Andreas Färber
2009-12-21 11:12   ` Alexander Graf
2009-12-21 11:15   ` Alexander Graf
2009-12-21 15:05     ` Aurelien Jarno
2009-12-21 16:04       ` Alexander Graf [this message]
  -- strict thread matches above, loose matches on Subject: below --
2009-12-21 11:24 Alexander Graf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B2F9C83.8060004@suse.de \
    --to=agraf@suse.de \
    --cc=aurelien@aurel32.net \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).