Print this page
9210 remove KMDB branch debugging support
9211 ::crregs could do with cr2/cr3 support
9209 ::ttrace should be able to filter by thread
Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>

@@ -19,14 +19,14 @@
  * CDDL HEADER END
  */
 /*
  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
+ *
+ * Copyright 2018 Joyent, Inc.
  */
 
-#pragma ident   "%Z%%M% %I%     %E% SMI"
-
 /*
  * Companion to kdi_idt.c - the implementation of the trap and interrupt
  * handlers.  For the most part, these handlers do the same thing - they
  * push a trap number onto the stack, followed by a jump to kdi_cmnint.
  * Each trap and interrupt has its own handler because each one pushes a

@@ -45,30 +45,10 @@
  */
 #undef  ASM_ENTRY_ALIGN
 #define ASM_ENTRY_ALIGN 8
 
 /*
- * We need the .align in ENTRY_NP (defined to be ASM_ENTRY_ALIGN) to match our
- * manual .align (KDI_MSR_PATCHOFF) in order to ensure that the space reserved
- * at the beginning of the handler for code is exactly KDI_MSR_PATCHOFF bytes
- * long.  Note that the #error below isn't supported by the preprocessor invoked
- * by as(1), and won't stop the build, but it'll emit a noticeable error message
- * which won't escape the filters.
- */
-#if ASM_ENTRY_ALIGN != KDI_MSR_PATCHOFF
-#error "ASM_ENTRY_ALIGN != KDI_MSR_PATCHOFF"
-this won't assemble
-#endif
-
-/*
- * kdi_idt_patch will, on certain processors, replace the patch points below
- * with MSR-clearing code.  kdi_id_patch has intimate knowledge of the size of
- * the nop hole, as well as the structure of the handlers.  Do not change
- * anything here without also changing kdi_idt_patch.
- */
-
-/*
  * Generic trap and interrupt handlers.
  */
 
 #if defined(__xpv) && defined(__amd64)
 

@@ -100,44 +80,34 @@
 
 
 #define MKIVCT(n) \
         ENTRY_NP(kdi_ivct/**/n/**/);    \
         TRAP_ERR(n);                    \
-        .align  KDI_MSR_PATCHOFF;       \
-        KDI_MSR_PATCH;                  \
         jmp     kdi_cmnint;             \
         SET_SIZE(kdi_ivct/**/n/**/)
 
 #define MKTRAPHDLR(n) \
         ENTRY_NP(kdi_trap/**/n);        \
         TRAP_ERR(n);                    \
-        .align  KDI_MSR_PATCHOFF;       \
-        KDI_MSR_PATCH;                  \
         jmp     kdi_cmnint;             \
         SET_SIZE(kdi_trap/**/n/**/)
 
 #define MKTRAPERRHDLR(n) \
         ENTRY_NP(kdi_traperr/**/n);     \
         TRAP_NOERR(n);                  \
-        .align  KDI_MSR_PATCHOFF;       \
-        KDI_MSR_PATCH;                  \
         jmp     kdi_cmnint;             \
         SET_SIZE(kdi_traperr/**/n)
 
 #define MKNMIHDLR \
         ENTRY_NP(kdi_int2);             \
         TRAP_NOERR(2);                  \
-        .align  KDI_MSR_PATCHOFF;       \
-        KDI_MSR_PATCH;                  \
         jmp     kdi_nmiint;             \
         SET_SIZE(kdi_int2)
 
 #define MKINVALHDLR \
         ENTRY_NP(kdi_invaltrap);        \
         TRAP_NOERR(255);                \
-        .align  KDI_MSR_PATCHOFF;       \
-        KDI_MSR_PATCH;                  \
         jmp     kdi_cmnint;             \
         SET_SIZE(kdi_invaltrap)
 
 /*
  * The handlers themselves