summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--exec.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/exec.c b/exec.c
index 8d415905d5..0245f4e303 100644
--- a/exec.c
+++ b/exec.c
@@ -1944,6 +1944,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;
}