Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
accel/tcg: Assert one page in tb_invalidate_phys_page_range__locked
Ensure that that both the start and last addresses are within
the same guest page.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230629082522.606219-3-mark.cave-ayland@ilande.co.uk>
[rth: Use tcg_debug_assert, simplify the expression]
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
(cherry picked from commit e665cf7)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
  • Loading branch information
mcayland authored and Michael Tokarev committed Jul 2, 2023
1 parent 78e8c9c commit d2402a8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions accel/tcg/tb-maint.c
Expand Up @@ -1093,6 +1093,9 @@ tb_invalidate_phys_page_range__locked(struct page_collection *pages,
TranslationBlock *current_tb = retaddr ? tcg_tb_lookup(retaddr) : NULL;
#endif /* TARGET_HAS_PRECISE_SMC */

/* Range may not cross a page. */
tcg_debug_assert(((start ^ last) & TARGET_PAGE_MASK) == 0);

/*
* We remove all the TBs in the range [start, last].
* XXX: see if in some cases it could be faster to invalidate all the code
Expand Down

0 comments on commit d2402a8

Please sign in to comment.