]> 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)
committerMichael Tokarev <mjt@tls.msk.ru>
Sun, 11 May 2025 06:15:20 +0000 (09:15 +0300)
commita03d7d6e32236d5c1b331e07b11cd7991f0d3a74
tree2a027e9e314a3eac3c115d3d23042ccf40e20dfb
parent827be9d37aa83ffc3a7489c73d4f4d11c4dba913
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>
(cherry picked from commit a4b20f737cda06bb8706a83e27f7fa89863ae689)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
hw/xen/xen-mapcache.c