Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/powerpc/ibm4xx Fix pmap_procwr().



details:   https://anonhg.NetBSD.org/src/rev/46d6cb6a5eb8
branches:  trunk
changeset: 745557:46d6cb6a5eb8
user:      rin <rin%NetBSD.org@localhost>
date:      Thu Mar 05 11:44:54 2020 +0000

description:
Fix pmap_procwr().

While we need to turn off IMMU, DMMU should be kept on. Otherwise,
dcbst (and also icbi probably, though not documented clearly both
for 405 and 403) should not work correctly.

diffstat:

 sys/arch/powerpc/ibm4xx/pmap.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (39 lines):

diff -r e37884efde7d -r 46d6cb6a5eb8 sys/arch/powerpc/ibm4xx/pmap.c
--- a/sys/arch/powerpc/ibm4xx/pmap.c    Thu Mar 05 11:33:14 2020 +0000
+++ b/sys/arch/powerpc/ibm4xx/pmap.c    Thu Mar 05 11:44:54 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.84 2020/03/05 02:14:52 rin Exp $    */
+/*     $NetBSD: pmap.c,v 1.85 2020/03/05 11:44:54 rin Exp $    */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.84 2020/03/05 02:14:52 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.85 2020/03/05 11:44:54 rin Exp $");
 
 #include <sys/param.h>
 #include <sys/cpu.h>
@@ -1175,8 +1175,9 @@
        }
        __asm volatile(
                "mfmsr %0;"
-               "li %1, %7;"
+               "li %1,0x20;"           /* Turn off IMMU */
                "andc %1,%0,%1;"
+               "ori %1,%1,0x10;"       /* Turn on DMMU for sure */
                "mtmsr %1;"
                "sync;isync;"
                "mfpid %1;"
@@ -1192,8 +1193,7 @@
                "mtmsr %0;"
                "sync; isync"
                : "=&r" (msr), "=&r" (opid)
-               : "r" (ctx), "r" (va), "r" (len), "r" (step), "r" (-step),
-                 "K" (PSL_IR | PSL_DR));
+               : "r" (ctx), "r" (va), "r" (len), "r" (step), "r" (-step));
 }
 
 



Home | Main Index | Thread Index | Old Index