On 11/22/22 06:35, Peter Maydell wrote:
+    /*
+     * Here we have the architectural atomicity of the operation.
+     * However, when executing in a serial context, we need no extra
+     * host atomicity in order to avoid racing.  This reduction
+     * avoids looping with cpu_loop_exit_atomic.
+     */
+    if (cpu_in_serial_context(env_cpu(env))) {

Is it OK to use cpu_in_serial_context() here ? Even if
there's no other vCPU executing in parallel, there might
be device model code doing a memory write in the iothread,
I think.

Well, it's no different from how we currently treat compare-and-swap expansion. But you have a point -- we should probably be doing something with the iothread lock for both EXCP_ATOMIC and round-robin mode.


r~

Reply via email to