Module Name: src
Committed By: martin
Date: Wed Feb 12 19:35:31 UTC 2020
Modified Files:
src/sys/kern [netbsd-9]: kern_lwp.c
Log Message:
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
To generate a diff of this commit:
cvs rdiff -u -r1.202.2.2 -r1.202.2.3 src/sys/kern/kern_lwp.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/kern/kern_lwp.c
diff -u src/sys/kern/kern_lwp.c:1.202.2.2 src/sys/kern/kern_lwp.c:1.202.2.3
--- src/sys/kern/kern_lwp.c:1.202.2.2 Tue Oct 15 19:01:06 2019
+++ src/sys/kern/kern_lwp.c Wed Feb 12 19:35:31 2020
@@ -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 @@ lwp_create(lwp_t *l1, proc_t *p2, vaddr_
* 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);