From patchwork Fri Jan 15 13:49:12 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 73180 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id o0FDo85J018359 for ; Fri, 15 Jan 2010 13:50:08 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757330Ab0AONt2 (ORCPT ); Fri, 15 Jan 2010 08:49:28 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756380Ab0AONt1 (ORCPT ); Fri, 15 Jan 2010 08:49:27 -0500 Received: from cantor.suse.de ([195.135.220.2]:51614 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755564Ab0AONtQ (ORCPT ); Fri, 15 Jan 2010 08:49:16 -0500 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id F2B8C9417A; Fri, 15 Jan 2010 14:49:14 +0100 (CET) From: Alexander Graf To: kvm-ppc Cc: KVM General Subject: [PATCH 4/6] KVM: PPC: Fix initial GPR settings Date: Fri, 15 Jan 2010 14:49:12 +0100 Message-Id: <1263563354-11075-5-git-send-email-agraf@suse.de> X-Mailer: git-send-email 1.6.0.2 In-Reply-To: <1263563354-11075-1-git-send-email-agraf@suse.de> References: <1263563354-11075-1-git-send-email-agraf@suse.de> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org diff --git a/arch/powerpc/include/asm/kvm_book3s.h b/arch/powerpc/include/asm/kvm_book3s.h index e1b441c..db7db0a 100644 --- a/arch/powerpc/include/asm/kvm_book3s.h +++ b/arch/powerpc/include/asm/kvm_book3s.h @@ -22,7 +22,6 @@ #include #include -#include #include struct kvmppc_slb { diff --git a/arch/powerpc/include/asm/kvm_ppc.h b/arch/powerpc/include/asm/kvm_ppc.h index 09816da..e264282 100644 --- a/arch/powerpc/include/asm/kvm_ppc.h +++ b/arch/powerpc/include/asm/kvm_ppc.h @@ -28,6 +28,9 @@ #include #include #include +#ifdef CONFIG_PPC_BOOK3S +#include +#endif enum emulation_result { EMULATE_DONE, /* no further processing */ @@ -102,9 +105,10 @@ extern void kvmppc_core_destroy_mmu(struct kvm_vcpu *vcpu); static inline void kvmppc_set_gpr(struct kvm_vcpu *vcpu, int num, ulong val) { - if ( num < 14 ) + if ( num < 14 ) { get_paca()->shadow_vcpu.gpr[num] = val; - else + to_book3s(vcpu)->shadow_vcpu.gpr[num] = val; + } else vcpu->arch.gpr[num] = val; } @@ -119,6 +123,7 @@ static inline ulong kvmppc_get_gpr(struct kvm_vcpu *vcpu, int num) static inline void kvmppc_set_cr(struct kvm_vcpu *vcpu, u32 val) { get_paca()->shadow_vcpu.cr = val; + to_book3s(vcpu)->shadow_vcpu.cr = val; } static inline u32 kvmppc_get_cr(struct kvm_vcpu *vcpu) @@ -129,6 +134,7 @@ static inline u32 kvmppc_get_cr(struct kvm_vcpu *vcpu) static inline void kvmppc_set_xer(struct kvm_vcpu *vcpu, u32 val) { get_paca()->shadow_vcpu.xer = val; + to_book3s(vcpu)->shadow_vcpu.xer = val; } static inline u32 kvmppc_get_xer(struct kvm_vcpu *vcpu)