From patchwork Thu Oct 11 01:30:08 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 1579731 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 17FFC40135 for ; Thu, 11 Oct 2012 01:31:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934114Ab2JKBax (ORCPT ); Wed, 10 Oct 2012 21:30:53 -0400 Received: from cantor2.suse.de ([195.135.220.15]:34288 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933910Ab2JKBas (ORCPT ); Wed, 10 Oct 2012 21:30:48 -0400 Received: from relay2.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 40CECA2FD6; Thu, 11 Oct 2012 03:30:46 +0200 (CEST) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Cc: agraf@suse.de, qemu-ppc@nongnu.org, =?UTF-8?q?Andreas=20F=C3=A4rber?= , David Gibson (supporter:sPAPR), Avi Kivity (supporter:Overall), Marcelo Tosatti (supporter:Overall), kvm@vger.kernel.org (open list:Overall) Subject: [PATCH v2 6/7] spapr: Pass PowerPCCPU to spapr_hypercall() Date: Thu, 11 Oct 2012 03:30:08 +0200 Message-Id: <1349919009-28904-7-git-send-email-afaerber@suse.de> X-Mailer: git-send-email 1.7.10.4 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 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Needed for changing the hypercall handlers' argument type to PowerPCCPU. Signed-off-by: Andreas Färber --- hw/spapr.c | 2 +- hw/spapr.h | 2 +- hw/spapr_hcall.c | 4 +++- target-ppc/kvm.c | 3 ++- 4 Dateien geändert, 7 Zeilen hinzugefügt(+), 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]=1\n"); env->gpr[3] = H_PRIVILEGE; } else { - env->gpr[3] = spapr_hypercall(env, env->gpr[3], &env->gpr[4]); + env->gpr[3] = spapr_hypercall(cpu, env->gpr[3], &env->gpr[4]); } } 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 *env, sPAPREnvironment *spapr target_ulong *args); 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); 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, spapr_hcall_fn fn) *slot = fn; } -target_ulong spapr_hypercall(CPUPPCState *env, target_ulong opcode, +target_ulong spapr_hypercall(PowerPCCPU *cpu, target_ulong opcode, target_ulong *args) { + CPUPPCState *env = &cpu->env; + if ((opcode <= MAX_HCALL_OPCODE) && ((opcode & 0x3) == 0)) { spapr_hcall_fn fn = 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 = spapr_hypercall(env, run->papr_hcall.nr, + run->papr_hcall.ret = spapr_hypercall(ppc_env_get_cpu(env), + run->papr_hcall.nr, run->papr_hcall.args); ret = 0; break;