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>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/intel/sys/kdi_regs.h
          +++ new/usr/src/uts/intel/sys/kdi_regs.h
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
       24 + *
       25 + * Copyright 2018 Joyent, Inc.
  24   26   */
  25   27  
  26   28  #ifndef _SYS_KDI_REGS_H
  27   29  #define _SYS_KDI_REGS_H
  28   30  
  29      -#pragma ident   "%Z%%M% %I%     %E% SMI"
  30      -
  31   31  #ifndef _ASM
  32   32  #include <sys/types.h>
  33   33  #include <sys/segments.h>
  34   34  #include <sys/regset.h>
  35   35  #include <sys/privregs.h>
  36   36  #endif
  37   37  
  38   38  #if defined(__amd64)
  39   39  #include <amd64/sys/kdi_regs.h>
  40   40  #elif defined(__i386)
↓ open down ↓ 7 lines elided ↑ open up ↑
  48   48  #define KDI_NCRUMBS     5
  49   49  
  50   50  #define KDI_CPU_STATE_NONE              0
  51   51  #define KDI_CPU_STATE_MASTER            1
  52   52  #define KDI_CPU_STATE_SLAVE             2
  53   53  
  54   54  #define KDIREG_DRCTL_WPALLEN_MASK       0x000000ff
  55   55  #define KDIREG_DRSTAT_RESERVED          0xffff0ff0
  56   56  #define KDIREG_DRCTL_RESERVED           0x00000700
  57   57  
  58      -#define KDI_MSR_READ            0x1     /* read during entry (unlimited) */
  59      -#define KDI_MSR_WRITE           0x2     /* write during exit (unlimited) */
  60      -#define KDI_MSR_WRITEDELAY      0x4     /* write after last branch (<= 1) */
  61      -#define KDI_MSR_CLEARENTRY      0x3     /* clear before 1st branch (<= 1) */
  62      -
  63   58  #ifndef _ASM
  64   59  
  65   60  /*
  66   61   * We maintain a ring buffer of bread crumbs for debugging purposes.  The
  67   62   * current buffer pointer is advanced along the ring with each intercepted
  68   63   * trap (debugger entry, invalid memory access, fault during step, etc).
  69   64   */
  70   65  typedef struct kdi_crumb {
  71   66          greg_t krm_cpu_state;   /* This CPU's state at last entry */
  72   67          greg_t krm_pc;          /* Instruction pointer at trap */
↓ open down ↓ 6 lines elided ↑ open up ↑
  79   74  
  80   75  /*
  81   76   * Storage for %dr0-3, %dr6, and %dr7.
  82   77   */
  83   78  typedef struct kdi_drreg {
  84   79          greg_t                  dr_ctl;
  85   80          greg_t                  dr_stat;
  86   81          greg_t                  dr_addr[KDI_MAXWPIDX + 1];
  87   82  } kdi_drreg_t;
  88   83  
  89      -typedef struct kdi_msr {
  90      -        uint_t          msr_num;
  91      -        uint_t          msr_type;
  92      -        union {
  93      -                uint64_t *_msr_valp;
  94      -                uint64_t _msr_val;
  95      -        } _u;
  96      -} kdi_msr_t;
  97      -
  98      -#define kdi_msr_val     _u._msr_val
  99      -#define kdi_msr_valp    _u._msr_valp
 100      -
 101   84  /*
 102   85   * Data structure used to hold all of the state for a given CPU.
 103   86   */
 104   87  typedef struct kdi_cpusave {
 105   88          greg_t                  *krs_gregs;     /* saved registers */
 106   89  
 107   90          kdi_drreg_t             krs_dr;         /* saved debug registers */
 108   91  
 109   92          user_desc_t             *krs_gdt;       /* GDT address */
 110   93          gate_desc_t             *krs_idt;       /* IDT address */
 111   94  
 112   95          greg_t                  krs_cr0;        /* saved %cr0 */
 113   96  
 114      -        kdi_msr_t               *krs_msr;       /* ptr to MSR save area */
 115      -
 116   97          uint_t                  krs_cpu_state;  /* KDI_CPU_STATE_* mstr/slv */
 117   98          uint_t                  krs_cpu_flushed; /* Have caches been flushed? */
 118   99          uint_t                  krs_cpu_id;     /* this CPU's ID */
 119  100  
 120  101          /* Bread crumb ring buffer */
 121  102          ulong_t                 krs_curcrumbidx; /* Current krs_crumbs idx */
 122  103          kdi_crumb_t             *krs_curcrumb;  /* Pointer to current crumb */
 123  104          kdi_crumb_t             krs_crumbs[KDI_NCRUMBS]; /* Crumbs */
 124  105  } kdi_cpusave_t;
 125  106  
 126  107  #endif /* !_ASM */
 127  108  
 128  109  #ifdef __cplusplus
 129  110  }
 130  111  #endif
 131  112  
 132  113  #endif /* _SYS_KDI_REGS_H */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX