memory: don't try to adjust endianness for zero length eventfd
There's no need to adjust endianness for zero length eventfd since the data wrote was actually ignored by kernel. So skip the adjust in this case to fix a possible crash when trying to use wildcard mmio eventfd in ppc. Cc: Greg Kurz <gkurz@linux.vnet.ibm.com> Cc: Peter Maydell <peter.maydell@linaro.org> Cc: Paolo Bonzini <pbonzini@redhat.com> Acked-by: Greg Kurz <gkurz@linux.vnet.ibm.com> Signed-off-by: Jason Wang <jasowang@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
a6df8adf3e
commit
b8aecea23a
4
memory.c
4
memory.c
@ -1688,7 +1688,9 @@ void memory_region_add_eventfd(MemoryRegion *mr,
|
||||
};
|
||||
unsigned i;
|
||||
|
||||
if (size) {
|
||||
adjust_endianness(mr, &mrfd.data, size);
|
||||
}
|
||||
memory_region_transaction_begin();
|
||||
for (i = 0; i < mr->ioeventfd_nb; ++i) {
|
||||
if (memory_region_ioeventfd_before(mrfd, mr->ioeventfds[i])) {
|
||||
@ -1721,7 +1723,9 @@ void memory_region_del_eventfd(MemoryRegion *mr,
|
||||
};
|
||||
unsigned i;
|
||||
|
||||
if (size) {
|
||||
adjust_endianness(mr, &mrfd.data, size);
|
||||
}
|
||||
memory_region_transaction_begin();
|
||||
for (i = 0; i < mr->ioeventfd_nb; ++i) {
|
||||
if (memory_region_ioeventfd_equal(mrfd, mr->ioeventfds[i])) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user