On 23/9/25 04:39, Richard Henderson wrote:
Expose a routine to be called when no cpus are running.
Simplify the do_tb_flush run_on_cpu callback, because
that is explicitly called with start_exclusive; there
is no need for the mmap_lock as well.

Reviewed-by: Pierrick Bouvier <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
---
  include/exec/tb-flush.h | 13 +++++++++++++
  accel/tcg/tb-maint.c    | 33 ++++++++++++++++++++-------------
  2 files changed, 33 insertions(+), 13 deletions(-)

diff --git a/include/exec/tb-flush.h b/include/exec/tb-flush.h
index 142c240d94..5076b13bbd 100644
--- a/include/exec/tb-flush.h
+++ b/include/exec/tb-flush.h
@@ -8,6 +8,19 @@
  #ifndef _TB_FLUSH_H_
  #define _TB_FLUSH_H_
+/**
+ * tb_flush__exclusive() - flush all translation blocks
+ *
+ * Used to flush all the translation blocks in the system.
+ * Sometimes it is simpler to flush everything than work out which
+ * individual translations are now invalid and ensure they are
+ * not called anymore.
+ *
+ * Must be called from an exclusive context, e.g. start_exclusive
+ * or vm_stop.

Worth mentioning it shouldn't be called from target code?

+ */
+void tb_flush__exclusive(void);


Reply via email to