mirror of
https://github.com/xemu-project/xemu.git
synced 2025-04-02 11:11:48 -04:00
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
1 changed files with 6 additions and 2 deletions
8
memory.c
8
memory.c
|
@ -1688,7 +1688,9 @@ void memory_region_add_eventfd(MemoryRegion *mr,
|
|||
};
|
||||
unsigned i;
|
||||
|
||||
adjust_endianness(mr, &mrfd.data, size);
|
||||
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;
|
||||
|
||||
adjust_endianness(mr, &mrfd.data, size);
|
||||
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…
Add table
Reference in a new issue