]> git.karo-electronics.de Git - karo-tx-linux.git/commit
KVM: Fix user memslot overlap check
authorAlex Williamson <alex.williamson@redhat.com>
Thu, 29 Nov 2012 21:07:59 +0000 (14:07 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Jan 2013 16:50:42 +0000 (08:50 -0800)
commit9d4c74b86237ac64376b92c54cf7b471e7e75f76
tree62dbe4253920ec2cc4419e3f6446fb531d6b7a2a
parent91534f7365982fa0c29192e73416dd798397310a
KVM: Fix user memslot overlap check

commit 5419369ed6bd4cf711fdda5e52a5999b940413f5 upstream.

Prior to memory slot sorting this loop compared all of the user memory
slots for overlap with new entries.  With memory slot sorting, we're
just checking some number of entries in the array that may or may not
be user slots.  Instead, walk all the slots with kvm_for_each_memslot,
which has the added benefit of terminating early when we hit the first
empty slot, and skip comparison to private slots.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
virt/kvm/kvm_main.c