]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
target-sh4: MMU: fix ITLB priviledge check
authorAurelien Jarno <aurelien@aurel32.net>
Mon, 1 Feb 2010 19:07:06 +0000 (20:07 +0100)
committerAurelien Jarno <aurelien@aurel32.net>
Fri, 9 Apr 2010 16:22:06 +0000 (18:22 +0200)
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)

target-sh4/helper.c

index e7c494fb9a42f9f4283c411f6df5c72d40529f8e..21b76456a8555a3dd047e3309dfd981e929de5c4 100644 (file)
@@ -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;