From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56525) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aUBej-00046t-Ce for qemu-devel@nongnu.org; Fri, 12 Feb 2016 06:12:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aUBeg-0004Jh-6J for qemu-devel@nongnu.org; Fri, 12 Feb 2016 06:12:57 -0500 Received: from mail.uni-paderborn.de ([131.234.142.9]:59364) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aUBef-0004JY-Uw for qemu-devel@nongnu.org; Fri, 12 Feb 2016 06:12:54 -0500 References: <1455206520-6465-1-git-send-email-kbastian@mail.uni-paderborn.de> <1455206520-6465-2-git-send-email-kbastian@mail.uni-paderborn.de> <56BD45D4.7000408@twiddle.net> From: Bastian Koppelmann Message-ID: <56BDBE2D.6020209@mail.uni-paderborn.de> Date: Fri, 12 Feb 2016 12:12:45 +0100 MIME-Version: 1.0 In-Reply-To: <56BD45D4.7000408@twiddle.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/5] target-tricore: Add trap handling List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson , qemu-devel@nongnu.org On 02/12/2016 03:39 AM, Richard Henderson wrote: > On 02/12/2016 03:01 AM, Bastian Koppelmann wrote: >> +void tricore_cpu_do_interrupt(CPUState *cs) >> +{ >> + TriCoreCPU *cpu = TRICORE_CPU(cs); >> + CPUTriCoreState *env = &cpu->env; >> + >> + /* The stack pointer in A[10] is set to the Interrupt Stack >> Pointer (ISP) >> + when the processor was not previously using the interrupt stack >> + (in case of PSW.IS = 0). The stack pointer bit is set for >> using the >> + interrupt stack: PSW.IS = 1. */ >> + if ((env->PSW & MASK_PSW_IS) == 0) { >> + env->gpr_a[10] = env->ISP; >> + } > > You appear to have forgotten to save pre-interrupt state here. What do you mean by "pre-interrupt state"? The register context is saved by generate_trap() calls. Cheers, Bastian