summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kvm/44x.c
diff options
context:
space:
mode:
authorAneesh Kumar K.V2013-10-07 18:48:01 +0200
committerAlexander Graf2013-10-17 18:42:36 +0200
commitcbbc58d4fdfab1a39a6ac1b41fcb17885952157a (patch)
tree66315f4516c953a9c1f0699d985541d84fcb7df3 /arch/powerpc/kvm/44x.c
parentkvm: Add struct kvm arg to memslot APIs (diff)
downloadkernel-qcow2-linux-cbbc58d4fdfab1a39a6ac1b41fcb17885952157a.tar.gz
kernel-qcow2-linux-cbbc58d4fdfab1a39a6ac1b41fcb17885952157a.tar.xz
kernel-qcow2-linux-cbbc58d4fdfab1a39a6ac1b41fcb17885952157a.zip
kvm: powerpc: book3s: Allow the HV and PR selection per virtual machine
This moves the kvmppc_ops callbacks to be a per VM entity. This enables us to select HV and PR mode when creating a VM. We also allow both kvm-hv and kvm-pr kernel module to be loaded. To achieve this we move /dev/kvm ownership to kvm.ko module. Depending on which KVM mode we select during VM creation we take a reference count on respective module Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> [agraf: fix coding style] Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'arch/powerpc/kvm/44x.c')
-rw-r--r--arch/powerpc/kvm/44x.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/powerpc/kvm/44x.c b/arch/powerpc/kvm/44x.c
index a765bcd74fbb..93221e87b911 100644
--- a/arch/powerpc/kvm/44x.c
+++ b/arch/powerpc/kvm/44x.c
@@ -213,16 +213,19 @@ static int __init kvmppc_44x_init(void)
if (r)
goto err_out;
- r = kvm_init(&kvm_ops_44x, sizeof(struct kvmppc_vcpu_44x),
- 0, THIS_MODULE);
+ r = kvm_init(NULL, sizeof(struct kvmppc_vcpu_44x), 0, THIS_MODULE);
if (r)
goto err_out;
+ kvm_ops_44x.owner = THIS_MODULE;
+ kvmppc_pr_ops = &kvm_ops_44x;
+
err_out:
return r;
}
static void __exit kvmppc_44x_exit(void)
{
+ kvmppc_pr_ops = NULL;
kvmppc_booke_exit();
}