qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alexey Kardashevskiy <aik@ozlabs.ru>
To: Alexander Graf <agraf@suse.de>
Cc: "qemu-ppc@nongnu.org" <qemu-ppc@nongnu.org>,
	Paul Mackerras <paulus@samba.org>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] spapr-rtas: reset top 4 bits in parameters address
Date: Thu, 05 Sep 2013 17:40:46 +1000	[thread overview]
Message-ID: <5228357E.7000106@ozlabs.ru> (raw)
In-Reply-To: <AE31B6A8-0061-4C9A-9CFE-39FA36831C41@suse.de>

On 09/05/2013 05:08 PM, Alexander Graf wrote:
> 
> 
> Am 05.09.2013 um 07:58 schrieb Alexey Kardashevskiy <aik@ozlabs.ru>:
> 
>> On the real hardware, RTAS is called in real mode and therefore
>> ignores top 4 bits of the address passed in the call.
> 
> Shouldn't we ignore the upper 4 bits for every memory access in real mode, not just that one parameter?

We probably should but I just do not see any easy way of doing this. Yet
another "Ignore N bits on the top" memory region type? No idea.

This particular patch was born after discovering GCC 4.8.0 bug with not
doing -0xc000.0000.0000.0000 correctly and this would not be a problem on
the real hardware. So I would think there are kernel somewhere which have
this bug. And there are few (honestly I found only one place and the patch
fixes it) places which can fail because of this GCC bug. So the patch does
make sense for Paul and myself.

btw the patch is wrong, I should do this in a different place, sorry about
that :)


> 
> Alex
> 
>>
>> This fixes QEMU to do the same thing.
>>
>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>> ---
>> hw/ppc/spapr_rtas.c | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c
>> index eb542f2..ab03d67 100644
>> --- a/hw/ppc/spapr_rtas.c
>> +++ b/hw/ppc/spapr_rtas.c
>> @@ -240,7 +240,8 @@ target_ulong spapr_rtas_call(PowerPCCPU *cpu, sPAPREnvironment *spapr,
>>         struct rtas_call *call = rtas_table + (token - TOKEN_BASE);
>>
>>         if (call->fn) {
>> -            call->fn(cpu, spapr, token, nargs, args, nret, rets);
>> +            call->fn(cpu, spapr, token, nargs, args & 0x0FFFFFFFFFFFFFFFUL,
>> +                     nret, rets);
>>             return H_SUCCESS;
>>         }
>>     }
>> -- 
>> 1.8.4.rc4
>>


-- 
Alexey

  reply	other threads:[~2013-09-05  7:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-05  5:58 [Qemu-devel] [PATCH] spapr-rtas: reset top 4 bits in parameters address Alexey Kardashevskiy
2013-09-05  7:08 ` Alexander Graf
2013-09-05  7:40   ` Alexey Kardashevskiy [this message]
2013-09-05  9:27     ` Alexander Graf
2013-09-05 10:17       ` Alexey Kardashevskiy
2013-09-05 10:21         ` Alexander Graf
2013-09-05 12:04           ` Alexey Kardashevskiy
2013-09-05 12:16             ` Alexander Graf
2013-09-05 12:49               ` Alexey Kardashevskiy
2013-09-05 13:08                 ` Alexander Graf
2013-09-05 14:24                   ` Alexey Kardashevskiy
2013-09-06  5:04                     ` Alexey Kardashevskiy
2013-09-06  6:22                       ` Alexander Graf
2013-09-06  6:43                         ` Alexey Kardashevskiy

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=5228357E.7000106@ozlabs.ru \
    --to=aik@ozlabs.ru \
    --cc=agraf@suse.de \
    --cc=paulus@samba.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@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).