aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/kvm_ppc.h
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2010-01-07 20:58:01 -0500
committerMarcelo Tosatti <mtosatti@redhat.com>2010-03-01 10:35:47 -0500
commit8e5b26b55a8b6aee2c789b1d20ec715f9e4bea5c (patch)
tree4e2d003852ce327a47153b6c100239c6d8e1418f /arch/powerpc/include/asm/kvm_ppc.h
parent0d178975d0a5afe5e0fd3211bd1397905b225be5 (diff)
KVM: PPC: Use accessor functions for GPR access
All code in PPC KVM currently accesses gprs in the vcpu struct directly. While there's nothing wrong with that wrt the current way gprs are stored and loaded, it doesn't suffice for the PACA acceleration that will follow in this patchset. So let's just create little wrapper inline functions that we call whenever a GPR needs to be read from or written to. The compiled code shouldn't really change at all for now. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/powerpc/include/asm/kvm_ppc.h')
-rw-r--r--arch/powerpc/include/asm/kvm_ppc.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/kvm_ppc.h b/arch/powerpc/include/asm/kvm_ppc.h
index abfd0c4d567..ba01b9c1d38 100644
--- a/arch/powerpc/include/asm/kvm_ppc.h
+++ b/arch/powerpc/include/asm/kvm_ppc.h
@@ -96,4 +96,30 @@ extern void kvmppc_booke_exit(void);
96 96
97extern void kvmppc_core_destroy_mmu(struct kvm_vcpu *vcpu); 97extern void kvmppc_core_destroy_mmu(struct kvm_vcpu *vcpu);
98 98
99#ifdef CONFIG_PPC_BOOK3S
100
101static inline void kvmppc_set_gpr(struct kvm_vcpu *vcpu, int num, ulong val)
102{
103 vcpu->arch.gpr[num] = val;
104}
105
106static inline ulong kvmppc_get_gpr(struct kvm_vcpu *vcpu, int num)
107{
108 return vcpu->arch.gpr[num];
109}
110
111#else
112
113static inline void kvmppc_set_gpr(struct kvm_vcpu *vcpu, int num, ulong val)
114{
115 vcpu->arch.gpr[num] = val;
116}
117
118static inline ulong kvmppc_get_gpr(struct kvm_vcpu *vcpu, int num)
119{
120 return vcpu->arch.gpr[num];
121}
122
123#endif
124
99#endif /* __POWERPC_KVM_PPC_H__ */ 125#endif /* __POWERPC_KVM_PPC_H__ */