From patchwork Fri Sep 6 08:10:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kardashevskiy X-Patchwork-Id: 273118 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A943F2C00EC for ; Fri, 6 Sep 2013 18:11:49 +1000 (EST) Received: from localhost ([::1]:35714 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VHr8s-0000Rl-Mi for incoming@patchwork.ozlabs.org; Fri, 06 Sep 2013 04:11:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48345) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VHr8U-0000RW-PA for qemu-devel@nongnu.org; Fri, 06 Sep 2013 04:11:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VHr8M-0004rV-HI for qemu-devel@nongnu.org; Fri, 06 Sep 2013 04:11:22 -0400 Received: from e23smtp05.au.ibm.com ([202.81.31.147]:35264) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VHr8L-0004r5-UG for qemu-devel@nongnu.org; Fri, 06 Sep 2013 04:11:14 -0400 Received: from /spool/local by e23smtp05.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 6 Sep 2013 18:03:34 +1000 Received: from d23dlp03.au.ibm.com (202.81.31.214) by e23smtp05.au.ibm.com (202.81.31.211) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 6 Sep 2013 18:03:33 +1000 Received: from d23relay03.au.ibm.com (d23relay03.au.ibm.com [9.190.235.21]) by d23dlp03.au.ibm.com (Postfix) with ESMTP id 587E8357804E; Fri, 6 Sep 2013 18:10:59 +1000 (EST) Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.235.138]) by d23relay03.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r868AkbT60424244; Fri, 6 Sep 2013 18:10:48 +1000 Received: from d23av02.au.ibm.com (localhost [127.0.0.1]) by d23av02.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id r868AuYZ014764; Fri, 6 Sep 2013 18:10:56 +1000 Received: from ozlabs.au.ibm.com (ozlabs.au.ibm.com [9.190.163.12]) by d23av02.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id r868Auip014761; Fri, 6 Sep 2013 18:10:56 +1000 Received: from bran.ozlabs.ibm.com (haven.au.ibm.com [9.190.164.82]) by ozlabs.au.ibm.com (Postfix) with ESMTP id 64986A0161; Fri, 6 Sep 2013 18:10:56 +1000 (EST) Received: from ka1.ozlabs.ibm.com (ka1.ozlabs.ibm.com [10.61.145.11]) by bran.ozlabs.ibm.com (Postfix) with ESMTP id 113C616AAFF; Fri, 6 Sep 2013 18:10:55 +1000 (EST) From: Alexey Kardashevskiy To: qemu-devel@nongnu.org Date: Fri, 6 Sep 2013 18:10:53 +1000 Message-Id: <1378455053-18219-1-git-send-email-aik@ozlabs.ru> X-Mailer: git-send-email 1.8.4.rc4 X-TM-AS-MML: No X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13090608-1396-0000-0000-00000383A598 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 202.81.31.147 Cc: Alexey Kardashevskiy , qemu-ppc@nongnu.org, Paul Mackerras , Alexander Graf Subject: [Qemu-devel] [PATCH v2] spapr-rtas: use softmmu for accessing rtas call parameters X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 --- 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 @@ -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);