From patchwork Sat Jun 15 01:51:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 251571 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 8D3E62C009E for ; Sat, 15 Jun 2013 11:52:45 +1000 (EST) Received: from localhost ([::1]:59867 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UnffX-0008QM-GU for incoming@patchwork.ozlabs.org; Fri, 14 Jun 2013 21:52:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43576) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Unff7-0008PO-HI for qemu-devel@nongnu.org; Fri, 14 Jun 2013 21:52:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Unfev-0002Z1-0v for qemu-devel@nongnu.org; Fri, 14 Jun 2013 21:52:17 -0400 Received: from ozlabs.org ([203.10.76.45]:39120) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Unfeu-0002WV-Ks; Fri, 14 Jun 2013 21:52:04 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id E9D722C00A1; Sat, 15 Jun 2013 11:52:00 +1000 (EST) From: David Gibson To: agraf@suse.de Date: Sat, 15 Jun 2013 11:51:51 +1000 Message-Id: <1371261112-17328-3-git-send-email-david@gibson.dropbear.id.au> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1371261112-17328-1-git-send-email-david@gibson.dropbear.id.au> References: <1371261112-17328-1-git-send-email-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 203.10.76.45 Cc: Alexey Kardashevskiy , qemu-ppc@nongnu.org, qemu-devel@nongnu.org, David Gibson Subject: [Qemu-devel] [PATCH 2/3] target-ppc kvm: save cr register 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: Alexey Kardashevskiy This adds a missing code to save CR (condition register) via kvm_arch_put_registers(). kvm_arch_get_registers() already has it. Signed-off-by: Alexey Kardashevskiy Signed-off-by: David Gibson --- target-ppc/kvm.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c index 2bbc3b8..c89dd58 100644 --- a/target-ppc/kvm.c +++ b/target-ppc/kvm.c @@ -791,6 +791,11 @@ int kvm_arch_put_registers(CPUState *cs, int level) for (i = 0;i < 32; i++) regs.gpr[i] = env->gpr[i]; + regs.cr = 0; + for (i = 0; i < 8; i++) { + regs.cr |= (env->crf[i] & 15) << (4 * (7 - i)); + } + ret = kvm_vcpu_ioctl(cs, KVM_SET_REGS, ®s); if (ret < 0) return ret;