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.

Backports commit de258eb07db6cf893ef1bfad8c0cedc0b983db55 from qemu
This commit is contained in:
Richard Henderson 2018-03-05 03:53:06 -05:00 committed by Lioncash
parent 6f265062ef
commit c897ba3e2c
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -2117,7 +2117,7 @@ static void page_set_flags(struct uc_struct *uc, target_ulong start, target_ulon
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);