mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 23:03:54 -06:00
accel/tcg: Pass last not end to page_reset_target_data
Pass the address of the last byte to be changed, rather than the first address past the last byte. This avoids overflow when the last page of the address space is involved. Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
49840a4a09
commit
10310cbd62
3 changed files with 7 additions and 8 deletions
|
@ -946,7 +946,7 @@ abi_long target_madvise(abi_ulong start, abi_ulong len_in, int advice)
|
|||
if (can_passthrough_madvise(start, end)) {
|
||||
ret = get_errno(madvise(g2h_untagged(start), len, advice));
|
||||
if ((advice == MADV_DONTNEED) && (ret == 0)) {
|
||||
page_reset_target_data(start, start + len);
|
||||
page_reset_target_data(start, start + len - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue