diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2007-07-30 07:12:19 -0400 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2007-10-13 04:18:21 -0400 |
commit | c16f862d0257349607b7a9be7b4a4b7ed419a3ab (patch) | |
tree | f84e9f43f845640a0cc887fe8697ab0b3a4e788b /drivers/kvm/kvm.h | |
parent | e7d5d76cae970117affe07f809faf0f18bbac675 (diff) |
KVM: Use kmem cache for allocating vcpus
Avi wants the allocations of vcpus centralized again. The easiest way
is to add a "size" arg to kvm_init_arch, and expose the thus-prepared
cache to the modules.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/kvm.h')
-rw-r--r-- | drivers/kvm/kvm.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h index 030b93bcdf1b..b362e8f8f832 100644 --- a/drivers/kvm/kvm.h +++ b/drivers/kvm/kvm.h | |||
@@ -141,6 +141,7 @@ struct kvm_mmu_page { | |||
141 | }; | 141 | }; |
142 | 142 | ||
143 | struct kvm_vcpu; | 143 | struct kvm_vcpu; |
144 | extern struct kmem_cache *kvm_vcpu_cache; | ||
144 | 145 | ||
145 | /* | 146 | /* |
146 | * x86 supports 3 paging modes (4-level 64-bit, 3-level 64-bit, and 2-level | 147 | * x86 supports 3 paging modes (4-level 64-bit, 3-level 64-bit, and 2-level |
@@ -483,7 +484,8 @@ extern struct kvm_arch_ops *kvm_arch_ops; | |||
483 | int kvm_vcpu_init(struct kvm_vcpu *vcpu, struct kvm *kvm, unsigned id); | 484 | int kvm_vcpu_init(struct kvm_vcpu *vcpu, struct kvm *kvm, unsigned id); |
484 | void kvm_vcpu_uninit(struct kvm_vcpu *vcpu); | 485 | void kvm_vcpu_uninit(struct kvm_vcpu *vcpu); |
485 | 486 | ||
486 | int kvm_init_arch(struct kvm_arch_ops *ops, struct module *module); | 487 | int kvm_init_arch(struct kvm_arch_ops *ops, unsigned int vcpu_size, |
488 | struct module *module); | ||
487 | void kvm_exit_arch(void); | 489 | void kvm_exit_arch(void); |
488 | 490 | ||
489 | int kvm_mmu_module_init(void); | 491 | int kvm_mmu_module_init(void); |