diff options
author | Izik Eidus <izike@qumranet.com> | 2007-10-02 12:52:55 -0400 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-01-30 10:52:50 -0500 |
commit | 82ce2c96831f049a37118733ced5c8f7c8848102 (patch) | |
tree | 609fed010ebbb1ced6f0f24698148e69a72da5fd /drivers/kvm/kvm.h | |
parent | 195aefde9cc2cee38dd54ef92a866721fba4413e (diff) |
KVM: Allow dynamic allocation of the mmu shadow cache size
The user is now able to set how many mmu pages will be allocated to the guest.
Signed-off-by: Izik Eidus <izike@qumranet.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/kvm.h')
-rw-r--r-- | drivers/kvm/kvm.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h index 1965438f18cc..9f10c373b74c 100644 --- a/drivers/kvm/kvm.h +++ b/drivers/kvm/kvm.h | |||
@@ -40,6 +40,8 @@ | |||
40 | #define KVM_MAX_VCPUS 4 | 40 | #define KVM_MAX_VCPUS 4 |
41 | #define KVM_ALIAS_SLOTS 4 | 41 | #define KVM_ALIAS_SLOTS 4 |
42 | #define KVM_MEMORY_SLOTS 8 | 42 | #define KVM_MEMORY_SLOTS 8 |
43 | #define KVM_PERMILLE_MMU_PAGES 20 | ||
44 | #define KVM_MIN_ALLOC_MMU_PAGES 64 | ||
43 | #define KVM_NUM_MMU_PAGES 1024 | 45 | #define KVM_NUM_MMU_PAGES 1024 |
44 | #define KVM_MIN_FREE_MMU_PAGES 5 | 46 | #define KVM_MIN_FREE_MMU_PAGES 5 |
45 | #define KVM_REFILL_PAGES 25 | 47 | #define KVM_REFILL_PAGES 25 |
@@ -418,7 +420,9 @@ struct kvm { | |||
418 | * Hash table of struct kvm_mmu_page. | 420 | * Hash table of struct kvm_mmu_page. |
419 | */ | 421 | */ |
420 | struct list_head active_mmu_pages; | 422 | struct list_head active_mmu_pages; |
421 | int n_free_mmu_pages; | 423 | unsigned int n_free_mmu_pages; |
424 | unsigned int n_requested_mmu_pages; | ||
425 | unsigned int n_alloc_mmu_pages; | ||
422 | struct hlist_head mmu_page_hash[KVM_NUM_MMU_PAGES]; | 426 | struct hlist_head mmu_page_hash[KVM_NUM_MMU_PAGES]; |
423 | struct kvm_vcpu *vcpus[KVM_MAX_VCPUS]; | 427 | struct kvm_vcpu *vcpus[KVM_MAX_VCPUS]; |
424 | unsigned long rmap_overflow; | 428 | unsigned long rmap_overflow; |
@@ -547,6 +551,7 @@ void kvm_mmu_set_nonpresent_ptes(u64 trap_pte, u64 notrap_pte); | |||
547 | int kvm_mmu_reset_context(struct kvm_vcpu *vcpu); | 551 | int kvm_mmu_reset_context(struct kvm_vcpu *vcpu); |
548 | void kvm_mmu_slot_remove_write_access(struct kvm *kvm, int slot); | 552 | void kvm_mmu_slot_remove_write_access(struct kvm *kvm, int slot); |
549 | void kvm_mmu_zap_all(struct kvm *kvm); | 553 | void kvm_mmu_zap_all(struct kvm *kvm); |
554 | void kvm_mmu_change_mmu_pages(struct kvm *kvm, unsigned int kvm_nr_mmu_pages); | ||
550 | 555 | ||
551 | hpa_t gpa_to_hpa(struct kvm_vcpu *vcpu, gpa_t gpa); | 556 | hpa_t gpa_to_hpa(struct kvm_vcpu *vcpu, gpa_t gpa); |
552 | #define HPA_MSB ((sizeof(hpa_t) * 8) - 1) | 557 | #define HPA_MSB ((sizeof(hpa_t) * 8) - 1) |