Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F165168746
D32057.id95508.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D32057.id95508.diff
View Options
Index: sys/amd64/amd64/vm_machdep.c
===================================================================
--- sys/amd64/amd64/vm_machdep.c
+++ sys/amd64/amd64/vm_machdep.c
@@ -193,6 +193,14 @@
td2->td_md.md_spinlock_count = 1;
td2->td_md.md_saved_flags = PSL_KERNEL | PSL_I;
pmap_thread_init_invl_gen(td2);
+
+ /*
+ * Copy the trap frame for the return to user mode as if from a syscall.
+ * This copies most of the user mode register values. Some of these
+ * registers are rewritten by cpu_set_upcall() and linux_set_upcall().
+ */
+ if ((td1->td_proc->p_flag & P_KPROC) == 0)
+ bcopy(td1->td_frame, td2->td_frame, sizeof(struct trapframe));
}
/*
@@ -236,13 +244,6 @@
mdp2 = &p2->p_md;
bcopy(&p1->p_md, mdp2, sizeof(*mdp2));
- /*
- * Copy the trap frame for the return to user mode as if from a
- * syscall. This copies most of the user mode register values.
- */
- td2->td_frame = (struct trapframe *)td2->td_md.md_stack_base - 1;
- bcopy(td1->td_frame, td2->td_frame, sizeof(struct trapframe));
-
/* Set child return values. */
p2->p_sysent->sv_set_fork_retval(td2);
@@ -603,14 +604,7 @@
copy_thread(td0, td);
/*
- * Copy user general-purpose registers.
- *
- * Some of these registers are rewritten by cpu_set_upcall()
- * and linux_set_upcall().
- */
- bcopy(td0->td_frame, td->td_frame, sizeof(struct trapframe));
-
- /* If the current thread has the trap bit set (i.e. a debugger had
+ * If the current thread has the trap bit set (i.e. a debugger had
* single stepped the process to the system call), we need to clear
* the trap flag from the new frame. Otherwise, the new thread will
* receive a (likely unexpected) SIGTRAP when it executes the first
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Aug 7, 1:04 PM (2 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
36174325
Default Alt Text
D32057.id95508.diff (1 KB)
Attached To
Mode
D32057: amd64: Avoid copying td_frame from kernel procs
Attached
Detach File
Event Timeline
Log In to Comment