@@ -1807,21 +1807,28 @@ void tb_invalidate_phys_range(target_ulong start, target_ulong end)
}
#ifdef CONFIG_SOFTMMU
-/* len must be <= 8 and start must be a multiple of len.
+/*
+ * len must be <= 8 and start must be a multiple of len.
* Called via softmmu_template.h when code areas are written to with
* iothread mutex not held.
*
- * Call with all @pages in the range [@start, @start + len[ locked.
+ * Call with all @pages in the range [@start, @start + len] locked.
*/
void tb_invalidate_phys_page_fast(struct page_collection *pages,
tb_page_addr_t start, int len,
uintptr_t retaddr)
{
- PageDesc *p;
+ PageDesc *p = page_find(start >> TARGET_PAGE_BITS);
+
+ if (trace_event_get_state_backends(TRACE_TB_INVALIDATE_PHYS_PAGE_FAST)) {
+ TranslationBlock *tb = tcg_tb_lookup(retaddr);
+ g_assert(tb);
+ trace_tb_invalidate_phys_page_fast(start, len, tb->pc,
+ p->code_write_count, p->code_bitmap);
+ }
assert_memory_lock();
- p = page_find(start >> TARGET_PAGE_BITS);
if (!p) {
return;
}
@@ -11,4 +11,5 @@ memory_notdirty_write_access(uint64_t vaddr, uint64_t ram_addr, unsigned size) "
memory_notdirty_set_dirty(uint64_t vaddr) "0x%" PRIx64
# translate-all.c
+tb_invalidate_phys_page_fast(uint64_t page_start, int len, uint64_t ret, int wc, void *bmap) "addr:0x%" PRIx64 "/%d pc:0x%" PRIx64" wc:%d/%p"
translate_block(void *tb, uintptr_t pc, const void *tb_code) "tb:%p, pc:0x%"PRIxPTR", tb_code:%p"
These events can be very expensive for the translator so lets add a tracepoint to help with debugging what might be causing them. Clean up the comments while we are at it. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> --- accel/tcg/translate-all.c | 15 +++++++++++---- accel/tcg/trace-events | 1 + 2 files changed, 12 insertions(+), 4 deletions(-)