[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 04/11] accel/tcg: Assert one page in tb_invalidate_phys_page_range
From: |
Richard Henderson |
Subject: |
[PULL 04/11] accel/tcg: Assert one page in tb_invalidate_phys_page_range__locked |
Date: |
Sat, 1 Jul 2023 08:55:03 +0200 |
From: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
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>
---
accel/tcg/tb-maint.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/accel/tcg/tb-maint.c b/accel/tcg/tb-maint.c
index 33ea1aadd1..9566224d18 100644
--- a/accel/tcg/tb-maint.c
+++ b/accel/tcg/tb-maint.c
@@ -1092,6 +1092,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
--
2.34.1
- [PULL 00/11] tcg and misc patch queue, Richard Henderson, 2023/07/01
- [PULL 01/11] ui/dbus: fix build errors in dbus_update_gl_cb and dbus_call_update_gl, Richard Henderson, 2023/07/01
- [PULL 04/11] accel/tcg: Assert one page in tb_invalidate_phys_page_range__locked,
Richard Henderson <=
- [PULL 03/11] accel/tcg: Fix start page passed to tb_invalidate_phys_page_range__locked, Richard Henderson, 2023/07/01
- [PULL 07/11] target/alpha: Use float64_to_int64_modulo for CVTTQ, Richard Henderson, 2023/07/01
- [PULL 08/11] target/arm: Use float64_to_int32_modulo for FJCVTZS, Richard Henderson, 2023/07/01
- [PULL 09/11] tcg: Reduce tcg_assert_listed_vecop() scope, Richard Henderson, 2023/07/01
- [PULL 05/11] fpu: Add float64_to_int{32,64}_modulo, Richard Henderson, 2023/07/01
- [PULL 02/11] audio: dbus requires pixman, Richard Henderson, 2023/07/01
- [PULL 06/11] tests/tcg/alpha: Add test for cvttq, Richard Henderson, 2023/07/01
- [PULL 11/11] linux-user: Avoid mmap of the last byte of the reserved_va, Richard Henderson, 2023/07/01
- [PULL 10/11] target/nios2 : Explicitly ask for target-endian loads and stores, Richard Henderson, 2023/07/01
- Re: [PULL 00/11] tcg and misc patch queue, Philippe Mathieu-Daudé, 2023/07/01