From patchwork Fri Apr 26 18:19:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 240025 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 480BD2C0106 for ; Sat, 27 Apr 2013 05:42:10 +1000 (EST) Received: from localhost ([::1]:54686 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVnIQ-00047f-2R for incoming@patchwork.ozlabs.org; Fri, 26 Apr 2013 14:22:58 -0400 Received: from eggs.gnu.org ([208.118.235.92]:54436) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVnFG-0007oO-AN for qemu-devel@nongnu.org; Fri, 26 Apr 2013 14:19:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UVnFA-0004De-Nj for qemu-devel@nongnu.org; Fri, 26 Apr 2013 14:19:42 -0400 Received: from cantor2.suse.de ([195.135.220.15]:38758 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVnFA-0004D1-8Q; Fri, 26 Apr 2013 14:19:36 -0400 Received: from relay1.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id A70075E000219; Fri, 26 Apr 2013 20:19:34 +0200 (CEST) From: Alexander Graf To: qemu-ppc@nongnu.org Date: Fri, 26 Apr 2013 20:19:32 +0200 Message-Id: <1367000373-7972-24-git-send-email-agraf@suse.de> X-Mailer: git-send-email 1.6.0.2 In-Reply-To: <1367000373-7972-1-git-send-email-agraf@suse.de> References: <1367000373-7972-1-git-send-email-agraf@suse.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-Received-From: 195.135.220.15 Cc: Blue Swirl , qemu-devel@nongnu.org, Aurelien Jarno , "Jason J. Herne" Subject: [Qemu-devel] [PATCH 23/24] Utilize selective runtime reg sync for hot code paths 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 From: Jason J. Herne Make use of new kvm_s390_get_registers_partial() for kvm_handle_css_inst() and handle_hypercall() since they only need registers from the partial set and they are called quite frequently. Signed-off-by: Jason J. Herne Signed-off-by: Alexander Graf --- target-s390x/kvm.c | 15 ++++++++++++--- 1 files changed, 12 insertions(+), 3 deletions(-) diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c index 02b2e39..fb006ee 100644 --- a/target-s390x/kvm.c +++ b/target-s390x/kvm.c @@ -467,12 +467,16 @@ static int kvm_handle_css_inst(S390CPU *cpu, struct kvm_run *run, int r = 0; int no_cc = 0; CPUS390XState *env = &cpu->env; + CPUState *cs = ENV_GET_CPU(env); if (ipa0 != 0xb2) { /* Not handled for now. */ return -1; } - cpu_synchronize_state(env); + + kvm_s390_get_registers_partial(cs); + cs->kvm_vcpu_dirty = true; + switch (ipa1) { case PRIV_XSCH: r = ioinst_handle_xsch(env, env->regs[1]); @@ -603,7 +607,10 @@ static int handle_priv(S390CPU *cpu, struct kvm_run *run, static int handle_hypercall(CPUS390XState *env, struct kvm_run *run) { - cpu_synchronize_state(env); + CPUState *cs = ENV_GET_CPU(env); + + kvm_s390_get_registers_partial(cs); + cs->kvm_vcpu_dirty = true; env->regs[2] = s390_virtio_hypercall(env); return 0; @@ -808,7 +815,9 @@ static int handle_tsch(S390CPU *cpu) struct kvm_run *run = cs->kvm_run; int ret; - cpu_synchronize_state(env); + kvm_s390_get_registers_partial(cs); + cs->kvm_vcpu_dirty = true; + ret = ioinst_handle_tsch(env, env->regs[1], run->s390_tsch.ipb); if (ret >= 0) { /* Success; set condition code. */