qemu-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to clone CPUState in a new thread?


From: Peter Maydell
Subject: Re: How to clone CPUState in a new thread?
Date: Thu, 7 Nov 2019 12:52:56 +0000

On Thu, 7 Nov 2019 at 12:46, Michael Goffioul
<address@hidden> wrote:
> Side question: is this the right mailing list to discuss this, or is there a 
> more appropriate one?

You're more likely to find actual QEMU developers reading qemu-devel;
qemu-discuss has fewer contributors and they tend to be more
likely to be end-users or interested in end-user questions
rather than internals.

As for your original question, if you're creating a new
thread and want the new thread's TCG CPU state to match
that of the old thread then the linux-user 'clone' call
is what you want to follow. Duplicating the existing CPU
state is a bit of a hacky codepath but it does work.
If you have a thread that doesn't want to follow the
existing CPU state of some other creating thread but
instead is started with a fixed entirely-known state,
then the code in linux-user/main.c which starts the first
thread of the process might be a better model.

Overall, though, QEMU's code is not designed to be embedded
into some other runtime environment in the way you're doing
it, so I would expect there to be pain involved in trying
to get it to work (especially surrounding threads, new
processes and signals).

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]