Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch Remove unused and broken code. On amd64 we won't wa...



details:   https://anonhg.NetBSD.org/src/rev/06b31c7746cb
branches:  trunk
changeset: 826166:06b31c7746cb
user:      maxv <maxv%NetBSD.org@localhost>
date:      Fri Aug 18 10:02:37 2017 +0000

description:
Remove unused and broken code. On amd64 we won't want int3 from kernel
mode to be valid.

diffstat:

 sys/arch/amd64/amd64/amd64_trap.S |  44 +-------------------------------------
 sys/arch/i386/i386/i386_trap.S    |  43 +------------------------------------
 sys/arch/i386/i386/vector.S       |  21 +----------------
 3 files changed, 6 insertions(+), 102 deletions(-)

diffs (175 lines):

diff -r 5acee7d97337 -r 06b31c7746cb sys/arch/amd64/amd64/amd64_trap.S
--- a/sys/arch/amd64/amd64/amd64_trap.S Fri Aug 18 09:49:24 2017 +0000
+++ b/sys/arch/amd64/amd64/amd64_trap.S Fri Aug 18 10:02:37 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: amd64_trap.S,v 1.5 2017/03/24 18:03:32 maxv Exp $      */
+/*     $NetBSD: amd64_trap.S,v 1.6 2017/08/18 10:02:37 maxv Exp $      */
 
 /*-
  * Copyright (c) 1998, 2007, 2008 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
 
 #if 0
 #include <machine/asm.h>
-__KERNEL_RCSID(0, "$NetBSD: amd64_trap.S,v 1.5 2017/03/24 18:03:32 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amd64_trap.S,v 1.6 2017/08/18 10:02:37 maxv Exp $");
 #endif
 
 /*
@@ -154,47 +154,7 @@
 IDTVEC_END(trap02)
 
 IDTVEC(trap03)
-#ifndef KDTRACE_HOOKS
        ZTRAP(T_BPTFLT)
-#else
-       ZTRAP_NJ(T_BPTFLT)
-       INTRENTRY
-       STI(si)
-       /*
-        * DTrace Function Boundary Trace (fbt) probes are triggered
-        * by int3 (0xcc).
-        */
-       /* Check if there is no DTrace hook registered. */
-       cmpq    $0,dtrace_invop_jump_addr
-       je      calltrap
-
-       /*
-        * Set our jump address for the jump back in the event that
-        * the exception wasn't caused by DTrace at all.
-        */
-       /* XXX: This doesn't look right for SMP - unless it is a
-        * constant - so why set it everytime. (dsl) */
-       movq    $calltrap, dtrace_invop_calltrap_addr(%rip)
-
-       /* Jump to the code hooked in by DTrace. */
-       movq    dtrace_invop_jump_addr, %rax
-       jmpq    *dtrace_invop_jump_addr
-
-       .bss
-       .globl  dtrace_invop_jump_addr
-       .align  8
-       .type   dtrace_invop_jump_addr, @object
-       .size   dtrace_invop_jump_addr, 8
-dtrace_invop_jump_addr:
-       .zero   8
-       .globl  dtrace_invop_calltrap_addr
-       .align  8
-       .type   dtrace_invop_calltrap_addr, @object
-       .size   dtrace_invop_calltrap_addr, 8
-dtrace_invop_calltrap_addr:
-       .zero   8
-       .text
-#endif
 IDTVEC_END(trap03)
 
 IDTVEC(trap04)
diff -r 5acee7d97337 -r 06b31c7746cb sys/arch/i386/i386/i386_trap.S
--- a/sys/arch/i386/i386/i386_trap.S    Fri Aug 18 09:49:24 2017 +0000
+++ b/sys/arch/i386/i386/i386_trap.S    Fri Aug 18 10:02:37 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i386_trap.S,v 1.9 2017/08/12 07:07:53 maxv Exp $       */
+/*     $NetBSD: i386_trap.S,v 1.10 2017/08/18 10:02:37 maxv Exp $      */
 
 /*
  * Copyright 2002 (c) Wasabi Systems, Inc.
@@ -66,7 +66,7 @@
 
 #if 0
 #include <machine/asm.h>
-__KERNEL_RCSID(0, "$NetBSD: i386_trap.S,v 1.9 2017/08/12 07:07:53 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i386_trap.S,v 1.10 2017/08/18 10:02:37 maxv Exp $");
 #endif
 
 /*
@@ -132,48 +132,9 @@
        ZTRAP(T_BOUND)
 IDTVEC_END(trap05)
 
-/*
- * Privileged instruction fault.
- */
-#ifdef KDTRACE_HOOKS
-       SUPERALIGN_TEXT
-IDTVEC(trap06)
-       /* Check if there is no DTrace hook registered. */
-       cmpl    $0,dtrace_invop_jump_addr
-       je      norm_ill
-
-       /* Check if this is a user fault. */
-       /* XXX this was 0x0020 in FreeBSD */
-       cmpl    $GSEL(GCODE_SEL, SEL_KPL),4(%esp) /* Check code segment. */
-
-       /* If so, just handle it as a normal trap. */
-       jne     norm_ill
-
-       /*
-        * This is a kernel instruction fault that might have been caused
-        * by a DTrace provider.
-        */
-
-       /*
-        * Set our jump address for the jump back in the event that
-        * the exception wasn't caused by DTrace at all.
-        */
-       movl    $norm_ill,dtrace_invop_calltrap_addr
-
-       /* Jump to the code hooked in by DTrace. */
-       jmpl    *dtrace_invop_jump_addr
-
-       /*
-        * Process the instruction fault in the normal way.
-        */
-norm_ill:
-       ZTRAP(T_PRIVINFLT)
-IDTVEC_END(trap06)
-#else
 IDTVEC(trap06)
        ZTRAP(T_PRIVINFLT)
 IDTVEC_END(trap06)
-#endif
 
 IDTVEC(trap07)
        pushl   $0                      /* dummy error code */
diff -r 5acee7d97337 -r 06b31c7746cb sys/arch/i386/i386/vector.S
--- a/sys/arch/i386/i386/vector.S       Fri Aug 18 09:49:24 2017 +0000
+++ b/sys/arch/i386/i386/vector.S       Fri Aug 18 10:02:37 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vector.S,v 1.71 2017/08/12 07:21:57 maxv Exp $ */
+/*     $NetBSD: vector.S,v 1.72 2017/08/18 10:02:37 maxv Exp $ */
 
 /*
  * Copyright 2002 (c) Wasabi Systems, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include <machine/asm.h>
-__KERNEL_RCSID(0, "$NetBSD: vector.S,v 1.71 2017/08/12 07:21:57 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vector.S,v 1.72 2017/08/18 10:02:37 maxv Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -125,23 +125,6 @@
        shl     $24,%eax                                ;\
        orl     %edx,%eax
 
-#ifdef KDTRACE_HOOKS
-       .bss
-       .globl  dtrace_invop_jump_addr
-       .align  4
-       .type   dtrace_invop_jump_addr, @object
-       .size   dtrace_invop_jump_addr, 4
-dtrace_invop_jump_addr:
-       .zero   4
-       .globl  dtrace_invop_calltrap_addr
-       .align  4
-       .type   dtrace_invop_calltrap_addr, @object
-       .size   dtrace_invop_calltrap_addr, 4
-dtrace_invop_calltrap_addr:
-       .zero   8
-       .text
-#endif
-
 #ifndef XEN
 #if NLAPIC > 0
 #ifdef MULTIPROCESSOR



Home | Main Index | Thread Index | Old Index