summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAurelien Jarno <aurelien@aurel32.net>2010-02-01 20:07:06 +0100
committerAurelien Jarno <aurelien@aurel32.net>2010-04-09 18:22:06 +0200
commit082a9fc2564b3f8177adc2c79a5fd47c34728d72 (patch)
treea5f280a0530ad2825414c1722215df31bc2fc62c
parent36a013c956bec033f6261070671b569c95976194 (diff)
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 <aurelien@aurel32.net> (cherry picked from commit bc13ad29e6b7484ccd5e7ee0f5d0f966585eb4c9)
-rw-r--r--target-sh4/helper.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/target-sh4/helper.c b/target-sh4/helper.c
index e7c494fb9a..21b76456a8 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;