]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
KVM: s390: cmma: Fix dirty tracking when removing memslot
authorClaudio Imbrenda <imbrenda@linux.ibm.com>
Mon, 3 Aug 2026 12:40:35 +0000 (14:40 +0200)
committerClaudio Imbrenda <imbrenda@linux.ibm.com>
Mon, 3 Aug 2026 14:51:34 +0000 (16:51 +0200)
commitec215346270512db60478e45e8dff2de950225aa
tree51236b5fcacd0ffa657758c603683e54f32e0109
parent4db7207052874f13dec1e9be384cca279c6693e8
KVM: s390: cmma: Fix dirty tracking when removing memslot

When a memslot is removed, all ptes that mapped the slot are cleared or
even deallocated. If this happens while the system is in migration
mode, and if cmma-dirty pages are removed, the cmma-dirty counter will
not reflect reality.

Fix by appropriately decrementing the cmma-dirty counter when removing
a memslot.

Opportunistically improve kvm_arch_commit_memory_region() to use
__free() for the struct kvm_s390_mmu_cache.

Fixes: e38c884df921 ("KVM: s390: Switch to new gmap")
Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Message-ID: <20260803124040.126471-9-imbrenda@linux.ibm.com>
arch/s390/kvm/dat.c
arch/s390/kvm/kvm-s390.c