qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/2] accel/tcg: add assert() check in tb_invalidate_phys_page


From: Michael Tokarev
Subject: Re: [PATCH 2/2] accel/tcg: add assert() check in tb_invalidate_phys_page_range__locked()
Date: Fri, 30 Jun 2023 11:05:01 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0

29.06.2023 11:25, Mark Cave-Ayland wrote:
Add an assert() check in tb_invalidate_phys_page_range__locked() to ensure that
both the start and last addresses are within the same target page. Note that
due to performance concerns the check is only enabled when QEMU is configured
with --enable-debug-tcg.

Performance concerns? That's two ANDs and on compare, - is it really that 
performance
critical?

I'm just asking, I dunno.

Thanks,

/mjt

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
  accel/tcg/tb-maint.c | 4 ++++
  1 file changed, 4 insertions(+)

diff --git a/accel/tcg/tb-maint.c b/accel/tcg/tb-maint.c
index 33ea1aadd1..8cd730dcb0 100644
--- a/accel/tcg/tb-maint.c
+++ b/accel/tcg/tb-maint.c
@@ -1092,6 +1092,10 @@ tb_invalidate_phys_page_range__locked(struct 
page_collection *pages,
      TranslationBlock *current_tb = retaddr ? tcg_tb_lookup(retaddr) : NULL;
  #endif /* TARGET_HAS_PRECISE_SMC */
+#ifdef CONFIG_DEBUG_TCG
+    assert((last & TARGET_PAGE_MASK) == (start & TARGET_PAGE_MASK));
+#endif
+
      /*
       * 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]