Source-Changes-HG archive

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

[src/netbsd-9]: src Pull up following revision(s) (requested by rin in ticket...



details:   https://anonhg.NetBSD.org/src/rev/9d94af413322
branches:  netbsd-9
changeset: 745296:9d94af413322
user:      martin <martin%NetBSD.org@localhost>
date:      Thu Feb 27 18:48:12 2020 +0000

description:
Pull up following revision(s) (requested by rin in ticket #736):

        lib/libpthread/arch/powerpc/pthread_md.h: revision 1.8
        sys/arch/powerpc/powerpc/sig_machdep.c: revision 1.47

libpthread sets initial value of MSR for lwp's. However, appropriate
value differs b/w oea/booke/ibm4xx, and there's no way to obtain it
from userland. Therefore, this initial value should be corrected by
cpu_setmcontext().

- Comment this in libpthread
- Add KASSERT in cpu_mcontext_validate()

diffstat:

 lib/libpthread/arch/powerpc/pthread_md.h |  7 +++++--
 sys/arch/powerpc/powerpc/sig_machdep.c   |  6 ++++--
 2 files changed, 9 insertions(+), 4 deletions(-)

diffs (48 lines):

diff -r f2062a8407df -r 9d94af413322 lib/libpthread/arch/powerpc/pthread_md.h
--- a/lib/libpthread/arch/powerpc/pthread_md.h  Thu Feb 27 18:43:41 2020 +0000
+++ b/lib/libpthread/arch/powerpc/pthread_md.h  Thu Feb 27 18:48:12 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pthread_md.h,v 1.7 2011/01/25 19:12:05 christos Exp $  */
+/*     $NetBSD: pthread_md.h,v 1.7.46.1 2020/02/27 18:48:12 martin Exp $       */
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -53,7 +53,10 @@
 /*
  * Set initial, sane values for registers whose values aren't just
  * "don't care".
- * 0xd032 is PSL_USERSET from arch/powerpc/include/psl.h
+ *
+ * XXX
+ * "Sane value" for MSR differs between oea/booke/ibm4xx, but no way to
+ * obtain from userland. It should be corrected by cpu_setmcontext().
  */
 #define _INITCONTEXT_U_MD(ucp)                                         \
        (ucp)->uc_mcontext.__gregs[_REG_MSR] = 0xd032;
diff -r f2062a8407df -r 9d94af413322 sys/arch/powerpc/powerpc/sig_machdep.c
--- a/sys/arch/powerpc/powerpc/sig_machdep.c    Thu Feb 27 18:43:41 2020 +0000
+++ b/sys/arch/powerpc/powerpc/sig_machdep.c    Thu Feb 27 18:48:12 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sig_machdep.c,v 1.46 2018/11/27 14:09:54 maxv Exp $    */
+/*     $NetBSD: sig_machdep.c,v 1.46.4.1 2020/02/27 18:48:12 martin Exp $      */
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sig_machdep.c,v 1.46 2018/11/27 14:09:54 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sig_machdep.c,v 1.46.4.1 2020/02/27 18:48:12 martin Exp $");
 
 #include "opt_ppcarch.h"
 #include "opt_altivec.h"
@@ -191,6 +191,8 @@
 int
 cpu_mcontext_validate(struct lwp *l, const mcontext_t *mcp)
 {
+
+       KASSERT(PSL_USEROK_P(mcp->__gregs[_REG_MSR]));
        return 0;
 }
 



Home | Main Index | Thread Index | Old Index