[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 05/10] tcg: Fix off-by-one in assert in page_set_flag
From: |
riku . voipio |
Subject: |
[Qemu-devel] [PULL 05/10] tcg: Fix off-by-one in assert in page_set_flags |
Date: |
Wed, 18 Oct 2017 15:33:19 +0300 |
From: Richard Henderson <address@hidden>
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 <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>
---
accel/tcg/translate-all.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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();
--
2.14.2
- [Qemu-devel] [PULL 00/10] linux-user update for 2.11, riku . voipio, 2017/10/18
- [Qemu-devel] [PULL 03/10] linux-user: remove duplicate break in syscall, riku . voipio, 2017/10/18
- [Qemu-devel] [PULL 05/10] tcg: Fix off-by-one in assert in page_set_flags,
riku . voipio <=
- [Qemu-devel] [PULL 01/10] linux-user: fix O_TMPFILE handling, riku . voipio, 2017/10/18
- [Qemu-devel] [PULL 02/10] target/m68k, linux-user: manage FP registers in ucontext, riku . voipio, 2017/10/18
- [Qemu-devel] [PULL 04/10] linux-user: Allow -R values up to 0xffff0000 for 32-bit ARM guests, riku . voipio, 2017/10/18
- [Qemu-devel] [PULL 07/10] linux-user/sh4: Reduce TARGET_VIRT_ADDR_SPACE_BITS to 31, riku . voipio, 2017/10/18
- [Qemu-devel] [PULL 06/10] linux-user: Tidy and enforce reserved_va initialization, riku . voipio, 2017/10/18
- [Qemu-devel] [PULL 10/10] linux-user: Fix TARGET_MTIOCTOP/MTIOCGET/MTIOCPOS values, riku . voipio, 2017/10/18
- [Qemu-devel] [PULL 09/10] linux-user/main: support dfilter, riku . voipio, 2017/10/18
- [Qemu-devel] [PULL 08/10] linux-user: Fix target FS_IOC_GETFLAGS and FS_IOC_SETFLAGS numbers, riku . voipio, 2017/10/18
- Re: [Qemu-devel] [PULL 00/10] linux-user update for 2.11, Peter Maydell, 2017/10/19
- Re: [Qemu-devel] [PULL 00/10] linux-user update for 2.11, no-reply, 2017/10/22