softmmu/memory: fix memory_region_ioeventfd_equal()
PATCH v2 1/1 softmmu/memory: fix memory_region_ioeventfd_equal()
Eventfd can be registered with a zero length when fast_mmio is true. Handle this case properly when dispatching through QEMU.
Signed-off-by Elena Afanasova <[email protected]>
--- softmmu/memory.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
softmmu/memory.c +9 -2
@@ -205,8 +205,15 @@ static bool memory_region_ioeventfd_before(MemoryRegionIoeventfd *a,static bool memory_region_ioeventfd_equal (MemoryRegionIoeventfd *a,MemoryRegionIoeventfd *b) { -return !memory_region_ioeventfd_before (a, b) - && !memory_region_ioeventfd_before (b, a); +if (int128_eq (a->addr.start, b->addr.start) && + (!int128_nz (a->addr.size) || !int128_nz (b->addr.size) || + (int128_eq (a->addr.size, b->addr.size) && + (a->match_data == b->match_data) && + ((a->match_data && (a->data == b->data)) || !a->match_data) && + (a->e == b->e)))) +return true; + +return false; }/* Range of memory in the global map. Addresses are absolute. */
Signature · 1 line
2.25.1
Stefan Hajnoczi
AppliedQuoted 7 lines · Elena Afanasova
Eventfd can be registered with a zero length when
fast_mmiois true. Handle this case properly when dispatching through QEMU.Signed-off-by Elena Afanasova <[email protected]>--- softmmu/memory.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
Thanks, applied to my block-next tree:
https://github.com/stefanha/qemu/commits/block-next
Stefan