diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2014-12-27 18:01:00 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2014-12-28 10:01:17 +0100 |
commit | efbeec7098eee2b3d2359d0cc24bbba0436e7f21 (patch) | |
tree | 6b90f8b272f263d093b2f40a3aa471030616bbe1 /Documentation/input/rotary-encoder.txt | |
parent | kvm: x86: drop severity of "generation wraparound" message (diff) | |
download | linux-efbeec7098eee2b3d2359d0cc24bbba0436e7f21.tar.xz linux-efbeec7098eee2b3d2359d0cc24bbba0436e7f21.zip |
kvm: fix sorting of memslots with base_gfn == 0
Before commit 0e60b0799fed (kvm: change memslot sorting rule from size
to GFN, 2014-12-01), the memslots' sorting key was npages, meaning
that a valid memslot couldn't have its sorting key equal to zero.
On the other hand, a valid memslot can have base_gfn == 0, and invalid
memslots are identified by base_gfn == npages == 0.
Because of this, commit 0e60b0799fed broke the invariant that invalid
memslots are at the end of the mslots array. When a memslot with
base_gfn == 0 was created, any invalid memslot before it were left
in place.
This can be fixed by changing the insertion to use a ">=" comparison
instead of "<=", but some care is needed to avoid breaking the case
of deleting a memslot; see the comment in update_memslots.
Thanks to Tiejun Chen for posting an initial patch for this bug.
Reported-by: Jamie Heilman <jamie@audible.transient.net>
Reported-by: Andy Lutomirski <luto@amacapital.net>
Tested-by: Jamie Heilman <jamie@audible.transient.net>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'Documentation/input/rotary-encoder.txt')
0 files changed, 0 insertions, 0 deletions