aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kvm/book3s.c
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2010-04-15 18:11:45 -0400
committerAvi Kivity <avi@redhat.com>2010-05-17 05:18:34 -0400
commit9cc5e9538ab7cbbfb1d7263373d2f58ab2af2bad (patch)
tree058bf5939ecca2f3b805dd657cc565051947db07 /arch/powerpc/kvm/book3s.c
parent0604675fe17f68741730cebe74422605bb79d972 (diff)
KVM: PPC: Extract MMU init
The host shadow mmu code needs to get initialized. It needs to fetch a segment it can use to put shadow PTEs into. That initialization code was in generic code, which is icky. Let's move it over to the respective MMU file. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/powerpc/kvm/book3s.c')
-rw-r--r--arch/powerpc/kvm/book3s.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3s.c
index 7ff80f9f13a8..d0986968a611 100644
--- a/arch/powerpc/kvm/book3s.c
+++ b/arch/powerpc/kvm/book3s.c
@@ -1202,14 +1202,9 @@ struct kvm_vcpu *kvmppc_core_vcpu_create(struct kvm *kvm, unsigned int id)
1202 1202
1203 vcpu->arch.shadow_msr = MSR_USER64; 1203 vcpu->arch.shadow_msr = MSR_USER64;
1204 1204
1205 err = __init_new_context(); 1205 err = kvmppc_mmu_init(vcpu);
1206 if (err < 0) 1206 if (err < 0)
1207 goto free_shadow_vcpu; 1207 goto free_shadow_vcpu;
1208 vcpu_book3s->context_id = err;
1209
1210 vcpu_book3s->vsid_max = ((vcpu_book3s->context_id + 1) << USER_ESID_BITS) - 1;
1211 vcpu_book3s->vsid_first = vcpu_book3s->context_id << USER_ESID_BITS;
1212 vcpu_book3s->vsid_next = vcpu_book3s->vsid_first;
1213 1208
1214 return vcpu; 1209 return vcpu;
1215 1210
@@ -1225,7 +1220,6 @@ void kvmppc_core_vcpu_free(struct kvm_vcpu *vcpu)
1225{ 1220{
1226 struct kvmppc_vcpu_book3s *vcpu_book3s = to_book3s(vcpu); 1221 struct kvmppc_vcpu_book3s *vcpu_book3s = to_book3s(vcpu);
1227 1222
1228 __destroy_context(vcpu_book3s->context_id);
1229 kvm_vcpu_uninit(vcpu); 1223 kvm_vcpu_uninit(vcpu);
1230 kfree(vcpu_book3s->shadow_vcpu); 1224 kfree(vcpu_book3s->shadow_vcpu);
1231 vfree(vcpu_book3s); 1225 vfree(vcpu_book3s);