From owner-svn-src-stable@FreeBSD.ORG Sat Aug 9 14:05:03 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8C6631B2 for ; Sat, 9 Aug 2014 14:05:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C39A2E1E for ; Sat, 9 Aug 2014 14:05:03 +0000 (UTC) Received: from markj (uid 1309) (envelope-from markj@FreeBSD.org) id 2c16 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Sat, 09 Aug 2014 14:05:02 +0000 From: Mark Johnston Date: Sat, 9 Aug 2014 14:05:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r269752 - in stable/10/sys: amd64/amd64 i386/i386 kern mips/mips powerpc/aim sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e62a8e.2c16.1009619f@svn.freebsd.org> X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Aug 2014 14:05:03 -0000 Author: markj Date: Sat Aug 9 14:05:01 2014 New Revision: 269752 URL: http://svnweb.freebsd.org/changeset/base/269752 Log: MFC r266826, r266827 Move some duplicated hook definitions from machine-dependent files to kern_dtrace.c. Modified: stable/10/sys/amd64/amd64/trap.c stable/10/sys/i386/i386/trap.c stable/10/sys/kern/kern_dtrace.c stable/10/sys/mips/mips/trap.c stable/10/sys/powerpc/aim/trap.c stable/10/sys/sys/dtrace_bsd.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/trap.c ============================================================================== --- stable/10/sys/amd64/amd64/trap.c Sat Aug 9 13:41:11 2014 (r269751) +++ stable/10/sys/amd64/amd64/trap.c Sat Aug 9 14:05:01 2014 (r269752) @@ -96,28 +96,6 @@ PMC_SOFT_DEFINE( , , page_fault, write); #ifdef KDTRACE_HOOKS #include - -/* - * This is a hook which is initialised by the dtrace module - * to handle traps which might occur during DTrace probe - * execution. - */ -dtrace_trap_func_t dtrace_trap_func; - -dtrace_doubletrap_func_t dtrace_doubletrap_func; - -/* - * This is a hook which is initialised by the systrace module - * when it is loaded. This keeps the DTrace syscall provider - * implementation opaque. - */ -systrace_probe_func_t systrace_probe_func; - -/* - * These hooks are necessary for the pid and usdt providers. - */ -dtrace_pid_probe_ptr_t dtrace_pid_probe_ptr; -dtrace_return_probe_ptr_t dtrace_return_probe_ptr; #endif extern void trap(struct trapframe *frame); Modified: stable/10/sys/i386/i386/trap.c ============================================================================== --- stable/10/sys/i386/i386/trap.c Sat Aug 9 13:41:11 2014 (r269751) +++ stable/10/sys/i386/i386/trap.c Sat Aug 9 14:05:01 2014 (r269752) @@ -105,28 +105,6 @@ PMC_SOFT_DEFINE( , , page_fault, write); #ifdef KDTRACE_HOOKS #include - -/* - * This is a hook which is initialised by the dtrace module - * to handle traps which might occur during DTrace probe - * execution. - */ -dtrace_trap_func_t dtrace_trap_func; - -dtrace_doubletrap_func_t dtrace_doubletrap_func; - -/* - * This is a hook which is initialised by the systrace module - * when it is loaded. This keeps the DTrace syscall provider - * implementation opaque. - */ -systrace_probe_func_t systrace_probe_func; - -/* - * These hooks are necessary for the pid and usdt providers. - */ -dtrace_pid_probe_ptr_t dtrace_pid_probe_ptr; -dtrace_return_probe_ptr_t dtrace_return_probe_ptr; #endif extern void trap(struct trapframe *frame); Modified: stable/10/sys/kern/kern_dtrace.c ============================================================================== --- stable/10/sys/kern/kern_dtrace.c Sat Aug 9 13:41:11 2014 (r269751) +++ stable/10/sys/kern/kern_dtrace.c Sat Aug 9 14:05:01 2014 (r269752) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #define KDTRACE_PROC_SIZE 64 #define KDTRACE_THREAD_SIZE 256 @@ -47,6 +48,14 @@ FEATURE(kdtrace_hooks, static MALLOC_DEFINE(M_KDTRACE, "kdtrace", "DTrace hooks"); +/* Hooks used in the machine-dependent trap handlers. */ +dtrace_trap_func_t dtrace_trap_func; +dtrace_doubletrap_func_t dtrace_doubletrap_func; +dtrace_pid_probe_ptr_t dtrace_pid_probe_ptr; +dtrace_return_probe_ptr_t dtrace_return_probe_ptr; + +systrace_probe_func_t systrace_probe_func; + /* Return the DTrace process data size compiled in the kernel hooks. */ size_t kdtrace_proc_size() Modified: stable/10/sys/mips/mips/trap.c ============================================================================== --- stable/10/sys/mips/mips/trap.c Sat Aug 9 13:41:11 2014 (r269751) +++ stable/10/sys/mips/mips/trap.c Sat Aug 9 14:05:01 2014 (r269752) @@ -94,28 +94,6 @@ __FBSDID("$FreeBSD$"); #ifdef KDTRACE_HOOKS #include - -/* - * This is a hook which is initialised by the dtrace module - * to handle traps which might occur during DTrace probe - * execution. - */ -dtrace_trap_func_t dtrace_trap_func; - -dtrace_doubletrap_func_t dtrace_doubletrap_func; - -/* - * This is a hook which is initialised by the systrace module - * when it is loaded. This keeps the DTrace syscall provider - * implementation opaque. - */ -systrace_probe_func_t systrace_probe_func; - -/* - * These hooks are necessary for the pid and usdt providers. - */ -dtrace_pid_probe_ptr_t dtrace_pid_probe_ptr; -dtrace_return_probe_ptr_t dtrace_return_probe_ptr; #endif #ifdef TRAP_DEBUG Modified: stable/10/sys/powerpc/aim/trap.c ============================================================================== --- stable/10/sys/powerpc/aim/trap.c Sat Aug 9 13:41:11 2014 (r269751) +++ stable/10/sys/powerpc/aim/trap.c Sat Aug 9 14:05:01 2014 (r269752) @@ -97,27 +97,6 @@ struct powerpc_exception { #ifdef KDTRACE_HOOKS #include -/* - * This is a hook which is initialised by the dtrace module - * to handle traps which might occur during DTrace probe - * execution. - */ -dtrace_trap_func_t dtrace_trap_func; - -dtrace_doubletrap_func_t dtrace_doubletrap_func; - -/* - * This is a hook which is initialised by the systrace module - * when it is loaded. This keeps the DTrace syscall provider - * implementation opaque. - */ -systrace_probe_func_t systrace_probe_func; - -/* - * These hooks are necessary for the pid and usdt providers. - */ -dtrace_pid_probe_ptr_t dtrace_pid_probe_ptr; -dtrace_return_probe_ptr_t dtrace_return_probe_ptr; int (*dtrace_invop_jump_addr)(struct trapframe *); #endif Modified: stable/10/sys/sys/dtrace_bsd.h ============================================================================== --- stable/10/sys/sys/dtrace_bsd.h Sat Aug 9 13:41:11 2014 (r269751) +++ stable/10/sys/sys/dtrace_bsd.h Sat Aug 9 14:05:01 2014 (r269752) @@ -61,11 +61,13 @@ int dtrace_trap(struct trapframe *, u_in extern dtrace_trap_func_t dtrace_trap_func; -/* Used by the machine dependent trap() code. */ +/* + * A hook which removes active FBT probes before executing the double fault + * handler. We want to ensure that DTrace doesn't trigger another trap, which + * would result in a reset. + */ typedef int (*dtrace_invop_func_t)(uintptr_t, uintptr_t *, uintptr_t); typedef void (*dtrace_doubletrap_func_t)(void); - -/* Global variables in trap.c */ extern dtrace_invop_func_t dtrace_invop_func; extern dtrace_doubletrap_func_t dtrace_doubletrap_func;