From: Alexey Kardashevskiy <aik@ozlabs.ru>
To: qemu-devel@nongnu.org
Cc: Alexey Kardashevskiy <aik@ozlabs.ru>,
qemu-ppc@nongnu.org, Paul Mackerras <paulus@samba.org>,
Alexander Graf <agraf@suse.de>
Subject: [Qemu-devel] [PATCH v2] spapr-rtas: use softmmu for accessing rtas call parameters
Date: Fri, 6 Sep 2013 18:10:53 +1000 [thread overview]
Message-ID: <1378455053-18219-1-git-send-email-aik@ozlabs.ru> (raw)
On the real hardware, RTAS is called in real mode and therefore
ignores top 4 bits of the address passed in the call.
This fixes QEMU to use softmmu which can chop top 4 bits
if MSR DR is not set.
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---
Changes:
v2:
* masking from replaced with the use of cpu_ldl_data which can handle
realmode case properly
---
hw/ppc/spapr_hcall.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c
index 063bd36..30f90bf 100644
--- a/hw/ppc/spapr_hcall.c
+++ b/hw/ppc/spapr_hcall.c
@@ -4,6 +4,7 @@
#include "hw/ppc/spapr.h"
#include "mmu-hash64.h"
#include "cpu-models.h"
+#include "exec/softmmu_exec.h"
#include <libfdt.h>
@@ -523,10 +524,11 @@ static target_ulong h_cede(PowerPCCPU *cpu, sPAPREnvironment *spapr,
static target_ulong h_rtas(PowerPCCPU *cpu, sPAPREnvironment *spapr,
target_ulong opcode, target_ulong *args)
{
+ CPUPPCState *env = &cpu->env;
target_ulong rtas_r3 = args[0];
- uint32_t token = ldl_be_phys(rtas_r3);
- uint32_t nargs = ldl_be_phys(rtas_r3 + 4);
- uint32_t nret = ldl_be_phys(rtas_r3 + 8);
+ uint32_t token = cpu_ldl_data(env, rtas_r3);
+ uint32_t nargs = cpu_ldl_data(env, rtas_r3 + 4);
+ uint32_t nret = cpu_ldl_data(env, rtas_r3 + 8);
return spapr_rtas_call(cpu, spapr, token, nargs, rtas_r3 + 12,
nret, rtas_r3 + 12 + 4*nargs);
--
1.8.4.rc4
next reply other threads:[~2013-09-06 8:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-06 8:10 Alexey Kardashevskiy [this message]
2013-09-06 8:45 ` [Qemu-devel] [PATCH v2] spapr-rtas: use softmmu for accessing rtas call parameters Alexander Graf
2013-09-06 9:42 ` 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=1378455053-18219-1-git-send-email-aik@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).