On 2023/09/13 15:17, Philippe Mathieu-Daudé wrote:
On 13/9/23 00:40, Akihiko Odaki wrote:
The created member of CPUState tells if the vCPU thread is started, and
will be always false for the user space emulation that manages threads
independently.

Per the docstring:

  /**
   * CPUState:

   * @created: Indicates whether the CPU thread has been
   *           successfully created.

Each CPU DeviceClass's DeviceRealize() handler which calls
qemu_init_vcpu(). Ah, what we miss is:

-- >8 --
--- a/accel/tcg/user-exec-stub.c
+++ b/accel/tcg/user-exec-stub.c
@@ -14,6 +14,7 @@ void cpu_remove_sync(CPUState *cpu)

  void qemu_init_vcpu(CPUState *cpu)
  {
+    cpu->created = true;
  }
---

Missed in commit c7f0f3b1c8 ("qtest: add test framework").

I think the member is never set for user space emulation since it was introduced with commit d6dc3d424e ("qemu: introduce iothread (Marcelo Tosatti)")


Does that help?

That will work, but I don't think it makes sense to set this member while the other members related to vCPU thread like the "thread" member are unset.

Reply via email to