[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH] cpus: Initialize current_cpu with the first vCPU created
From: |
Paolo Bonzini |
Subject: |
Re: [RFC PATCH] cpus: Initialize current_cpu with the first vCPU created |
Date: |
Thu, 2 Jul 2020 11:52:43 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 |
On 01/07/20 22:35, Peter Maydell wrote:
> For the monitor, that
> would be the current "default cpu" as set by the "cpu"
> command (cf monitor_set_cpu()). The bug here will be that
> somewhere along the line we are probably missing plumbing
> sufficient to pass down "which CPU do we want".
Yeah, the fix is probably to add a functions that returns either
current_cpu or the monitor CPU, and use it in device emulation if
applicable.
The problem with current_cpu is that it affects stuff like run_on_cpu,
and that is guaranteed to cause havoc to code that expects to run on a
given CPU and therefore doesn't use locks.
Paolo