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 From: Aurelien Jarno Date: Sat, 6 Feb 2010 17:43:39 +0100 Message-Id: <1265474623-23367-5-git-send-email-aurelien@aurel32.net> In-Reply-To: <1265474623-23367-1-git-send-email-aurelien@aurel32.net> References: <1265474623-23367-1-git-send-email-aurelien@aurel32.net> Subject: [Qemu-devel] [PATCH 4/8] target-sh4: MMU: fix ITLB priviledge check List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Aurelien Jarno 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; -- 1.6.6.1