From patchwork Thu Apr 14 09:29:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artyom Tarasenko X-Patchwork-Id: 610403 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3qlwQp420vz9sDb for ; Thu, 14 Apr 2016 19:31:14 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=Ht7U/oMh; dkim-atps=neutral Received: from localhost ([::1]:35756 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqdcG-0007f3-3f for incoming@patchwork.ozlabs.org; Thu, 14 Apr 2016 05:31:12 -0400 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=YarT9xpuA90pnFVyzJEfG6VbHE+SPZONFfTjUpoLh2w=; b=Ht7U/oMhS8Y9QuN7VN2nDG4O4+qk5D7hzil07Ovg1JmhuE9t6pHpv+le3oI/wb0Ifg OPsn6oV2TG8TTOJVWaNMEp9wNrrDN1YwiwViyJdD3BQHIsCDGQZ/rSlK9zzDULz4zuQF 45SdF1fSHqdLXosY6S2PkxHhKXGxOmptqmwUELx7RWMc34jmkn1bmxZc4Zi6KRVhYA1C BSMW+5ETbciNFUdBG9oKUhYFu/dzdA1Yxu0a7Q+GYVSPYG3WIf73RqSloHEhUU0Z0pSs 7zeuwa2vVcDyiksfwH6hdY9vXC7wBTwchV6Xt39Ma095rtvxSBNUtt9Nwq4W75oVwlyh 6sMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=YarT9xpuA90pnFVyzJEfG6VbHE+SPZONFfTjUpoLh2w=; b=Q5NyVH144jIJWjSi/DFgXk2A/DvvKbs3iMSPnMz/k3Aiu14IA/F4G3DyC14s/euGoB SDz8MNH9VxD4nkqWAolBcm73WlssPXhLvCkz+hdwZiLBhroMaQSwbmcOlfON9rgeyC85 rGel9cQLiQOiHDsUJeZPhV4uwMK3OUG33/eAHCrQeJ7HRJBZ4RLMM3/qSBH2K0aNDCz0 Um+ekOMMQEcE1FC8otWe/H903pCsnaeCMwJqDB7KvllVdt3wLsNhFNQ8bEJTD3BcAC9F Lr+J2B4Cty9kfiqENbtrOHaRMgWiMPpgzh8Rn3VGajyniBP3y1xAXD3qi6sij7cc1UPr niIQ== X-Gm-Message-State: AOPr4FXIuSvON/kWMIFODz5DFRmT1U19llJOBEQ5una3JQ4RmWTiZ+WOSOesWZ9HfmTcFg== X-Received: by 10.194.202.195 with SMTP id kk3mr14554067wjc.159.1460626174927; Thu, 14 Apr 2016 02:29:34 -0700 (PDT) Received: from localhost (x55b5cb60.dyn.telefonica.de. [85.181.203.96]) by smtp.gmail.com with ESMTPSA id r204sm16708621wmg.20.2016.04.14.02.29.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Apr 2016 02:29:34 -0700 (PDT) From: Artyom Tarasenko To: qemu-devel@nongnu.org Date: Thu, 14 Apr 2016 11:29:16 +0200 Message-Id: <1d5b26fed5e9648e4672545085509ea5ad8a9a60.1460625412.git.atar4qemu@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::242 Subject: [Qemu-devel] [PATCH 2/2 for-2.6] target-sparc: fix Trap Based Address Register behavior for sparc64 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.cave-ayland@ilande.co.uk, Artyom Tarasenko , rth@twiddle.net Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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; }