From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:55461) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TM7bu-00081p-0J for qemu-devel@nongnu.org; Wed, 10 Oct 2012 21:30:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TM7bs-0003oW-0S for qemu-devel@nongnu.org; Wed, 10 Oct 2012 21:30:49 -0400 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Thu, 11 Oct 2012 03:30:08 +0200 Message-Id: <1349919009-28904-7-git-send-email-afaerber@suse.de> In-Reply-To: <1349919009-28904-1-git-send-email-afaerber@suse.de> References: <1349919009-28904-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH v2 6/7] spapr: Pass PowerPCCPU to spapr_hypercall() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: "open list:Overall" , Marcelo Tosatti , agraf@suse.de, qemu-ppc@nongnu.org, Avi Kivity , =?UTF-8?q?Andreas=20F=C3=A4rber?= , David Gibson Needed for changing the hypercall handlers' argument type to PowerPCCPU. Signed-off-by: Andreas F=C3=A4rber --- hw/spapr.c | 2 +- hw/spapr.h | 2 +- hw/spapr_hcall.c | 4 +++- target-ppc/kvm.c | 3 ++- 4 Dateien ge=C3=A4ndert, 7 Zeilen hinzugef=C3=BCgt(+), 4 Zeilen entfernt= (-) diff --git a/hw/spapr.c b/hw/spapr.c index 914d60c..ac1f7de 100644 --- a/hw/spapr.c +++ b/hw/spapr.c @@ -578,7 +578,7 @@ static void emulate_spapr_hypercall(PowerPCCPU *cpu) hcall_dprintf("Hypercall made with MSR[PR]=3D1\n"); env->gpr[3] =3D H_PRIVILEGE; } else { - env->gpr[3] =3D spapr_hypercall(env, env->gpr[3], &env->gpr[4]); + env->gpr[3] =3D spapr_hypercall(cpu, env->gpr[3], &env->gpr[4]); } } =20 diff --git a/hw/spapr.h b/hw/spapr.h index e984e3f..feea401 100644 --- a/hw/spapr.h +++ b/hw/spapr.h @@ -288,7 +288,7 @@ typedef target_ulong (*spapr_hcall_fn)(CPUPPCState *e= nv, sPAPREnvironment *spapr target_ulong *args); =20 void spapr_register_hypercall(target_ulong opcode, spapr_hcall_fn fn); -target_ulong spapr_hypercall(CPUPPCState *env, target_ulong opcode, +target_ulong spapr_hypercall(PowerPCCPU *cpu, target_ulong opcode, target_ulong *args); =20 int spapr_allocate_irq(int hint, bool lsi); diff --git a/hw/spapr_hcall.c b/hw/spapr_hcall.c index 194d9c2..1594f30 100644 --- a/hw/spapr_hcall.c +++ b/hw/spapr_hcall.c @@ -678,9 +678,11 @@ void spapr_register_hypercall(target_ulong opcode, s= papr_hcall_fn fn) *slot =3D fn; } =20 -target_ulong spapr_hypercall(CPUPPCState *env, target_ulong opcode, +target_ulong spapr_hypercall(PowerPCCPU *cpu, target_ulong opcode, target_ulong *args) { + CPUPPCState *env =3D &cpu->env; + if ((opcode <=3D MAX_HCALL_OPCODE) && ((opcode & 0x3) =3D=3D 0)) { spapr_hcall_fn fn =3D papr_hypercall_table[opcode / 4]; diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c index d7d8e8f..9d381ce 100644 --- a/target-ppc/kvm.c +++ b/target-ppc/kvm.c @@ -818,7 +818,8 @@ int kvm_arch_handle_exit(CPUPPCState *env, struct kvm= _run *run) #ifdef CONFIG_PSERIES case KVM_EXIT_PAPR_HCALL: dprintf("handle PAPR hypercall\n"); - run->papr_hcall.ret =3D spapr_hypercall(env, run->papr_hcall.nr, + run->papr_hcall.ret =3D spapr_hypercall(ppc_env_get_cpu(env), + run->papr_hcall.nr, run->papr_hcall.args); ret =3D 0; break; --=20 1.7.10.4