Skip to content

Commit 49005a2

Browse files
committed
KVM: Bail from the dirty ring reset flow if a signal is pending
Abort a dirty ring reset if the current task has a pending signal, as the hard limit of INT_MAX entries doesn't ensure KVM will respond to a signal in a timely fashion. Fixes: fb04a1e ("KVM: X86: Implement ring-based dirty memory tracking") Reviewed-by: James Houghton <jthoughton@google.com> Reviewed-by: Binbin Wu <binbin.wu@linux.intel.com> Reviewed-by: Yan Zhao <yan.y.zhao@intel.com> Reviewed-by: Peter Xu <peterx@redhat.com> Link: https://lore.kernel.org/r/20250516213540.2546077-3-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent 530a8ba commit 49005a2

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

virt/kvm/dirty_ring.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ int kvm_dirty_ring_reset(struct kvm *kvm, struct kvm_dirty_ring *ring,
118118
cur_slot = cur_offset = mask = 0;
119119

120120
while (likely((*nr_entries_reset) < INT_MAX)) {
121+
if (signal_pending(current))
122+
return -EINTR;
123+
121124
entry = &ring->dirty_gfns[ring->reset_index & (ring->size - 1)];
122125

123126
if (!kvm_dirty_gfn_harvested(entry))

0 commit comments

Comments
 (0)