]> git.ipfire.org Git - people/ms/linux.git/commitdiff
KVM: x86/mmu: add missing update to max_mmu_rmap_size
authorMiaohe Lin <linmiaohe@huawei.com>
Wed, 7 Sep 2022 08:06:57 +0000 (16:06 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 22 Sep 2022 21:03:20 +0000 (17:03 -0400)
The update to statistic max_mmu_rmap_size is unintentionally removed by
commit 4293ddb788c1 ("KVM: x86/mmu: Remove redundant spte present check
in mmu_set_spte"). Add missing update to it or max_mmu_rmap_size will
always be nonsensical 0.

Fixes: 4293ddb788c1 ("KVM: x86/mmu: Remove redundant spte present check in mmu_set_spte")
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Message-Id: <20220907080657.42898-1-linmiaohe@huawei.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu/mmu.c

index e418ef3ecfcb8cd73c8f0fed3dc8cfe4e05314ac..3552e6af3684437f66f1d6a864499095bf176c74 100644 (file)
@@ -1596,6 +1596,8 @@ static void __rmap_add(struct kvm *kvm,
        rmap_head = gfn_to_rmap(gfn, sp->role.level, slot);
        rmap_count = pte_list_add(cache, spte, rmap_head);
 
+       if (rmap_count > kvm->stat.max_mmu_rmap_size)
+               kvm->stat.max_mmu_rmap_size = rmap_count;
        if (rmap_count > RMAP_RECYCLE_THRESHOLD) {
                kvm_zap_all_rmap_sptes(kvm, rmap_head);
                kvm_flush_remote_tlbs_with_address(