qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [4991] Fix I/D MMU tag reads
@ 2008-08-06 18:16 Blue Swirl
  0 siblings, 0 replies; only message in thread
From: Blue Swirl @ 2008-08-06 18:16 UTC (permalink / raw)
  To: qemu-devel

Revision: 4991
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4991
Author:   blueswir1
Date:     2008-08-06 18:16:08 +0000 (Wed, 06 Aug 2008)

Log Message:
-----------
Fix I/D MMU tag reads

Modified Paths:
--------------
    trunk/target-sparc/op_helper.c

Modified: trunk/target-sparc/op_helper.c
===================================================================
--- trunk/target-sparc/op_helper.c	2008-08-06 18:13:54 UTC (rev 4990)
+++ trunk/target-sparc/op_helper.c	2008-08-06 18:16:08 UTC (rev 4991)
@@ -1674,34 +1674,9 @@
         }
     case 0x56: // I-MMU tag read
         {
-            unsigned int i;
+            int reg = (addr >> 3) & 0x3f;
 
-            for (i = 0; i < 64; i++) {
-                // Valid, ctx match, vaddr match
-                if ((env->itlb_tte[i] & 0x8000000000000000ULL) != 0) {
-                    uint64_t mask;
-
-                    switch ((env->itlb_tte[i] >> 61) & 3) {
-                    default:
-                    case 0x0:
-                        mask = 0xffffffffffffffff;
-                        break;
-                    case 0x1:
-                        mask = 0xffffffffffff0fff;
-                        break;
-                    case 0x2:
-                        mask = 0xfffffffffff80fff;
-                        break;
-                    case 0x3:
-                        mask = 0xffffffffffc00fff;
-                        break;
-                    }
-                    if ((env->itlb_tag[i] & mask) == (addr & mask)) {
-                        ret = env->itlb_tte[i];
-                        break;
-                    }
-                }
-            }
+            ret = env->itlb_tag[reg];
             break;
         }
     case 0x58: // D-MMU regs
@@ -1720,34 +1695,9 @@
         }
     case 0x5e: // D-MMU tag read
         {
-            unsigned int i;
+            int reg = (addr >> 3) & 0x3f;
 
-            for (i = 0; i < 64; i++) {
-                // Valid, ctx match, vaddr match
-                if ((env->dtlb_tte[i] & 0x8000000000000000ULL) != 0) {
-                    uint64_t mask;
-
-                    switch ((env->dtlb_tte[i] >> 61) & 3) {
-                    default:
-                    case 0x0:
-                        mask = 0xffffffffffffffff;
-                        break;
-                    case 0x1:
-                        mask = 0xffffffffffff0fff;
-                        break;
-                    case 0x2:
-                        mask = 0xfffffffffff80fff;
-                        break;
-                    case 0x3:
-                        mask = 0xffffffffffc00fff;
-                        break;
-                    }
-                    if ((env->dtlb_tag[i] & mask) == (addr & mask)) {
-                        ret = env->dtlb_tte[i];
-                        break;
-                    }
-                }
-            }
+            ret = env->dtlb_tag[reg];
             break;
         }
     case 0x46: // D-cache data

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-08-06 18:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-06 18:16 [Qemu-devel] [4991] Fix I/D MMU tag reads Blue Swirl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).