diff --git a/exec.c b/exec.c index 3ca9381214b8002e0ac32eacb23f56a195d74764..394f7e2b12584b6302be1159bf5ceac02822ed24 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; }