From: Aurelien Jarno Date: Mon, 1 Feb 2010 19:07:06 +0000 (+0100) Subject: target-sh4: MMU: fix ITLB priviledge check X-Git-Tag: v0.12.4~30 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=082a9fc2564b3f8177adc2c79a5fd47c34728d72;p=thirdparty%2Fqemu.git target-sh4: MMU: fix ITLB priviledge check 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 (cherry picked from commit bc13ad29e6b7484ccd5e7ee0f5d0f966585eb4c9) --- diff --git a/target-sh4/helper.c b/target-sh4/helper.c index e7c494fb9a4..21b76456a85 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;