mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 14:53:58 -04:00
Merge tag 'kvm-x86-dirty_ring-6.17' of https://github.com/kvm-x86/linux into HEAD
KVM Dirty Ring changes for 6.17 Fix issues with dirty ring harvesting where KVM doesn't bound the processing of entries in any way, which allows userspace to keep KVM in a tight loop indefinitely. Clean up code and comments along the way.
This commit is contained in:
@@ -4967,15 +4967,18 @@ static int kvm_vm_ioctl_reset_dirty_pages(struct kvm *kvm)
|
||||
{
|
||||
unsigned long i;
|
||||
struct kvm_vcpu *vcpu;
|
||||
int cleared = 0;
|
||||
int cleared = 0, r;
|
||||
|
||||
if (!kvm->dirty_ring_size)
|
||||
return -EINVAL;
|
||||
|
||||
mutex_lock(&kvm->slots_lock);
|
||||
|
||||
kvm_for_each_vcpu(i, vcpu, kvm)
|
||||
cleared += kvm_dirty_ring_reset(vcpu->kvm, &vcpu->dirty_ring);
|
||||
kvm_for_each_vcpu(i, vcpu, kvm) {
|
||||
r = kvm_dirty_ring_reset(vcpu->kvm, &vcpu->dirty_ring, &cleared);
|
||||
if (r)
|
||||
break;
|
||||
}
|
||||
|
||||
mutex_unlock(&kvm->slots_lock);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user