From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:57062) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TK4FU-0006ev-0q for qemu-devel@nongnu.org; Fri, 05 Oct 2012 05:31:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TK4F5-0000NZ-UE for qemu-devel@nongnu.org; Fri, 05 Oct 2012 05:31:11 -0400 Received: from mailout-de.gmx.net ([213.165.64.23]:36831) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1TK4F5-0000Lk-8L for qemu-devel@nongnu.org; Fri, 05 Oct 2012 05:30:47 -0400 Message-ID: <506EA82A.3070301@gmx.de> Date: Fri, 05 Oct 2012 11:28:10 +0200 From: Ronald Hecht MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [RFC] Starting a (secondary) CPU when it is halted or reset List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Hello all, I have a question regarding LEON SPARC SMP. In a LEON SPARC SMP system secondary CPUs (others that CPU#0) can be started by setting certain bits in the interrupt controller. At startup (reset) all CPUs are halted except CPU#0. In QEMU version 0.12 it was possible to simply set CPUSPARCState.halted to "0" to start a secondary CPU. This is no longer possible and reliable. The CPU that should be started does not wake up by doing this: env->halted = 0; qemu_cpu_kick(env); It seems that the running CPU blocks the startup of the halted CPU. I need to notice, that the halted CPU has interrupts (and traps) disabled at startup. Thus, it is not possible to start the CPU by raising an interrupt. I was playing with several things and I found that doing env->halted = 0; qemu_cpu_kick(env); cpu_exit(cpu_single_env); helps. The statement cpu_exit(cpu_single_env) forces the current CPU (cpu_single_env) to exit the execution loop and which allows to start the other CPU (env). I'm unsure if this is the correct way to solve my problem. Any comments on this? Thanks and best regards, Ronald