qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Nathan Whitehorn <nwhitehorn@freebsd.org>
To: Alexander Graf <agraf@suse.de>
Cc: qemu-devel@nongnu.org, Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH] ppc64: fix mtmsr behavior on 64-bit targets
Date: Sun, 05 Jun 2011 08:33:11 -0500	[thread overview]
Message-ID: <4DEB8597.8050906@freebsd.org> (raw)
In-Reply-To: <1EA846CC-A2F8-4677-9012-ACEEC78F3B12@suse.de>

On 06/05/11 04:00, Alexander Graf wrote:
> On 04.06.2011, at 21:28, Nathan Whitehorn wrote:
>
>> On 05/31/11 12:40, Richard Henderson wrote:
>>> On 05/31/2011 07:56 AM, Nathan Whitehorn wrote:
>>>>   #if defined(TARGET_PPC64)
>>>> -        if (!ctx->sf_mode) {
>>>>               TCGv t0 = tcg_temp_new();
>>>>               TCGv t1 = tcg_temp_new();
>>> You're removing a scope in which these variables were defined.
>>> That seems wrong, at minimum.
>>>
>> I'll fix that (and resend the patch), thanks. A note on this: it looks like a lot of code here incorrectly changes behavior depending on the setting of MSR[SF]. While most of them aren't checking the condition the wrong way, like here, MSR[SF] actually changes very few aspects of the processor's operation. Turning MSR[SF] on or off on a 64-bit CPU basically only affects whether it pays attention to the high 32-bits of addresses when doing loads, stores, and branches -- 64-bit arithmetic, comparisons, registers, etc. are all available whatever the setting of MSR[SF].
> Not sure I understand what you mean. You can't access the upper 32 bits since the instructions are not available when !SF. Also, some subtile behavior changes.
>
> If you for example run "lis x,-1" in !SF on a 64-bit machine, the full register value becomes 0xffffffffffffffff while in SF mode it becomes 0xffffffff. Maybe there are some parts in the code that are not correct, but !SF on 64-bit is very subtile :).

Is that actually true, though? The architecture manual says nothing 
about it, and on both Cell and 970 systems (the hardware I had handy), 
as well as IBM Systemsim, lis x,-1 gives 0xffffffffffffff00 irrespective 
of the value of MSR[SF].
-Nathan

  reply	other threads:[~2011-06-05 13:33 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-31 14:56 [Qemu-devel] [PATCH] ppc64: fix mtmsr behavior on 64-bit targets Nathan Whitehorn
2011-05-31 16:48 ` Alexander Graf
2011-05-31 17:40 ` Richard Henderson
2011-06-04 19:28   ` Nathan Whitehorn
2011-06-05  9:00     ` Alexander Graf
2011-06-05 13:33       ` Nathan Whitehorn [this message]
2011-06-05 13:36         ` Nathan Whitehorn
2011-06-05 13:45         ` Alexander Graf
2011-06-12 15:49           ` [Qemu-devel] [PATCH2] " Nathan Whitehorn
2011-06-13 10:20             ` Alexander Graf
2011-06-13 12:52               ` Nathan Whitehorn
2011-06-13 13:17                 ` 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=4DEB8597.8050906@freebsd.org \
    --to=nwhitehorn@freebsd.org \
    --cc=agraf@suse.de \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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).