Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 Apr 2003 01:56:55 -0700 (PDT)
From:      Peter Wemm <peter@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 28509 for review
Message-ID:  <200304080856.h388uthJ012167@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=28509

Change 28509 by peter@peter_daintree on 2003/04/08 01:56:28

	dont save/restore truncated segment registers

Affected files ...

.. //depot/projects/hammer/sys/x86_64/x86_64/exception.s#16 edit
.. //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#49 edit

Differences ...

==== //depot/projects/hammer/sys/x86_64/x86_64/exception.s#16 (text+ko) ====

@@ -145,15 +145,7 @@
 	pushq	%r13
 	pushq	%r14
 	pushq	%r15
-	pushq	%ds
-	pushq	%es
-	pushq	%fs
 alltraps_with_regs_pushed:
-	mov	$KDSEL,%ax
-	mov	%ax,%ds
-	mov	%ax,%es
-#XXX	mov	$KPSEL,%ax
-	mov	%ax,%fs
 	FAKE_MCOUNT(13*4(%rsp))
 calltrap:
 	FAKE_MCOUNT(btrap)		/* init "from" btrap -> calltrap */
@@ -198,14 +190,6 @@
 	pushq	%r13
 	pushq	%r14
 	pushq	%r15
-	pushq	%ds
-	pushq	%es
-	pushq	%fs
-	mov	$KDSEL,%ax		/* switch to kernel segments */
-	mov	%ax,%ds
-	mov	%ax,%es
-#XXX	mov	$KPSEL,%ax
-	mov	%ax,%fs
 	FAKE_MCOUNT(13*4(%rsp))
 	call	syscall
 	MEXITCOUNT
@@ -280,16 +264,6 @@
 doreti_exit:
 	MEXITCOUNT
 
-	.globl	doreti_popl_fs
-doreti_popl_fs:
-#	popq	%fs
-	addq	$8, %rsp
-	.globl	doreti_popl_es
-doreti_popl_es:
-	popq	%es
-	.globl	doreti_popl_ds
-doreti_popl_ds:
-	popq	%ds
 	popq	%r15
 	popq	%r14
 	popq	%r13
@@ -336,15 +310,6 @@
 	pushq	%r13
 	pushq	%r14
 	pushq	%r15
-	pushq	%ds
-	.globl	doreti_popl_ds_fault
-doreti_popl_ds_fault:
-	pushq	%es
-	.globl	doreti_popl_es_fault
-doreti_popl_es_fault:
-	pushq	%fs
-	.globl	doreti_popl_fs_fault
-doreti_popl_fs_fault:
 	movq	$0,TF_ERR(%rsp)	/* XXX should be the error code */
 	movq	$T_PROTFLT,TF_TRAPNO(%rsp)
 	jmp	alltraps_with_regs_pushed

==== //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#49 (text+ko) ====

@@ -309,10 +309,6 @@
 	regs->tf_rip = PS_STRINGS - *(p->p_sysent->sv_szsigcode);
 	regs->tf_rflags &= ~PSL_T;
 	regs->tf_cs = _ucodesel;
-	regs->tf_ds = _udatasel;
-	regs->tf_es = _udatasel;
-	regs->tf_fs = _udatasel;
-	regs->tf_ss = _udatasel;
 	PROC_LOCK(p);
 }
 
@@ -484,10 +480,6 @@
 	regs->tf_rsp = stack;
 	regs->tf_rflags = PSL_USER | (regs->tf_rflags & PSL_T);
 	regs->tf_ss = _udatasel;
-	regs->tf_ds = _udatasel;
-	regs->tf_es = _udatasel;
-	regs->tf_fs = _udatasel;
-	regs->tf_cs = _ucodesel;
 
 	/*
 	 * Arrange to trap the next npx or `fwait' instruction (see npx.c
@@ -1355,9 +1347,6 @@
 	struct trapframe *tp;
 
 	tp = td->td_frame;
-	regs->r_fs = tp->tf_fs;
-	regs->r_es = tp->tf_es;
-	regs->r_ds = tp->tf_ds;
 	regs->r_rdi = tp->tf_rdi;
 	regs->r_rsi = tp->tf_rsi;
 	regs->r_rbp = tp->tf_rbp;
@@ -1385,9 +1374,6 @@
 	if (!EFL_SECURE(regs->r_rflags, tp->tf_rflags) ||
 	    !CS_SECURE(regs->r_cs))
 		return (EINVAL);
-	tp->tf_fs = regs->r_fs;
-	tp->tf_es = regs->r_es;
-	tp->tf_ds = regs->r_ds;
 	tp->tf_rdi = regs->r_rdi;
 	tp->tf_rsi = regs->r_rsi;
 	tp->tf_rbp = regs->r_rbp;
@@ -1487,9 +1473,6 @@
 
 	mcp->mc_onstack = sigonstack(tp->tf_rsp);
 	mcp->mc_gs = td->td_pcb->pcb_gs;
-	mcp->mc_fs = tp->tf_fs;
-	mcp->mc_es = tp->tf_es;
-	mcp->mc_ds = tp->tf_ds;
 	mcp->mc_rdi = tp->tf_rdi;
 	mcp->mc_rsi = tp->tf_rsi;
 	mcp->mc_rbp = tp->tf_rbp;
@@ -1526,9 +1509,6 @@
 	rflags = (mcp->mc_rflags & PSL_USERCHANGE) |
 	    (tp->tf_rflags & ~PSL_USERCHANGE);
 	if ((ret = set_fpcontext(td, mcp)) == 0) {
-		tp->tf_fs = mcp->mc_fs;
-		tp->tf_es = mcp->mc_es;
-		tp->tf_ds = mcp->mc_ds;
 		tp->tf_rdi = mcp->mc_rdi;
 		tp->tf_rsi = mcp->mc_rsi;
 		tp->tf_rbp = mcp->mc_rbp;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200304080856.h388uthJ012167>