qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [5146] CRIS: Avoid a few unecessary steps in the mmu.
Date: Wed, 03 Sep 2008 14:31:11 +0000	[thread overview]
Message-ID: <E1KatO3-0007O9-Mz@cvs.savannah.gnu.org> (raw)

Revision: 5146
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5146
Author:   edgar_igl
Date:     2008-09-03 14:31:11 +0000 (Wed, 03 Sep 2008)

Log Message:
-----------
CRIS: Avoid a few unecessary steps in the mmu.

Modified Paths:
--------------
    trunk/target-cris/mmu.c

Modified: trunk/target-cris/mmu.c
===================================================================
--- trunk/target-cris/mmu.c	2008-09-03 14:30:27 UTC (rev 5145)
+++ trunk/target-cris/mmu.c	2008-09-03 14:31:11 UTC (rev 5146)
@@ -127,7 +127,7 @@
 {
 	unsigned int vpage;
 	unsigned int idx;
-	uint32_t lo, hi;
+	uint32_t pid, lo, hi;
 	uint32_t tlb_vpn, tlb_pfn = 0;
 	int tlb_pid, tlb_g, tlb_v, tlb_k, tlb_w, tlb_x;
 	int cfg_v, cfg_k, cfg_w, cfg_x;	
@@ -140,6 +140,7 @@
 
 	r_cause = env->sregs[SFR_R_MM_CAUSE];
 	r_cfg = env->sregs[SFR_RW_MM_CFG];
+	pid = env->pregs[PR_PID];
 
 	switch (rw) {
 		case 2: rwcause = CRIS_MMU_ERR_EXEC; mmu = 0; break;
@@ -175,15 +176,14 @@
 		lo = env->tlbsets[mmu][set][idx].lo;
 		hi = env->tlbsets[mmu][set][idx].hi;
 
-		tlb_vpn = EXTRACT_FIELD(hi, 13, 31);
+		tlb_vpn = hi >> 13;
 		tlb_pid = EXTRACT_FIELD(hi, 0, 7);
-		tlb_pfn = EXTRACT_FIELD(lo, 13, 31);
 		tlb_g  = EXTRACT_FIELD(lo, 4, 4);
 
 		D(fprintf(logfile, 
-			 "TLB[%d][%d][%d] v=%x vpage=%x->pfn=%x lo=%x hi=%x\n", 
-			 mmu, set, idx, tlb_vpn, vpage, tlb_pfn, lo, hi));
-		if ((tlb_g || (tlb_pid == (env->pregs[PR_PID] & 0xff)))
+			 "TLB[%d][%d][%d] v=%x vpage=%x lo=%x hi=%x\n", 
+			 mmu, set, idx, tlb_vpn, vpage, lo, hi));
+		if ((tlb_g || (tlb_pid == pid))
 		    && tlb_vpn == vpage) {
 			match = 1;
 			break;
@@ -245,9 +245,6 @@
 		}
 		else
 			D(dump_tlb(env, mmu));
-
-		env->sregs[SFR_RW_MM_TLB_HI] = hi;
-		env->sregs[SFR_RW_MM_TLB_LO] = lo;
 	} else {
 		/* If refill, provide a randomized set.  */
 		set = env->mmu_rand_lfsr & 3;
@@ -278,7 +275,6 @@
 		D(printf("refill vaddr=%x pc=%x\n", vaddr, env->pc));
 	}
 
-
 	D(printf ("%s rw=%d mtch=%d pc=%x va=%x vpn=%x tlbvpn=%x pfn=%x pid=%x"
 		  " %x cause=%x sel=%x sp=%x %x %x\n",
 		  __func__, rw, match, env->pc,
@@ -348,7 +344,7 @@
 
 	if (!cris_mmu_enabled(env->sregs[SFR_RW_GC_CFG])) {
 		res->phy = vaddr;
-		res->prot = PAGE_BITS;		
+		res->prot = PAGE_BITS;
 		goto done;
 	}
 
@@ -361,7 +357,7 @@
 		base = cris_mmu_translate_seg(env, seg);
 		phy = base | (0x0fffffff & vaddr);
 		res->phy = phy;
-		res->prot = PAGE_BITS;		
+		res->prot = PAGE_BITS;
 	}
 	else
 	{

                 reply	other threads:[~2008-09-03 14:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1KatO3-0007O9-Mz@cvs.savannah.gnu.org \
    --to=edgar.iglesias@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).