[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 16/38] exec: fix writing to MMIO area with non-power
From: |
Michael Roth |
Subject: |
[Qemu-devel] [PATCH 16/38] exec: fix writing to MMIO area with non-power-of-two length |
Date: |
Wed, 25 Sep 2013 07:57:44 -0500 |
From: Paolo Bonzini <address@hidden>
The problem is introduced by commit 2332616 (exec: Support 64-bit
operations in address_space_rw, 2013-07-08). Before that commit,
memory_access_size would only return 1/2/4.
Since alignment is already handled above, reduce l to the largest
power of two that is smaller than l.
Cc: address@hidden
Reported-by: Oleksii Shevchuk <address@hidden>
Tested-by: Oleksii Shevchuk <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
(cherry picked from commit 098178f2749a63fbbb1a626dcc7d939d5cb2bde7)
Signed-off-by: Michael Roth <address@hidden>
---
exec.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/exec.c b/exec.c
index 3ca9381..394f7e2 100644
--- a/exec.c
+++ b/exec.c
@@ -1928,6 +1928,9 @@ static int memory_access_size(MemoryRegion *mr, unsigned
l, hwaddr addr)
if (l > access_size_max) {
l = access_size_max;
}
+ if (l & (l - 1)) {
+ l = 1 << (qemu_fls(l) - 1);
+ }
return l;
}
--
1.7.9.5
- [Qemu-devel] [PATCH 04/38] rdma: silly ipv6 bugfix, (continued)
- [Qemu-devel] [PATCH 04/38] rdma: silly ipv6 bugfix, Michael Roth, 2013/09/25
- [Qemu-devel] [PATCH 07/38] scsi: Fix scsi_bus_legacy_add_drive() scsi-generic with serial, Michael Roth, 2013/09/25
- [Qemu-devel] [PATCH 09/38] pseries: Fix stalls on hypervisor virtual console, Michael Roth, 2013/09/25
- [Qemu-devel] [PATCH 08/38] pc: fix regression for 64 bit PCI memory, Michael Roth, 2013/09/25
- [Qemu-devel] [PATCH 10/38] virtio: virtqueue_get_avail_bytes: fix desc_pa when loop over the indirect descriptor table, Michael Roth, 2013/09/25
- [Qemu-devel] [PATCH 11/38] xhci: fix endpoint interval calculation, Michael Roth, 2013/09/25
- [Qemu-devel] [PATCH 12/38] Revert "usb-hub: report status changes only once", Michael Roth, 2013/09/25
- [Qemu-devel] [PATCH 13/38] block: expect errors from bdrv_co_is_allocated, Michael Roth, 2013/09/25
- [Qemu-devel] [PATCH 14/38] target-i386: fix disassembly with PAE=1, PG=0, Michael Roth, 2013/09/25
- [Qemu-devel] [PATCH 15/38] adlib: sort offsets in portio registration, Michael Roth, 2013/09/25
- [Qemu-devel] [PATCH 16/38] exec: fix writing to MMIO area with non-power-of-two length,
Michael Roth <=
- [Qemu-devel] [PATCH 18/38] exec: always use MADV_DONTFORK, Michael Roth, 2013/09/25
- [Qemu-devel] [PATCH 17/38] virtio_pci: fix level interrupts with irqfd, Michael Roth, 2013/09/25
- [Qemu-devel] [PATCH 19/38] xhci: reset port when disabling slot, Michael Roth, 2013/09/25
- [Qemu-devel] [PATCH 20/38] usb: parallelize usb3 streams, Michael Roth, 2013/09/25
- [Qemu-devel] [PATCH 21/38] w32: Fix access to host devices (regression), Michael Roth, 2013/09/25
- [Qemu-devel] [PATCH 23/38] Revert "memory: Return -1 again on reads from unsigned regions", Michael Roth, 2013/09/25
- [Qemu-devel] [PATCH 24/38] exec: check offset_within_address_space for register subpage, Michael Roth, 2013/09/25
- [Qemu-devel] [PATCH 22/38] memory: Provide separate handling of unassigned io ports accesses, Michael Roth, 2013/09/25
- [Qemu-devel] [PATCH 25/38] ne2000: mark I/O as LITTLE_ENDIAN, Michael Roth, 2013/09/25
- [Qemu-devel] [PATCH 28/38] pc: Initializing ram_memory under Xen., Michael Roth, 2013/09/25