From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54495) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqdai-0000KC-Ig for qemu-devel@nongnu.org; Thu, 14 Apr 2016 05:29:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aqdah-000803-MI for qemu-devel@nongnu.org; Thu, 14 Apr 2016 05:29:36 -0400 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:34547) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqdah-0007zn-G2 for qemu-devel@nongnu.org; Thu, 14 Apr 2016 05:29:35 -0400 Received: by mail-wm0-x242.google.com with SMTP id n3so21101856wmn.1 for ; Thu, 14 Apr 2016 02:29:35 -0700 (PDT) From: Artyom Tarasenko Date: Thu, 14 Apr 2016 11:29:16 +0200 Message-Id: <1d5b26fed5e9648e4672545085509ea5ad8a9a60.1460625412.git.atar4qemu@gmail.com> In-Reply-To: References: In-Reply-To: References: Subject: [Qemu-devel] [PATCH 2/2 for-2.6] target-sparc: fix Trap Based Address Register behavior for sparc64 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, rth@twiddle.net, Artyom Tarasenko Accoding the chapter 7.6 Trap Processing of the SPARC Architecture Manual v9, the Trap Based Address Register is not modified as a trap is taken. This fix allows booting FreeBSD-10.3-RELEASE-sparc64. Signed-off-by: Artyom Tarasenko --- target-sparc/int64_helper.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/target-sparc/int64_helper.c b/target-sparc/int64_helper.c index aa876cd..29360fa 100644 --- a/target-sparc/int64_helper.c +++ b/target-sparc/int64_helper.c @@ -158,9 +158,8 @@ void sparc_cpu_do_interrupt(CPUState *cs) } else if ((intno & 0x1c0) == TT_FILL) { cpu_set_cwp(env, cpu_cwp_inc(env, env->cwp + 1)); } - env->tbr &= ~0x7fffULL; - env->tbr |= ((env->tl > 1) ? 1 << 14 : 0) | (intno << 5); - env->pc = env->tbr; + env->pc = env->tbr & ~0x7fffULL; + env->pc |= ((env->tl > 1) ? 1 << 14 : 0) | (intno << 5); env->npc = env->pc + 4; cs->exception_index = -1; } -- 1.8.3.1