From owner-p4-projects@FreeBSD.ORG Tue Apr 8 01:56:57 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9EB8937B404; Tue, 8 Apr 2003 01:56:56 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 26F8437B401 for ; Tue, 8 Apr 2003 01:56:56 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id B9F6F43F85 for ; Tue, 8 Apr 2003 01:56:55 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h388ut0U012170 for ; Tue, 8 Apr 2003 01:56:55 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h388uthJ012167 for perforce@freebsd.org; Tue, 8 Apr 2003 01:56:55 -0700 (PDT) Date: Tue, 8 Apr 2003 01:56:55 -0700 (PDT) Message-Id: <200304080856.h388uthJ012167@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 28509 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2003 08:56:57 -0000 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;