Date: Tue, 7 Dec 2010 12:17:44 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r216253 - in head/sys/amd64: amd64 ia32 include linux32 Message-ID: <201012071217.oB7CHiA4065312@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Tue Dec 7 12:17:43 2010 New Revision: 216253 URL: http://svn.freebsd.org/changeset/base/216253 Log: Retire write-only PCB_FULLCTX pcb flag on amd64. Reminded by: Petr Salinger <Petr.Salinger seznam cz> Tested by: pho MFC after: 1 week Modified: head/sys/amd64/amd64/exception.S head/sys/amd64/amd64/genassym.c head/sys/amd64/amd64/machdep.c head/sys/amd64/amd64/vm_machdep.c head/sys/amd64/ia32/ia32_signal.c head/sys/amd64/include/pcb.h head/sys/amd64/linux32/linux32_sysvec.c Modified: head/sys/amd64/amd64/exception.S ============================================================================== --- head/sys/amd64/amd64/exception.S Tue Dec 7 12:04:06 2010 (r216252) +++ head/sys/amd64/amd64/exception.S Tue Dec 7 12:17:43 2010 (r216253) @@ -380,7 +380,6 @@ IDTVEC(fast_syscall) movq %rsp,%rdi call syscall movq PCPU(CURPCB),%rax - andq $~PCB_FULLCTX,PCB_FLAGS(%rax) MEXITCOUNT jmp doreti Modified: head/sys/amd64/amd64/genassym.c ============================================================================== --- head/sys/amd64/amd64/genassym.c Tue Dec 7 12:04:06 2010 (r216252) +++ head/sys/amd64/amd64/genassym.c Tue Dec 7 12:17:43 2010 (r216253) @@ -161,7 +161,6 @@ ASSYM(PCB_SIZE, sizeof(struct pcb)); ASSYM(PCB_DBREGS, PCB_DBREGS); ASSYM(PCB_32BIT, PCB_32BIT); ASSYM(PCB_GS32BIT, PCB_GS32BIT); -ASSYM(PCB_FULLCTX, PCB_FULLCTX); ASSYM(COMMON_TSS_RSP0, offsetof(struct amd64tss, tss_rsp0)); Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Tue Dec 7 12:04:06 2010 (r216252) +++ head/sys/amd64/amd64/machdep.c Tue Dec 7 12:17:43 2010 (r216253) @@ -492,7 +492,6 @@ sigreturn(td, uap) #endif kern_sigprocmask(td, SIG_SETMASK, &ucp->uc_sigmask, NULL, 0); - td->td_pcb->pcb_flags |= PCB_FULLCTX; td->td_pcb->pcb_full_iret = 1; return (EJUSTRETURN); } @@ -1908,7 +1907,6 @@ set_regs(struct thread *td, struct reg * tp->tf_gs = regs->r_gs; tp->tf_flags = TF_HASSEGS; } - td->td_pcb->pcb_flags |= PCB_FULLCTX; return (0); } @@ -2095,7 +2093,6 @@ set_mcontext(struct thread *td, const mc td->td_pcb->pcb_fsbase = mcp->mc_fsbase; td->td_pcb->pcb_gsbase = mcp->mc_gsbase; } - td->td_pcb->pcb_flags |= PCB_FULLCTX; td->td_pcb->pcb_full_iret = 1; return (0); } Modified: head/sys/amd64/amd64/vm_machdep.c ============================================================================== --- head/sys/amd64/amd64/vm_machdep.c Tue Dec 7 12:04:06 2010 (r216252) +++ head/sys/amd64/amd64/vm_machdep.c Tue Dec 7 12:17:43 2010 (r216253) @@ -347,7 +347,6 @@ cpu_set_syscall_retval(struct thread *td */ td->td_frame->tf_rip -= td->td_frame->tf_err; td->td_frame->tf_r10 = td->td_frame->tf_rcx; - td->td_pcb->pcb_flags |= PCB_FULLCTX; break; case EJUSTRETURN: Modified: head/sys/amd64/ia32/ia32_signal.c ============================================================================== --- head/sys/amd64/ia32/ia32_signal.c Tue Dec 7 12:04:06 2010 (r216252) +++ head/sys/amd64/ia32/ia32_signal.c Tue Dec 7 12:17:43 2010 (r216253) @@ -207,7 +207,6 @@ ia32_set_mcontext(struct thread *td, con tp->tf_rflags = rflags; tp->tf_rsp = mcp->mc_esp; tp->tf_ss = mcp->mc_ss; - td->td_pcb->pcb_flags |= PCB_FULLCTX; td->td_pcb->pcb_full_iret = 1; return (0); } @@ -743,7 +742,7 @@ ia32_setregs(struct thread *td, struct i fpstate_drop(td); /* Return via doreti so that we can change to a different %cs */ - pcb->pcb_flags |= PCB_FULLCTX | PCB_32BIT; + pcb->pcb_flags |= PCB_32BIT; pcb->pcb_flags &= ~PCB_GS32BIT; td->td_pcb->pcb_full_iret = 1; td->td_retval[1] = 0; Modified: head/sys/amd64/include/pcb.h ============================================================================== --- head/sys/amd64/include/pcb.h Tue Dec 7 12:04:06 2010 (r216252) +++ head/sys/amd64/include/pcb.h Tue Dec 7 12:17:43 2010 (r216253) @@ -73,7 +73,6 @@ struct pcb { #define PCB_USERFPUINITDONE 0x10 /* fpu user state is initialized */ #define PCB_GS32BIT 0x20 /* linux gs switch */ #define PCB_32BIT 0x40 /* process has 32 bit context (segs etc) */ -#define PCB_FULLCTX 0x80 /* full context restore on sysret */ uint16_t pcb_initial_fpucw; Modified: head/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysvec.c Tue Dec 7 12:04:06 2010 (r216252) +++ head/sys/amd64/linux32/linux32_sysvec.c Tue Dec 7 12:17:43 2010 (r216253) @@ -870,7 +870,7 @@ exec_linux_setregs(struct thread *td, st fpstate_drop(td); /* Return via doreti so that we can change to a different %cs */ - pcb->pcb_flags |= PCB_FULLCTX | PCB_32BIT; + pcb->pcb_flags |= PCB_32BIT; pcb->pcb_flags &= ~PCB_GS32BIT; td->td_retval[1] = 0; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201012071217.oB7CHiA4065312>