From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Subject: [PULL 17/43] target-s390x: Change handle_{hypercall,diag}() argument to S390CPU Date: Wed, 10 Jul 2013 16:33:54 +0200 Message-ID: <1373466860-32732-18-git-send-email-afaerber@suse.de> References: <1373466860-32732-1-git-send-email-afaerber@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: =?UTF-8?q?Andreas=20F=C3=A4rber?= , "Jason J. Herne" , Alexander Graf , Richard Henderson , Gleb Natapov , Paolo Bonzini , kvm@vger.kernel.org (open list:Overall) To: qemu-devel@nongnu.org Return-path: Received: from cantor2.suse.de ([195.135.220.15]:32775 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754591Ab3GJOeg (ORCPT ); Wed, 10 Jul 2013 10:34:36 -0400 In-Reply-To: <1373466860-32732-1-git-send-email-afaerber@suse.de> Sender: kvm-owner@vger.kernel.org List-ID: This allows to get rid of the last remaining ENV_GET_CPU() in target-s390x/ by using CPU() cast directly on the argument. Cc: Jason J. Herne Signed-off-by: Andreas F=C3=A4rber --- target-s390x/kvm.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c index af499cf..60e94f8 100644 --- a/target-s390x/kvm.c +++ b/target-s390x/kvm.c @@ -607,9 +607,10 @@ static int handle_priv(S390CPU *cpu, struct kvm_ru= n *run, return r; } =20 -static int handle_hypercall(CPUS390XState *env, struct kvm_run *run) +static int handle_hypercall(S390CPU *cpu, struct kvm_run *run) { - CPUState *cs =3D ENV_GET_CPU(env); + CPUState *cs =3D CPU(cpu); + CPUS390XState *env =3D &cpu->env; =20 kvm_s390_get_registers_partial(cs); cs->kvm_vcpu_dirty =3D true; @@ -618,13 +619,13 @@ static int handle_hypercall(CPUS390XState *env, s= truct kvm_run *run) return 0; } =20 -static int handle_diag(CPUS390XState *env, struct kvm_run *run, int ip= b_code) +static int handle_diag(S390CPU *cpu, struct kvm_run *run, int ipb_code= ) { int r =3D 0; =20 switch (ipb_code) { case DIAG_KVM_HYPERCALL: - r =3D handle_hypercall(env, run); + r =3D handle_hypercall(cpu, run); break; case DIAG_KVM_BREAKPOINT: sleep(10); @@ -735,7 +736,6 @@ out: =20 static int handle_instruction(S390CPU *cpu, struct kvm_run *run) { - CPUS390XState *env =3D &cpu->env; unsigned int ipa0 =3D (run->s390_sieic.ipa & 0xff00); uint8_t ipa1 =3D run->s390_sieic.ipa & 0x00ff; int ipb_code =3D (run->s390_sieic.ipb & 0x0fff0000) >> 16; @@ -749,7 +749,7 @@ static int handle_instruction(S390CPU *cpu, struct = kvm_run *run) r =3D handle_priv(cpu, run, ipa0 >> 8, ipa1); break; case IPA0_DIAG: - r =3D handle_diag(env, run, ipb_code); + r =3D handle_diag(cpu, run, ipb_code); break; case IPA0_SIGP: r =3D handle_sigp(cpu, run, ipa1); --=20 1.8.1.4 From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33361) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UwvTf-0008Vd-Ql for qemu-devel@nongnu.org; Wed, 10 Jul 2013 10:35:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UwvTZ-0003cE-3w for qemu-devel@nongnu.org; Wed, 10 Jul 2013 10:34:43 -0400 Received: from cantor2.suse.de ([195.135.220.15]:32777 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UwvTY-0003bX-MR for qemu-devel@nongnu.org; Wed, 10 Jul 2013 10:34:36 -0400 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Wed, 10 Jul 2013 16:33:54 +0200 Message-Id: <1373466860-32732-18-git-send-email-afaerber@suse.de> In-Reply-To: <1373466860-32732-1-git-send-email-afaerber@suse.de> References: <1373466860-32732-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] [PULL 17/43] target-s390x: Change handle_{hypercall, diag}() argument to S390CPU List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: "open list:Overall" , Gleb Natapov , Alexander Graf , "Jason J. Herne" , Paolo Bonzini , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Richard Henderson This allows to get rid of the last remaining ENV_GET_CPU() in target-s390x/ by using CPU() cast directly on the argument. Cc: Jason J. Herne Signed-off-by: Andreas F=C3=A4rber --- target-s390x/kvm.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c index af499cf..60e94f8 100644 --- a/target-s390x/kvm.c +++ b/target-s390x/kvm.c @@ -607,9 +607,10 @@ static int handle_priv(S390CPU *cpu, struct kvm_run = *run, return r; } =20 -static int handle_hypercall(CPUS390XState *env, struct kvm_run *run) +static int handle_hypercall(S390CPU *cpu, struct kvm_run *run) { - CPUState *cs =3D ENV_GET_CPU(env); + CPUState *cs =3D CPU(cpu); + CPUS390XState *env =3D &cpu->env; =20 kvm_s390_get_registers_partial(cs); cs->kvm_vcpu_dirty =3D true; @@ -618,13 +619,13 @@ static int handle_hypercall(CPUS390XState *env, str= uct kvm_run *run) return 0; } =20 -static int handle_diag(CPUS390XState *env, struct kvm_run *run, int ipb_= code) +static int handle_diag(S390CPU *cpu, struct kvm_run *run, int ipb_code) { int r =3D 0; =20 switch (ipb_code) { case DIAG_KVM_HYPERCALL: - r =3D handle_hypercall(env, run); + r =3D handle_hypercall(cpu, run); break; case DIAG_KVM_BREAKPOINT: sleep(10); @@ -735,7 +736,6 @@ out: =20 static int handle_instruction(S390CPU *cpu, struct kvm_run *run) { - CPUS390XState *env =3D &cpu->env; unsigned int ipa0 =3D (run->s390_sieic.ipa & 0xff00); uint8_t ipa1 =3D run->s390_sieic.ipa & 0x00ff; int ipb_code =3D (run->s390_sieic.ipb & 0x0fff0000) >> 16; @@ -749,7 +749,7 @@ static int handle_instruction(S390CPU *cpu, struct kv= m_run *run) r =3D handle_priv(cpu, run, ipa0 >> 8, ipa1); break; case IPA0_DIAG: - r =3D handle_diag(env, run, ipb_code); + r =3D handle_diag(cpu, run, ipb_code); break; case IPA0_SIGP: r =3D handle_sigp(cpu, run, ipa1); --=20 1.8.1.4