On 29/9/25 06:28, Benjamin Herrenschmidt wrote:
On Wed, 2025-09-24 at 19:30 +0200, Philippe Mathieu-Daudé wrote:
gen_pause() sets CPUState::halted = 0, effectively unhalting
(a.k.a. "running") the cpu. Correct by setting the '1' value
to really halt the cpu.

What will resume it though ? The smt_low() case isn't meant to *halt*
the CPUs permanently. smt_*() levels are about SMT thread priorities.
Using a "pause" that just gets out of TCG (and back in), is a way to
"yield" to another thread, thus enabling more forward progress when a

What you describe can be achieved with a helper doing:

  cs->exception_index = EXCP_YIELD;
  cpu_loop_exit(cs);

Is that what you wanted?

thread is spinning on an smt_low() loop. This happens in firmware and
in some spinlock cases.

This isn't about stopping until some external event resumes it.

Cheers,
Ben.



Reply via email to