diff options
author | Richard Henderson | 2017-10-05 16:35:59 +0200 |
---|---|---|
committer | Riku Voipio | 2017-10-16 15:00:56 +0200 |
commit | de258eb07db6cf893ef1bfad8c0cedc0b983db55 (patch) | |
tree | 11bf3920f61db79d62eff37e85504e01afbe3c5f /accel | |
parent | linux-user: Allow -R values up to 0xffff0000 for 32-bit ARM guests (diff) | |
download | qemu-de258eb07db6cf893ef1bfad8c0cedc0b983db55.tar.gz qemu-de258eb07db6cf893ef1bfad8c0cedc0b983db55.tar.xz qemu-de258eb07db6cf893ef1bfad8c0cedc0b983db55.zip |
tcg: Fix off-by-one in assert in page_set_flags
Most of the users of page_set_flags offset (page, page + len) as
the end points. One might consider this an error, since the other
users do supply an endpoint as the last byte of the region.
However, the first thing that page_set_flags does is round end UP
to the start of the next page. Which means computing page + len - 1
is in the end pointless. Therefore, accept this usage and do not
assert when given the exact size of the vm as the endpoint.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20170708025030.15845-2-rth@twiddle.net>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
Diffstat (limited to 'accel')
-rw-r--r-- | accel/tcg/translate-all.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index c5ce99d549..1b43deb0cd 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -2114,7 +2114,7 @@ void page_set_flags(target_ulong start, target_ulong end, int flags) guest address space. If this assert fires, it probably indicates a missing call to h2g_valid. */ #if TARGET_ABI_BITS > L1_MAP_ADDR_SPACE_BITS - assert(end < ((target_ulong)1 << L1_MAP_ADDR_SPACE_BITS)); + assert(end <= ((target_ulong)1 << L1_MAP_ADDR_SPACE_BITS)); #endif assert(start < end); assert_memory_lock(); |