diff options
author | Hollis Blanchard <hollisb@us.ibm.com> | 2008-11-05 10:36:18 -0500 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2008-12-31 09:52:22 -0500 |
commit | db93f5745d836f81cef0b4101a7c2685eeb55efb (patch) | |
tree | 970b0dfc93dbbe25eb988b008bbbeffd866f3f23 /arch/powerpc/kvm/powerpc.c | |
parent | 5cbb5106f50b4515815cd32cf944958c0d4da83f (diff) |
KVM: ppc: create struct kvm_vcpu_44x and introduce container_of() accessor
This patch doesn't yet move all 44x-specific data into the new structure, but
is the first step down that path. In the future we may also want to create a
struct kvm_vcpu_booke.
Based on patch from Liu Yu <yu.liu@freescale.com>.
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/powerpc/kvm/powerpc.c')
-rw-r--r-- | arch/powerpc/kvm/powerpc.c | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c index 8d0aaf96d838..237f3ba68d27 100644 --- a/arch/powerpc/kvm/powerpc.c +++ b/arch/powerpc/kvm/powerpc.c | |||
@@ -171,31 +171,12 @@ void kvm_arch_flush_shadow(struct kvm *kvm) | |||
171 | 171 | ||
172 | struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm, unsigned int id) | 172 | struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm, unsigned int id) |
173 | { | 173 | { |
174 | struct kvm_vcpu *vcpu; | 174 | return kvmppc_core_vcpu_create(kvm, id); |
175 | int err; | ||
176 | |||
177 | vcpu = kmem_cache_zalloc(kvm_vcpu_cache, GFP_KERNEL); | ||
178 | if (!vcpu) { | ||
179 | err = -ENOMEM; | ||
180 | goto out; | ||
181 | } | ||
182 | |||
183 | err = kvm_vcpu_init(vcpu, kvm, id); | ||
184 | if (err) | ||
185 | goto free_vcpu; | ||
186 | |||
187 | return vcpu; | ||
188 | |||
189 | free_vcpu: | ||
190 | kmem_cache_free(kvm_vcpu_cache, vcpu); | ||
191 | out: | ||
192 | return ERR_PTR(err); | ||
193 | } | 175 | } |
194 | 176 | ||
195 | void kvm_arch_vcpu_free(struct kvm_vcpu *vcpu) | 177 | void kvm_arch_vcpu_free(struct kvm_vcpu *vcpu) |
196 | { | 178 | { |
197 | kvm_vcpu_uninit(vcpu); | 179 | kvmppc_core_vcpu_free(vcpu); |
198 | kmem_cache_free(kvm_vcpu_cache, vcpu); | ||
199 | } | 180 | } |
200 | 181 | ||
201 | void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu) | 182 | void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu) |