diff options
author | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2013-10-07 12:48:01 -0400 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2013-10-17 12:42:36 -0400 |
commit | cbbc58d4fdfab1a39a6ac1b41fcb17885952157a (patch) | |
tree | 66315f4516c953a9c1f0699d985541d84fcb7df3 /arch/powerpc/kvm/e500mc.c | |
parent | 5587027ce9d59a57aecaa190be1c8e560aaff45d (diff) |
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/e500mc.c')
-rw-r--r-- | arch/powerpc/kvm/e500mc.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/powerpc/kvm/e500mc.c b/arch/powerpc/kvm/e500mc.c index db6a383401c7..4132cd2fc171 100644 --- a/arch/powerpc/kvm/e500mc.c +++ b/arch/powerpc/kvm/e500mc.c | |||
@@ -373,15 +373,19 @@ static int __init kvmppc_e500mc_init(void) | |||
373 | kvmppc_init_lpid(64); | 373 | kvmppc_init_lpid(64); |
374 | kvmppc_claim_lpid(0); /* host */ | 374 | kvmppc_claim_lpid(0); /* host */ |
375 | 375 | ||
376 | r = kvm_init(&kvm_ops_e500mc, sizeof(struct kvmppc_vcpu_e500), 0, THIS_MODULE); | 376 | r = kvm_init(NULL, sizeof(struct kvmppc_vcpu_e500), 0, THIS_MODULE); |
377 | if (r) | 377 | if (r) |
378 | goto err_out; | 378 | goto err_out; |
379 | kvm_ops_e500mc.owner = THIS_MODULE; | ||
380 | kvmppc_pr_ops = &kvm_ops_e500mc; | ||
381 | |||
379 | err_out: | 382 | err_out: |
380 | return r; | 383 | return r; |
381 | } | 384 | } |
382 | 385 | ||
383 | static void __exit kvmppc_e500mc_exit(void) | 386 | static void __exit kvmppc_e500mc_exit(void) |
384 | { | 387 | { |
388 | kvmppc_pr_ops = NULL; | ||
385 | kvmppc_booke_exit(); | 389 | kvmppc_booke_exit(); |
386 | } | 390 | } |
387 | 391 | ||