diff options
-rw-r--r-- | arch/x86/include/asm/kvm_host.h | 2 | ||||
-rw-r--r-- | arch/x86/kvm/mmu.c | 8 | ||||
-rw-r--r-- | arch/x86/kvm/x86.c | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index c52e2eb40a1e..02963684cd28 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h | |||
@@ -369,7 +369,7 @@ struct kvm_vcpu_arch { | |||
369 | struct kvm_arch { | 369 | struct kvm_arch { |
370 | unsigned int n_free_mmu_pages; | 370 | unsigned int n_free_mmu_pages; |
371 | unsigned int n_requested_mmu_pages; | 371 | unsigned int n_requested_mmu_pages; |
372 | unsigned int n_alloc_mmu_pages; | 372 | unsigned int n_max_mmu_pages; |
373 | atomic_t invlpg_counter; | 373 | atomic_t invlpg_counter; |
374 | struct hlist_head mmu_page_hash[KVM_NUM_MMU_PAGES]; | 374 | struct hlist_head mmu_page_hash[KVM_NUM_MMU_PAGES]; |
375 | /* | 375 | /* |
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 625b17894661..6979e7d1464e 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c | |||
@@ -1696,7 +1696,7 @@ void kvm_mmu_change_mmu_pages(struct kvm *kvm, unsigned int kvm_nr_mmu_pages) | |||
1696 | int used_pages; | 1696 | int used_pages; |
1697 | LIST_HEAD(invalid_list); | 1697 | LIST_HEAD(invalid_list); |
1698 | 1698 | ||
1699 | used_pages = kvm->arch.n_alloc_mmu_pages - kvm_mmu_available_pages(kvm); | 1699 | used_pages = kvm->arch.n_max_mmu_pages - kvm_mmu_available_pages(kvm); |
1700 | used_pages = max(0, used_pages); | 1700 | used_pages = max(0, used_pages); |
1701 | 1701 | ||
1702 | /* | 1702 | /* |
@@ -1721,9 +1721,9 @@ void kvm_mmu_change_mmu_pages(struct kvm *kvm, unsigned int kvm_nr_mmu_pages) | |||
1721 | } | 1721 | } |
1722 | else | 1722 | else |
1723 | kvm->arch.n_free_mmu_pages += kvm_nr_mmu_pages | 1723 | kvm->arch.n_free_mmu_pages += kvm_nr_mmu_pages |
1724 | - kvm->arch.n_alloc_mmu_pages; | 1724 | - kvm->arch.n_max_mmu_pages; |
1725 | 1725 | ||
1726 | kvm->arch.n_alloc_mmu_pages = kvm_nr_mmu_pages; | 1726 | kvm->arch.n_max_mmu_pages = kvm_nr_mmu_pages; |
1727 | } | 1727 | } |
1728 | 1728 | ||
1729 | static int kvm_mmu_unprotect_page(struct kvm *kvm, gfn_t gfn) | 1729 | static int kvm_mmu_unprotect_page(struct kvm *kvm, gfn_t gfn) |
@@ -3141,7 +3141,7 @@ static int mmu_shrink(struct shrinker *shrink, int nr_to_scan, gfp_t gfp_mask) | |||
3141 | 3141 | ||
3142 | idx = srcu_read_lock(&kvm->srcu); | 3142 | idx = srcu_read_lock(&kvm->srcu); |
3143 | spin_lock(&kvm->mmu_lock); | 3143 | spin_lock(&kvm->mmu_lock); |
3144 | npages = kvm->arch.n_alloc_mmu_pages - | 3144 | npages = kvm->arch.n_max_mmu_pages - |
3145 | kvm_mmu_available_pages(kvm); | 3145 | kvm_mmu_available_pages(kvm); |
3146 | cache_count += npages; | 3146 | cache_count += npages; |
3147 | if (!kvm_freed && nr_to_scan > 0 && npages > 0) { | 3147 | if (!kvm_freed && nr_to_scan > 0 && npages > 0) { |
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index c0004eb354d3..4b4d2836240f 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -2759,7 +2759,7 @@ static int kvm_vm_ioctl_set_nr_mmu_pages(struct kvm *kvm, | |||
2759 | 2759 | ||
2760 | static int kvm_vm_ioctl_get_nr_mmu_pages(struct kvm *kvm) | 2760 | static int kvm_vm_ioctl_get_nr_mmu_pages(struct kvm *kvm) |
2761 | { | 2761 | { |
2762 | return kvm->arch.n_alloc_mmu_pages; | 2762 | return kvm->arch.n_max_mmu_pages; |
2763 | } | 2763 | } |
2764 | 2764 | ||
2765 | static int kvm_vm_ioctl_get_irqchip(struct kvm *kvm, struct kvm_irqchip *chip) | 2765 | static int kvm_vm_ioctl_get_irqchip(struct kvm *kvm, struct kvm_irqchip *chip) |