accel/tcg: Pass last not end to tb_invalidate_phys_page_range__locked
authorRichard Henderson <richard.henderson@linaro.org>
Mon, 6 Mar 2023 01:18:34 +0000 (04:18 +0300)
committerRichard Henderson <richard.henderson@linaro.org>
Tue, 28 Mar 2023 22:23:10 +0000 (15:23 -0700)
commit73f96d51ff23592741ef75322cb2dda37b38248f
tree11f60578b7455403749e11b3a21c8def524b8c93
parentf6555e3f39ea118754c03e8b5d92fa3aa0dd6093
accel/tcg: Pass last not end to tb_invalidate_phys_page_range__locked

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.

Properly truncate tb_last to the end of the page; the comment about
tb_end being past the end of the page being ok is not correct,
considering overflow.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
accel/tcg/tb-maint.c