From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50663) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAwYr-00009g-Si for qemu-devel@nongnu.org; Thu, 09 Jun 2016 05:47:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bAwYn-00017G-Ps for qemu-devel@nongnu.org; Thu, 09 Jun 2016 05:47:37 -0400 Received: from mailapp01.imgtec.com ([195.59.15.196]:38149) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAwYn-000175-JX for qemu-devel@nongnu.org; Thu, 09 Jun 2016 05:47:33 -0400 From: Leon Alrae Date: Thu, 9 Jun 2016 10:46:51 +0100 Message-ID: <1465465612-4543-3-git-send-email-leon.alrae@imgtec.com> In-Reply-To: <1465465612-4543-1-git-send-email-leon.alrae@imgtec.com> References: <1465465612-4543-1-git-send-email-leon.alrae@imgtec.com> MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [PATCH 2/3] hw/mips_cpc: make VP correctly start from the reset vector List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aurelien@aurel32.net When VP enters the Run state it starts execution from the reset vector. Currently used CPU_INTERRUPT_WAKE does not do that if reset exception base has been modified. Therefore fix that by simply resetting given VP. Drop the usage of CPU_INTERRUPT_WAKE also in VP_STOP and instead raise the CPU_INTERRUPT_HALT to halt a VP. Signed-off-by: Leon Alrae --- hw/misc/mips_cpc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/misc/mips_cpc.c b/hw/misc/mips_cpc.c index e6a35dd..6d34574 100644 --- a/hw/misc/mips_cpc.c +++ b/hw/misc/mips_cpc.c @@ -37,7 +37,7 @@ static void cpc_run_vp(MIPSCPCState *cpc, uint64_t vp_run) CPU_FOREACH(cs) { uint64_t i = 1ULL << cs->cpu_index; if (i & vp_run & ~cpc->vp_running) { - cpu_interrupt(cs, CPU_INTERRUPT_WAKE); + cpu_reset(cs); cpc->vp_running |= i; } } @@ -50,8 +50,7 @@ static void cpc_stop_vp(MIPSCPCState *cpc, uint64_t vp_stop) CPU_FOREACH(cs) { uint64_t i = 1ULL << cs->cpu_index; if (i & vp_stop & cpc->vp_running) { - cs->halted = 1; - cpu_reset_interrupt(cs, CPU_INTERRUPT_WAKE); + cpu_interrupt(cs, CPU_INTERRUPT_HALT); cpc->vp_running &= ~i; } } -- 2.7.4