From patchwork Sat Feb 6 16:43:39 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aurelien Jarno X-Patchwork-Id: 44712 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 5C65DB7D2D for ; Sun, 7 Feb 2010 04:04:17 +1100 (EST) Received: from localhost ([127.0.0.1]:48766 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ndo3m-0004JF-RZ for incoming@patchwork.ozlabs.org; Sat, 06 Feb 2010 12:03:06 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ndnlm-00073A-HL for qemu-devel@nongnu.org; Sat, 06 Feb 2010 11:44:30 -0500 Received: from [199.232.76.173] (port=59330 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ndnll-000732-Ow for qemu-devel@nongnu.org; Sat, 06 Feb 2010 11:44:29 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Ndnlk-0005Br-EV for qemu-devel@nongnu.org; Sat, 06 Feb 2010 11:44:29 -0500 Received: from mx20.gnu.org ([199.232.41.8]:39494) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Ndnlj-00051I-Lc for qemu-devel@nongnu.org; Sat, 06 Feb 2010 11:44:28 -0500 Received: from hall.aurel32.net ([88.191.82.174]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NdnlD-0005k7-F0 for qemu-devel@nongnu.org; Sat, 06 Feb 2010 11:43:55 -0500 Received: from [2002:52e8:2fb:1:21e:8cff:feb0:693b] (helo=volta.aurel32.net) by hall.aurel32.net with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1NdnlC-0007r9-3e; Sat, 06 Feb 2010 17:43:54 +0100 Received: from aurel32 by volta.aurel32.net with local (Exim 4.71) (envelope-from ) id 1NdnlA-00065g-Ou; Sat, 06 Feb 2010 17:43:52 +0100 From: Aurelien Jarno To: qemu-devel@nongnu.org Date: Sat, 6 Feb 2010 17:43:39 +0100 Message-Id: <1265474623-23367-5-git-send-email-aurelien@aurel32.net> X-Mailer: git-send-email 1.6.6.1 In-Reply-To: <1265474623-23367-1-git-send-email-aurelien@aurel32.net> References: <1265474623-23367-1-git-send-email-aurelien@aurel32.net> X-detected-operating-system: by mx20.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Cc: Aurelien Jarno Subject: [Qemu-devel] [PATCH 4/8] target-sh4: MMU: fix ITLB priviledge check X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org There is an ITLB access violation if SR_MD=0 (user mode) while the high bit of the protection key is 0 (priviledge mode). Signed-off-by: Aurelien Jarno --- target-sh4/helper.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/target-sh4/helper.c b/target-sh4/helper.c index f9bf5e2..589efe4 100644 --- a/target-sh4/helper.c +++ b/target-sh4/helper.c @@ -377,7 +377,7 @@ static int get_mmu_address(CPUState * env, target_ulong * physical, n = find_itlb_entry(env, address, use_asid, 1); if (n >= 0) { matching = &env->itlb[n]; - if ((env->sr & SR_MD) & !(matching->pr & 2)) + if (!(env->sr & SR_MD) && !(matching->pr & 2)) n = MMU_ITLB_VIOLATION; else *prot = PAGE_READ;