git: 40d593d17eb6 - main - x86: Update some stale comments in cpu_fork() and cpu_copy_thread().
John Baldwin
jhb at FreeBSD.org
Fri Mar 12 17:49:33 UTC 2021
The branch main has been updated by jhb:
URL: https://cgit.FreeBSD.org/src/commit/?id=40d593d17eb6d70ea717d6546a16794858944176
commit 40d593d17eb6d70ea717d6546a16794858944176
Author: John Baldwin <jhb at FreeBSD.org>
AuthorDate: 2021-03-12 17:48:49 +0000
Commit: John Baldwin <jhb at FreeBSD.org>
CommitDate: 2021-03-12 17:48:49 +0000
x86: Update some stale comments in cpu_fork() and cpu_copy_thread().
Neither of these routines allocate stacks.
Reviewed by: kib
MFC after: 1 week
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D29227
---
sys/amd64/amd64/vm_machdep.c | 6 ++++--
sys/i386/i386/vm_machdep.c | 6 ++++--
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/sys/amd64/amd64/vm_machdep.c b/sys/amd64/amd64/vm_machdep.c
index 6e60f2b3faff..a17ddd4ba6d8 100644
--- a/sys/amd64/amd64/vm_machdep.c
+++ b/sys/amd64/amd64/vm_machdep.c
@@ -198,7 +198,6 @@ cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2, int flags)
bcopy(&p1->p_md, mdp2, sizeof(*mdp2));
/*
- * Create a new fresh stack for the new process.
* Copy the trap frame for the return to user mode as if from a
* syscall. This copies most of the user mode register values.
*/
@@ -606,7 +605,10 @@ cpu_copy_thread(struct thread *td, struct thread *td0)
/*
- * Create a new fresh stack for the new thread.
+ * Copy user general-purpose registers.
+ *
+ * Some of these registers are rewritten by cpu_set_upcall()
+ * and linux_set_upcall_kse().
*/
bcopy(td0->td_frame, td->td_frame, sizeof(struct trapframe));
diff --git a/sys/i386/i386/vm_machdep.c b/sys/i386/i386/vm_machdep.c
index 471128e1713d..5947ae5a6d15 100644
--- a/sys/i386/i386/vm_machdep.c
+++ b/sys/i386/i386/vm_machdep.c
@@ -205,7 +205,6 @@ cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2, int flags)
bcopy(&p1->p_md, mdp2, sizeof(*mdp2));
/*
- * Create a new fresh stack for the new process.
* Copy the trap frame for the return to user mode as if from a
* syscall. This copies most of the user mode register values.
* The -VM86_STACK_SPACE (-16) is so we can expand the trapframe
@@ -473,7 +472,10 @@ cpu_copy_thread(struct thread *td, struct thread *td0)
}
/*
- * Create a new fresh stack for the new thread.
+ * Copy user general-purpose registers.
+ *
+ * Some of these registers are rewritten by cpu_set_upcall()
+ * and linux_set_upcall_kse().
*/
bcopy(td0->td_frame, td->td_frame, sizeof(struct trapframe));
More information about the dev-commits-src-main
mailing list