Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/mips/mips Amplify comments per thread in source-cha...



details:   https://anonhg.NetBSD.org/src/rev/3b9eebae468f
branches:  trunk
changeset: 758591:3b9eebae468f
user:      dholland <dholland%NetBSD.org@localhost>
date:      Wed Nov 10 01:49:00 2010 +0000

description:
Amplify comments per thread in source-changes-d about the previous
commit to this file: we must restore the PID value (that is, the
current address space ID) before touching memory, or the memory writes
might go to arbitrary wrong places or fault.

I'm not completely convinced this function (or other functions in this
file) are handling pipeline hazards safely, but I don't have
authoritative mips1 documentation any more so I'm not going to meddle.

diffstat:

 sys/arch/mips/mips/locore_mips1.S |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (22 lines):

diff -r 9ea08819ae9f -r 3b9eebae468f sys/arch/mips/mips/locore_mips1.S
--- a/sys/arch/mips/mips/locore_mips1.S Wed Nov 10 01:44:04 2010 +0000
+++ b/sys/arch/mips/mips/locore_mips1.S Wed Nov 10 01:49:00 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: locore_mips1.S,v 1.68 2010/11/08 18:09:38 pooka Exp $  */
+/*     $NetBSD: locore_mips1.S,v 1.69 2010/11/10 01:49:00 dholland Exp $       */
 
 /*
  * Copyright (c) 1992, 1993
@@ -926,9 +926,10 @@
        mfc0    t2, MIPS_COP_0_TLB_HI           # fetch the hi entry
        mfc0    t3, MIPS_COP_0_TLB_LOW          # fetch the low entry
 
-       mtc0    t0, MIPS_COP_0_TLB_HI           # restore PID
+       mtc0    t0, MIPS_COP_0_TLB_HI           # Restore proper PID
+                                               # (before touching memory)
        mtc0    v1, MIPS_COP_0_STATUS           # Restore the status register
-       sw      t2, 0(a1)
+       sw      t2, 0(a1)                       # Write results back
        j       ra
        sw      t3, 4(a1)
 END(mips1_TLBRead)



Home | Main Index | Thread Index | Old Index