Source-Changes-HG archive

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

[src/netbsd-9]: src/sys/kern Pull up following revision(s) (requested by maya...



details:   https://anonhg.NetBSD.org/src/rev/c86e9f753f9f
branches:  netbsd-9
changeset: 963607:c86e9f753f9f
user:      martin <martin%NetBSD.org@localhost>
date:      Wed Feb 12 19:35:31 2020 +0000

description:
Pull up following revision(s) (requested by maya in ticket #697):

        sys/kern/kern_lwp.c: revision 1.224
        sys/kern/kern_lwp.c: revision 1.225

Preserve pcu(9) state in fork.

There should perhaps be a pcu_fork operation to keep this factored
neatly but this will be simpler to pull up.

In practical terms, this may not affect most architecture that use
pcu(9) -- alpha, arm32, mips, powerpc, riscv -- but it does affect
aarch64, in which v8-v15 are callee-saves, and GCC actually takes
advantage of them, and for more than just floating-point data too.

XXX pullup

fix compilation failure for arches without l_pcu_valid
ok riastradh

diffstat:

 sys/kern/kern_lwp.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (28 lines):

diff -r bce035fdf172 -r c86e9f753f9f sys/kern/kern_lwp.c
--- a/sys/kern/kern_lwp.c       Tue Feb 11 11:38:05 2020 +0000
+++ b/sys/kern/kern_lwp.c       Wed Feb 12 19:35:31 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_lwp.c,v 1.202.2.2 2019/10/15 19:01:06 martin Exp $        */
+/*     $NetBSD: kern_lwp.c,v 1.202.2.3 2020/02/12 19:35:31 martin Exp $        */
 
 /*-
  * Copyright (c) 2001, 2006, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -211,7 +211,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_lwp.c,v 1.202.2.2 2019/10/15 19:01:06 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_lwp.c,v 1.202.2.3 2020/02/12 19:35:31 martin Exp $");
 
 #include "opt_ddb.h"
 #include "opt_lockdebug.h"
@@ -897,6 +897,9 @@
         * the MD cpu_lwp_fork() can copy the saved state to the new LWP.
         */
        pcu_save_all(l1);
+#if PCU_UNIT_COUNT > 0
+       l2->l_pcu_valid = l1->l_pcu_valid;
+#endif
 
        uvm_lwp_setuarea(l2, uaddr);
        uvm_lwp_fork(l1, l2, stack, stacksize, func, (arg != NULL) ? arg : l2);



Home | Main Index | Thread Index | Old Index