]> git.ipfire.org Git - thirdparty/qemu.git/commit
xen: mapcache: Fix finding matching entry
authorAleksandr Partanen <alex.pentagrid@gmail.com>
Thu, 10 Apr 2025 14:46:04 +0000 (17:46 +0300)
committerEdgar E. Iglesias <edgar.iglesias@amd.com>
Tue, 6 May 2025 16:39:43 +0000 (18:39 +0200)
commita4b20f737cda06bb8706a83e27f7fa89863ae689
tree24575a6f6d10dd8541aee42e603ed2511ca21405
parenta9e0c9c0f14e19d23443ac24c8080b4708d2eab8
xen: mapcache: Fix finding matching entry

If we have request without lock and hit unlocked or invalid
entry during the search, we remap it immediately,
even if we have matching entry in next entries in bucket.
This leads to duplication of mappings of the same size,
and to possibility of selecting the wrong element
during invalidation and underflow it's entry->lock counter

Signed-off-by: Aleksandr Partanen <alex.pentagrid@gmail.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
hw/xen/xen-mapcache.c