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 <eafanasova@gmail.com> Message-id: cf71a62eb04e61932ff8ffdd02e0b2aab4f495a0.camel@gmail.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
f9b4908895
commit
e6ffd75782
|
@ -205,8 +205,15 @@ static bool memory_region_ioeventfd_before(MemoryRegionIoeventfd *a,
|
||||||
static bool memory_region_ioeventfd_equal(MemoryRegionIoeventfd *a,
|
static bool memory_region_ioeventfd_equal(MemoryRegionIoeventfd *a,
|
||||||
MemoryRegionIoeventfd *b)
|
MemoryRegionIoeventfd *b)
|
||||||
{
|
{
|
||||||
return !memory_region_ioeventfd_before(a, b)
|
if (int128_eq(a->addr.start, b->addr.start) &&
|
||||||
&& !memory_region_ioeventfd_before(b, a);
|
(!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. */
|
/* Range of memory in the global map. Addresses are absolute. */
|
||||||
|
|
Loading…
Reference in New Issue