Re: [PATCH v2 1/2] KVM: arm64: Fix dirty logging detection in ring-only mode

From: Gavin Shan

Date: Fri Oct 30 2026 - 01:12:17 EST


On 10/30/26 3:52 AM, Wei-Lin Chang wrote:
When checking whether a memslot has dirty logging enabled, the
KVM_MEM_LOG_DIRTY_PAGES flag is the source of truth. Previously in
memslot_is_logging() we were testing the dirty bitmap only and did not
consider dirty ring.

With the ring and no bitmap, a logged memslot can still get block
mappings, so guest writes to most of a block are never logged and a
migration can copy stale memory.

Fix this by using kvm_slot_dirty_track_enabled() instead which checks
KVM_MEM_LOG_DIRTY_PAGES, within memslot_is_logging().

Fixes: 9cb1096f8590 ("KVM: arm64: Enable ring-based dirty memory tracking")
Reviewed-by: Fuad Tabba <fuad.tabba@xxxxxxxxx>
Tested-by: Fuad Tabba <fuad.tabba@xxxxxxxxx>
Signed-off-by: Wei-Lin Chang <weilin.chang@xxxxxxx>
Cc: stable@xxxxxxxxxxxxxxx
---
arch/arm64/kvm/mmu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Gavin Shan <gshan@xxxxxxxxxx>