From owner-p4-projects@FreeBSD.ORG Tue Aug 8 00:20:57 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D09D616A4E7; Tue, 8 Aug 2006 00:20:56 +0000 (UTC) X-Original-To: perforce@freebsd.org 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 ADC5716A4E2 for ; Tue, 8 Aug 2006 00:20:56 +0000 (UTC) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id CB3E343D4C for ; Tue, 8 Aug 2006 00:20:54 +0000 (GMT) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k780KsU5086461 for ; Tue, 8 Aug 2006 00:20:54 GMT (envelope-from jb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k780Ks4B086455 for perforce@freebsd.org; Tue, 8 Aug 2006 00:20:54 GMT (envelope-from jb@freebsd.org) Date: Tue, 8 Aug 2006 00:20:54 GMT Message-Id: <200608080020.k780Ks4B086455@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jb@freebsd.org using -f From: John Birrell To: Perforce Change Reviews Cc: Subject: PERFORCE change 103413 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Aug 2006 00:20:57 -0000 http://perforce.freebsd.org/chv.cgi?CH=103413 Change 103413 by jb@jb_freebsd2 on 2006/08/08 00:20:09 More KSE merges. "It's everywhere!" Affected files ... .. //depot/projects/dtrace/src/sys/amd64/amd64/machdep.c#6 edit .. //depot/projects/dtrace/src/sys/amd64/amd64/trap.c#6 edit .. //depot/projects/dtrace/src/sys/amd64/amd64/vm_machdep.c#4 edit Differences ... ==== //depot/projects/dtrace/src/sys/amd64/amd64/machdep.c#6 (text+ko) ==== @@ -1137,7 +1137,11 @@ * This may be done better later if it gets more high level * components in it. If so just link td->td_proc here. */ +#ifdef KSE + proc_linkup(&proc0, &ksegrp0, &thread0); +#else proc_linkup(&proc0, &thread0); +#endif preload_metadata = (caddr_t)(uintptr_t)(modulep + KERNBASE); preload_bootstrap_relocate(KERNBASE); ==== //depot/projects/dtrace/src/sys/amd64/amd64/trap.c#6 (text+ko) ==== @@ -299,6 +299,10 @@ case T_PAGEFLT: /* page fault */ addr = frame.tf_addr; +#ifdef KSE + if (td->td_pflags & TDP_SA) + thread_user_enter(td); +#endif i = trap_pfault(&frame, TRUE); if (i == -1) goto userout; @@ -749,6 +753,10 @@ td->td_frame = &frame; if (td->td_ucred != p->p_ucred) cred_update_thread(td); +#ifdef KSE + if (p->p_flag & P_SA) + thread_user_enter(td); +#endif params = (caddr_t)frame.tf_rsp + sizeof(register_t); code = frame.tf_rax; orig_tf_rflags = frame.tf_rflags; ==== //depot/projects/dtrace/src/sys/amd64/amd64/vm_machdep.c#4 (text+ko) ==== @@ -244,7 +244,12 @@ * Initialize machine state (pcb and trap frame) for a new thread about to * upcall. Put enough state in the new thread's PCB to get it to go back * userret(), where we can intercept it again to set the return (upcall) + * ifdef KSE + * Address and stack, along with those from upcals that are from other sources + * such as those generated in thread_userret() itself. + * else * Address and stack, along with those from upcals that are from other sources. + * endif */ void cpu_set_upcall(struct thread *td, struct thread *td0) @@ -301,14 +306,31 @@ } /* + * ifdef KSE + * Set that machine state for performing an upcall that has to + * be done in thread_userret() so that those upcalls generated + * in thread_userret() itself can be done as well. + * else * Modify the machine state created by cpu_set_upcall() to arrange * for the new thread to make a specific call as its first act. + * endif */ void cpu_set_upcall_kse(struct thread *td, void (*entry)(void *), void *arg, stack_t *stack) { +#ifdef KSE + /* + * Do any extra cleaning that needs to be done. + * The thread may have optional components + * that are not present in a fresh thread. + * This may be a recycled thread so make it look + * as though it's newly allocated. + */ + cpu_thread_clean(td); +#endif + /* * Set the trap frame to point at the beginning of the uts * function.