]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - arch/powerpc/kvm/44x.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6
[mv-sheeva.git] / arch / powerpc / kvm / 44x.c
index 689a57c2ac8009f3d62a51cb9d94dc90a333d4e3..74d0e742114306af2db5400af6c3ec29fe6a8c6d 100644 (file)
@@ -43,7 +43,7 @@ int kvmppc_core_check_processor_compat(void)
 {
        int r;
 
-       if (strcmp(cur_cpu_spec->platform, "ppc440") == 0)
+       if (strncmp(cur_cpu_spec->platform, "ppc440", 6) == 0)
                r = 0;
        else
                r = -ENOTSUPP;
@@ -72,6 +72,7 @@ int kvmppc_core_vcpu_setup(struct kvm_vcpu *vcpu)
        /* Since the guest can directly access the timebase, it must know the
         * real timebase frequency. Accordingly, it must see the state of
         * CCR1[TCS]. */
+       /* XXX CCR1 doesn't exist on all 440 SoCs. */
        vcpu->arch.ccr1 = mfspr(SPRN_CCR1);
 
        for (i = 0; i < ARRAY_SIZE(vcpu_44x->shadow_refs); i++)
@@ -123,8 +124,14 @@ struct kvm_vcpu *kvmppc_core_vcpu_create(struct kvm *kvm, unsigned int id)
        if (err)
                goto free_vcpu;
 
+       vcpu->arch.shared = (void*)__get_free_page(GFP_KERNEL|__GFP_ZERO);
+       if (!vcpu->arch.shared)
+               goto uninit_vcpu;
+
        return vcpu;
 
+uninit_vcpu:
+       kvm_vcpu_uninit(vcpu);
 free_vcpu:
        kmem_cache_free(kvm_vcpu_cache, vcpu_44x);
 out:
@@ -135,6 +142,7 @@ void kvmppc_core_vcpu_free(struct kvm_vcpu *vcpu)
 {
        struct kvmppc_vcpu_44x *vcpu_44x = to_44x(vcpu);
 
+       free_page((unsigned long)vcpu->arch.shared);
        kvm_vcpu_uninit(vcpu);
        kmem_cache_free(kvm_vcpu_cache, vcpu_44x);
 }
@@ -147,7 +155,7 @@ static int __init kvmppc_44x_init(void)
        if (r)
                return r;
 
-       return kvm_init(NULL, sizeof(struct kvmppc_vcpu_44x), THIS_MODULE);
+       return kvm_init(NULL, sizeof(struct kvmppc_vcpu_44x), 0, THIS_MODULE);
 }
 
 static void __exit kvmppc_44x_exit(void)