On 3/7/25 18:37, Alex Bennée wrote:
Philippe Mathieu-Daudé <phi...@linaro.org> writes:

vCPUs are not really usable until fully realized. Do not attempt
to commit memory changes in the middle of vCPU realization. Defer
until realization is completed and vCPU fully operational.

Signed-off-by: Philippe Mathieu-Daudé <phi...@linaro.org>
Reviewed-by: Richard Henderson <richard.hender...@linaro.org>
---
  system/physmem.c | 8 ++++++++
  1 file changed, 8 insertions(+)

diff --git a/system/physmem.c b/system/physmem.c
index ff0ca40222d..8b2be31fa7e 100644
--- a/system/physmem.c
+++ b/system/physmem.c
@@ -2792,6 +2792,14 @@ static void tcg_commit(MemoryListener *listener)
      cpuas = container_of(listener, CPUAddressSpace, tcg_as_listener);
      cpu = cpuas->cpu;
+ if (!qdev_is_realized(DEVICE(cpu))) {
+        /*
+         * The listener is also called during realize, before
+         * all of the tcg machinery for run-on is initialized.
+         */
+        return;
+    }
+

This is a c&p of the wording bellow:

      * That said, the listener is also called during realize, before
      * all of the tcg machinery for run-on is initialized: thus halt_cond.

which is now redundant because of the early exit?

Commit 0d58c660689 ("softmmu: Use async_run_on_cpu in tcg_commit") hmmm.

I don't understand enough this area, so I'll drop this patch for now and
keep carrying it for split accel.

Regards,

Phil.


Reply via email to