Source-Changes-HG archive

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

[src/netbsd-1-6]: src/sys/arch/powerpc/mpc6xx Pull up revision 1.46 (requeste...



details:   https://anonhg.NetBSD.org/src/rev/e7bac9466f5a
branches:  netbsd-1-6
changeset: 529227:e7bac9466f5a
user:      tron <tron%NetBSD.org@localhost>
date:      Fri Nov 01 18:11:55 2002 +0000

description:
Pull up revision 1.46 (requested by matt in ticket #372):
Set SR_PRKEY for user pmaps.  For the kernel SR(s) set SR_SUKEY|SR_PRKEY.
Note that we never use a PTE PP of 0 or 1 (supervisor protection) so the
"key" is basically unused.  However, use SR_PRKEY for user space is
conceptionally the right thing to do.  Currently the kernel_pmap SR(s) are
ignored but that is going to be fixed shortly.

diffstat:

 sys/arch/powerpc/mpc6xx/pmap.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (32 lines):

diff -r f7c871283e2f -r e7bac9466f5a sys/arch/powerpc/mpc6xx/pmap.c
--- a/sys/arch/powerpc/mpc6xx/pmap.c    Fri Nov 01 16:41:53 2002 +0000
+++ b/sys/arch/powerpc/mpc6xx/pmap.c    Fri Nov 01 18:11:55 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.43.4.1 2002/06/06 08:06:54 lukem Exp $      */
+/*     $NetBSD: pmap.c,v 1.43.4.2 2002/11/01 18:11:55 tron Exp $       */
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -904,7 +904,7 @@
                }
                pmap_vsid_bitmap[n] |= mask;
                for (i = 0; i < 16; i++)
-                       pm->pm_sr[i] = VSID_MAKE(i, hash);
+                       pm->pm_sr[i] = VSID_MAKE(i, hash) | SR_PRKEY;
                return;
        }
        panic("pmap_pinit: out of segments");
@@ -2896,11 +2896,11 @@
                              :: "r"(EMPTY_SEGMENT), "r"(i << ADDR_SR_SHFT));
        }
 
-       pmap_kernel()->pm_sr[KERNEL_SR] = KERNEL_SEGMENT;
+       pmap_kernel()->pm_sr[KERNEL_SR] = KERNEL_SEGMENT|SR_SUKEY|SR_PRKEY;
        __asm __volatile ("mtsr %0,%1"
                      :: "n"(KERNEL_SR), "r"(KERNEL_SEGMENT));
 #ifdef KERNEL2_SR
-       pmap_kernel()->pm_sr[KERNEL2_SR] = KERNEL2_SEGMENT;
+       pmap_kernel()->pm_sr[KERNEL2_SR] = KERNEL2_SEGMENT|SR_SUKEY|SR_PRKEY;
        __asm __volatile ("mtsr %0,%1"
                      :: "n"(KERNEL2_SR), "r"(KERNEL2_SEGMENT));
 #endif



Home | Main Index | Thread Index | Old Index