From owner-p4-projects@FreeBSD.ORG Wed Apr 9 21:33:52 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D21F237B404; Wed, 9 Apr 2003 21:33:51 -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 6D31337B401 for ; Wed, 9 Apr 2003 21:33:51 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 157CE43FA3 for ; Wed, 9 Apr 2003 21:33:51 -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 h3A4Xo0U005143 for ; Wed, 9 Apr 2003 21:33:50 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3A4XoXr005140 for perforce@freebsd.org; Wed, 9 Apr 2003 21:33:50 -0700 (PDT) Date: Wed, 9 Apr 2003 21:33:50 -0700 (PDT) Message-Id: <200304100433.h3A4XoXr005140@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 28689 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: Thu, 10 Apr 2003 04:33:53 -0000 http://perforce.freebsd.org/chv.cgi?CH=28689 Change 28689 by peter@peter_daintree on 2003/04/09 21:33:18 do not mess with %gs. Use the right symbols for the user code/data segs. set %cs. Entering userland with a null descriptor isn't a good idea. Affected files ... .. //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#62 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#62 (text+ko) ==== @@ -463,17 +463,20 @@ u_long ps_strings; { struct trapframe *regs = td->td_frame; +#if 0 struct pcb *pcb = td->td_pcb; /* Reset pc->pcb_gs and %gs before possibly invalidating it. */ pcb->pcb_gs = _udatasel; load_gs(_udatasel); +#endif bzero((char *)regs, sizeof(struct trapframe)); regs->tf_rip = entry; regs->tf_rsp = stack; regs->tf_rflags = PSL_USER | (regs->tf_rflags & PSL_T); regs->tf_ss = _udatasel; + regs->tf_cs = _ucodesel; /* * Arrange to trap the next npx or `fwait' instruction (see npx.c @@ -511,7 +514,9 @@ cr0 |= CR0_MP | CR0_TS; /* Done at every execve() too. */ cr0 |= CR0_WP | CR0_AM; load_cr0(cr0); +#if 0 load_gs(_udatasel); +#endif } static int @@ -1264,8 +1269,8 @@ /* transfer to user mode */ - _ucodesel = GSEL(LUCODE_SEL, SEL_UPL); - _udatasel = GSEL(LUDATA_SEL, SEL_UPL); + _ucodesel = GSEL(GUCODE_SEL, SEL_UPL); + _udatasel = GSEL(GUDATA_SEL, SEL_UPL); /* setup proc 0's pcb */ thread0.td_pcb->pcb_flags = 0; /* XXXKSE */