|
From: | Richard Henderson |
Subject: | Re: [PATCH for-8.0 07/29] accel/tcg: Honor atomicity of loads |
Date: | Tue, 22 Nov 2022 10:04:01 -0800 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 |
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~
[Prev in Thread] | Current Thread | [Next in Thread] |