summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2010-12-07 12:44:33 +0000
committerkib <kib@FreeBSD.org>2010-12-07 12:44:33 +0000
commit2c234bfed65d90a8d6c58495d0819be4eaf52fc5 (patch)
treea5e3d91159981f435b6948417220c5a80a35dd85 /sys
parent8e959769425068c451d277df30a2fa8546698671 (diff)
downloadFreeBSD-src-2c234bfed65d90a8d6c58495d0819be4eaf52fc5.zip
FreeBSD-src-2c234bfed65d90a8d6c58495d0819be4eaf52fc5.tar.gz
Update some comments related to use of amd64 full context switch.
In exec_linux_setregs(), use locally cached pointer to pcb to set pcb_full_iret. In set_regs(), note that full return is needed when code that sets segment registers is enabled. MFC after: 1 week
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/amd64/machdep.c1
-rw-r--r--sys/amd64/amd64/vm_machdep.c5
-rw-r--r--sys/amd64/linux32/linux32_sysvec.c4
3 files changed, 5 insertions, 5 deletions
diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c
index d09ae4a..fe4deb7 100644
--- a/sys/amd64/amd64/machdep.c
+++ b/sys/amd64/amd64/machdep.c
@@ -1906,6 +1906,7 @@ set_regs(struct thread *td, struct reg *regs)
tp->tf_fs = regs->r_fs;
tp->tf_gs = regs->r_gs;
tp->tf_flags = TF_HASSEGS;
+ td->td_pcb->pcb_full_iret = 1;
}
return (0);
}
diff --git a/sys/amd64/amd64/vm_machdep.c b/sys/amd64/amd64/vm_machdep.c
index 2a93bc1..b966393 100644
--- a/sys/amd64/amd64/vm_machdep.c
+++ b/sys/amd64/amd64/vm_machdep.c
@@ -339,10 +339,9 @@ cpu_set_syscall_retval(struct thread *td, int error)
* Reconstruct pc, we know that 'syscall' is 2 bytes,
* lcall $X,y is 7 bytes, int 0x80 is 2 bytes.
* We saved this in tf_err.
- * We have to do a full context restore so that %r10
- * (which was holding the value of %rcx) is restored
+ * %r10 (which was holding the value of %rcx) is restored
* for the next iteration.
- * r10 restore is only required for freebsd/amd64 processes,
+ * %r10 restore is only required for freebsd/amd64 processes,
* but shall be innocent for any ia32 ABI.
*/
td->td_frame->tf_rip -= td->td_frame->tf_err;
diff --git a/sys/amd64/linux32/linux32_sysvec.c b/sys/amd64/linux32/linux32_sysvec.c
index 0dbcef4..3ebb980 100644
--- a/sys/amd64/linux32/linux32_sysvec.c
+++ b/sys/amd64/linux32/linux32_sysvec.c
@@ -865,13 +865,13 @@ exec_linux_setregs(struct thread *td, struct image_params *imgp, u_long stack)
regs->tf_flags = TF_HASSEGS;
regs->tf_cs = _ucode32sel;
regs->tf_rbx = imgp->ps_strings;
- td->td_pcb->pcb_full_iret = 1;
load_cr0(rcr0() | CR0_MP | CR0_TS);
fpstate_drop(td);
- /* Return via doreti so that we can change to a different %cs */
+ /* Do full restore on return so that we can change to a different %cs */
pcb->pcb_flags |= PCB_32BIT;
pcb->pcb_flags &= ~PCB_GS32BIT;
+ pcb->pcb_full_iret = 1;
td->td_retval[1] = 0;
}
OpenPOWER on IntegriCloud