Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/powerpc/mpc6xx Set SR_PRKEY for user pmaps. For th...



details:   https://anonhg.NetBSD.org/src/rev/e3dead70d99e
branches:  trunk
changeset: 533255:e3dead70d99e
user:      matt <matt%NetBSD.org@localhost>
date:      Wed Jun 26 01:10:20 2002 +0000

description:
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 3a9f2f79049d -r e3dead70d99e sys/arch/powerpc/mpc6xx/pmap.c
--- a/sys/arch/powerpc/mpc6xx/pmap.c    Wed Jun 26 01:06:44 2002 +0000
+++ b/sys/arch/powerpc/mpc6xx/pmap.c    Wed Jun 26 01:10:20 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.45 2002/06/05 15:55:51 scw Exp $    */
+/*     $NetBSD: pmap.c,v 1.46 2002/06/26 01:10:20 matt 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