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/e500.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/e500.c')
-rw-r--r-- | arch/powerpc/kvm/e500.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/arch/powerpc/kvm/e500.c b/arch/powerpc/kvm/e500.c index d225d5ebddcc..497b142f651c 100644 --- a/arch/powerpc/kvm/e500.c +++ b/arch/powerpc/kvm/e500.c | |||
@@ -555,13 +555,19 @@ static int __init kvmppc_e500_init(void) | |||
555 | flush_icache_range(kvmppc_booke_handlers, kvmppc_booke_handlers + | 555 | flush_icache_range(kvmppc_booke_handlers, kvmppc_booke_handlers + |
556 | ivor[max_ivor] + handler_len); | 556 | ivor[max_ivor] + handler_len); |
557 | 557 | ||
558 | r = kvm_init(&kvm_ops_e500, sizeof(struct kvmppc_vcpu_e500), 0, THIS_MODULE); | 558 | r = kvm_init(NULL, sizeof(struct kvmppc_vcpu_e500), 0, THIS_MODULE); |
559 | if (r) | ||
560 | goto err_out; | ||
561 | kvm_ops_e500.owner = THIS_MODULE; | ||
562 | kvmppc_pr_ops = &kvm_ops_e500; | ||
563 | |||
559 | err_out: | 564 | err_out: |
560 | return r; | 565 | return r; |
561 | } | 566 | } |
562 | 567 | ||
563 | static void __exit kvmppc_e500_exit(void) | 568 | static void __exit kvmppc_e500_exit(void) |
564 | { | 569 | { |
570 | kvmppc_pr_ops = NULL; | ||
565 | kvmppc_booke_exit(); | 571 | kvmppc_booke_exit(); |
566 | } | 572 | } |
567 | 573 | ||