qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Doubt with qemu_cpu_is_self (non-KVM)


From: Peter Maydell
Subject: Re: [Qemu-devel] Doubt with qemu_cpu_is_self (non-KVM)
Date: Mon, 25 Feb 2013 20:28:39 +0000

On 25 February 2013 19:07, Alex Barcelo <address@hidden> wrote:
> I'm struggling with the code to understand the "duty and soul" of the
> "qemu_cpu_is_self" function (@cpus.c), and I quite not get it.
>
> I see that this function is called from some points. E.g., from
> tcg_hangle_interrupt and run_on_cpu. Amongst others.
>
> Sometimes, seems to me that this function duty is "returns if the
> actual thread is an VCPU thread" and sometimes the duty is "return if
> the actual thread is specifically this VCPU thread".
>
> On non-KVM QEMU vanilla, this makes no difference because of a unique
> VCPU thread. But imagine that there is an emulation thread which
> controls multiple VCPU threads...

So the actual implementation is:
 * (for KVM): "return true if this is the specific vcpu thread
   for this core"
 * (for TCG): "return true if this is the [one and only, shared
   between guest cores] CPU thread"

It might help if you can find places where you think that
the caller is making an assumption that isn't right (ie that
won't work with the implementation) and try to explain them.
Then we can look at them and either agree with you or point out
what you've missed.

thanks
-- PMM



reply via email to

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