From owner-svn-src-all@FreeBSD.ORG Sat Aug 28 08:03:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B89A41065740; Sat, 28 Aug 2010 08:03:29 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A6F4B8FC0C; Sat, 28 Aug 2010 08:03:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7S83TsA023476; Sat, 28 Aug 2010 08:03:29 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7S83TjJ023468; Sat, 28 Aug 2010 08:03:29 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201008280803.o7S83TjJ023468@svn.freebsd.org> From: Rui Paulo Date: Sat, 28 Aug 2010 08:03:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211924 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2010 08:03:29 -0000 Author: rpaulo Date: Sat Aug 28 08:03:29 2010 New Revision: 211924 URL: http://svn.freebsd.org/changeset/base/211924 Log: Register an interrupt vector for DTrace return probes. There is some code missing in lapic to make sure that we don't overwrite this entry, but this will be done on a sequent commit. Sponsored by: The FreeBSD Foundation Modified: head/sys/amd64/amd64/exception.S head/sys/amd64/amd64/machdep.c head/sys/amd64/include/segments.h head/sys/i386/i386/exception.s head/sys/i386/i386/machdep.c head/sys/i386/include/segments.h Modified: head/sys/amd64/amd64/exception.S ============================================================================== --- head/sys/amd64/amd64/exception.S Sat Aug 28 07:58:10 2010 (r211923) +++ head/sys/amd64/amd64/exception.S Sat Aug 28 08:03:29 2010 (r211924) @@ -108,6 +108,10 @@ IDTVEC(dbg) TRAP_NOEN(T_TRCTRAP) IDTVEC(bpt) TRAP_NOEN(T_BPTFLT) +#ifdef KDTRACE_HOOKS +IDTVEC(dtrace_ret) + TRAP_NOEN(T_DTRACE_RET) +#endif /* Regular traps; The cpu does not supply tf_err for these. */ #define TRAP(a) \ Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Sat Aug 28 07:58:10 2010 (r211923) +++ head/sys/amd64/amd64/machdep.c Sat Aug 28 08:03:29 2010 (r211924) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include "opt_msgbuf.h" #include "opt_perfmon.h" #include "opt_sched.h" +#include "opt_kdtrace.h" #include #include @@ -1089,6 +1090,9 @@ extern inthand_t IDTVEC(tss), IDTVEC(missing), IDTVEC(stk), IDTVEC(prot), IDTVEC(page), IDTVEC(mchk), IDTVEC(rsvd), IDTVEC(fpu), IDTVEC(align), IDTVEC(xmm), IDTVEC(dblfault), +#ifdef KDTRACE_HOOKS + IDTVEC(dtrace_ret), +#endif IDTVEC(fast_syscall), IDTVEC(fast_syscall32); #ifdef DDB @@ -1617,6 +1621,9 @@ hammer_time(u_int64_t modulep, u_int64_t setidt(IDT_AC, &IDTVEC(align), SDT_SYSIGT, SEL_KPL, 0); setidt(IDT_MC, &IDTVEC(mchk), SDT_SYSIGT, SEL_KPL, 0); setidt(IDT_XF, &IDTVEC(xmm), SDT_SYSIGT, SEL_KPL, 0); +#ifdef KDTRACE_HOOKS + setidt(IDT_DTRACE_RET, &IDTVEC(dtrace_ret), SDT_SYSIGT, SEL_UPL, 0); +#endif r_idt.rd_limit = sizeof(idt0) - 1; r_idt.rd_base = (long) idt; Modified: head/sys/amd64/include/segments.h ============================================================================== --- head/sys/amd64/include/segments.h Sat Aug 28 07:58:10 2010 (r211923) +++ head/sys/amd64/include/segments.h Sat Aug 28 08:03:29 2010 (r211924) @@ -214,6 +214,7 @@ struct region_descriptor { #define IDT_XF 19 /* #XF: SIMD Floating-Point Exception */ #define IDT_IO_INTS NRSVIDT /* Base of IDT entries for I/O interrupts. */ #define IDT_SYSCALL 0x80 /* System Call Interrupt Vector */ +#define IDT_DTRACE_RET 0x92 /* DTrace pid provider Interrupt Vector */ /* * Entries in the Global Descriptor Table (GDT) Modified: head/sys/i386/i386/exception.s ============================================================================== --- head/sys/i386/i386/exception.s Sat Aug 28 07:58:10 2010 (r211923) +++ head/sys/i386/i386/exception.s Sat Aug 28 08:03:29 2010 (r211924) @@ -108,6 +108,8 @@ IDTVEC(nmi) pushl $0; TRAP(T_NMI) IDTVEC(bpt) pushl $0; TRAP(T_BPTFLT) +IDTVEC(dtrace_ret) + pushl $0; TRAP(T_DTRACE_RET) IDTVEC(ofl) pushl $0; TRAP(T_OFLOW) IDTVEC(bnd) Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Sat Aug 28 07:58:10 2010 (r211923) +++ head/sys/i386/i386/machdep.c Sat Aug 28 08:03:29 2010 (r211924) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include "opt_npx.h" #include "opt_perfmon.h" #include "opt_xbox.h" +#include "opt_kdtrace.h" #include #include @@ -1876,7 +1877,11 @@ extern inthand_t IDTVEC(bnd), IDTVEC(ill), IDTVEC(dna), IDTVEC(fpusegm), IDTVEC(tss), IDTVEC(missing), IDTVEC(stk), IDTVEC(prot), IDTVEC(page), IDTVEC(mchk), IDTVEC(rsvd), IDTVEC(fpu), IDTVEC(align), - IDTVEC(xmm), IDTVEC(lcall_syscall), IDTVEC(int0x80_syscall); + IDTVEC(xmm), +#ifdef KDTRACE_HOOKS + IDTVEC(dtrace_ret), +#endif + IDTVEC(lcall_syscall), IDTVEC(int0x80_syscall); #ifdef DDB /* @@ -2825,6 +2830,10 @@ init386(first) GSEL(GCODE_SEL, SEL_KPL)); setidt(IDT_SYSCALL, &IDTVEC(int0x80_syscall), SDT_SYS386TGT, SEL_UPL, GSEL(GCODE_SEL, SEL_KPL)); +#ifdef KDTRACE_HOOKS + setidt(IDT_DTRACE_RET, &IDTVEC(dtrace_ret), SDT_SYS386TGT, SEL_UPL, + GSEL(GCODE_SEL, SEL_KPL)); +#endif r_idt.rd_limit = sizeof(idt0) - 1; r_idt.rd_base = (int) idt; Modified: head/sys/i386/include/segments.h ============================================================================== --- head/sys/i386/include/segments.h Sat Aug 28 07:58:10 2010 (r211923) +++ head/sys/i386/include/segments.h Sat Aug 28 08:03:29 2010 (r211924) @@ -207,6 +207,7 @@ struct region_descriptor { #define IDT_XF 19 /* #XF: SIMD Floating-Point Exception */ #define IDT_IO_INTS NRSVIDT /* Base of IDT entries for I/O interrupts. */ #define IDT_SYSCALL 0x80 /* System Call Interrupt Vector */ +#define IDT_DTRACE_RET 0x92 /* DTrace pid provider Interrupt Vector */ /* * Entries in the Global Descriptor Table (GDT)