From patchwork Sun Jun 30 01:44:57 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 255850 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 664D62C02F6 for ; Sun, 30 Jun 2013 11:57:52 +1000 (EST) Received: from localhost ([::1]:46506 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ut6ti-0007cT-JZ for incoming@patchwork.ozlabs.org; Sat, 29 Jun 2013 21:57:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34101) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ut6hi-0003d6-4o for qemu-devel@nongnu.org; Sat, 29 Jun 2013 21:45:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ut6hY-0007f3-Vn for qemu-devel@nongnu.org; Sat, 29 Jun 2013 21:45:25 -0400 Received: from cantor2.suse.de ([195.135.220.15]:37033 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ut6hY-0007ds-Ny; Sat, 29 Jun 2013 21:45:16 -0400 Received: from relay1.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id AC266A5387; Sun, 30 Jun 2013 03:45:14 +0200 (CEST) From: Alexander Graf To: qemu-ppc@nongnu.org Date: Sun, 30 Jun 2013 03:44:57 +0200 Message-Id: <1372556709-23868-21-git-send-email-agraf@suse.de> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1372556709-23868-1-git-send-email-agraf@suse.de> References: <1372556709-23868-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 , Alexey Kardashevskiy , qemu-devel@nongnu.org, Aurelien Jarno , David Gibson Subject: [Qemu-devel] [PATCH 20/32] 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 Signed-off-by: Alexander Graf --- 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;