提交 22f04c31 编写于 作者: A Aurelien Jarno 提交者: Richard Henderson

target/s390x: fix adj_len_to_page

adj_len_to_page doesn't return the correct result when the address
is already page aligned and the length is bigger than a page. Fix that.
Reviewed-by: NRichard Henderson <rth@twiddle.net>
Signed-off-by: NAurelien Jarno <aurelien@aurel32.net>
Message-Id: <20170531220129.27724-20-aurelien@aurel32.net>
Signed-off-by: NRichard Henderson <rth@twiddle.net>
上级 5c2b48a8
......@@ -61,7 +61,7 @@ static inline uint32_t adj_len_to_page(uint32_t len, uint64_t addr)
{
#ifndef CONFIG_USER_ONLY
if ((addr & ~TARGET_PAGE_MASK) + len - 1 >= TARGET_PAGE_SIZE) {
return -addr & ~TARGET_PAGE_MASK;
return -(addr | TARGET_PAGE_MASK);
}
#endif
return len;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册