Skip to content

Commit 604f533

Browse files
MiaoheLinbonzini
authored andcommitted
KVM: x86/mmu: add missing update to max_mmu_rmap_size
The update to statistic max_mmu_rmap_size is unintentionally removed by commit 4293ddb ("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: 4293ddb ("KVM: x86/mmu: Remove redundant spte present check in mmu_set_spte") Signed-off-by: Miaohe Lin <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 561cafe commit 604f533

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

arch/x86/kvm/mmu/mmu.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1596,6 +1596,8 @@ static void __rmap_add(struct kvm *kvm,
15961596
rmap_head = gfn_to_rmap(gfn, sp->role.level, slot);
15971597
rmap_count = pte_list_add(cache, spte, rmap_head);
15981598

1599+
if (rmap_count > kvm->stat.max_mmu_rmap_size)
1600+
kvm->stat.max_mmu_rmap_size = rmap_count;
15991601
if (rmap_count > RMAP_RECYCLE_THRESHOLD) {
16001602
kvm_zap_all_rmap_sptes(kvm, rmap_head);
16011603
kvm_flush_remote_tlbs_with_address(

0 commit comments

Comments
 (0)