Print this page
    
9441 kmdb should stash %cr3 in kdiregs
Reviewed by: John Levon <john.levon@joyent.com>
8956 Implement KPTI
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>
    
      
        | Split | Close | 
      | Expand all | 
      | Collapse all | 
    
    
          --- old/usr/src/uts/i86pc/ml/offsets.in
          +++ new/usr/src/uts/i86pc/ml/offsets.in
   1    1  \
   2    2  \ Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
   3    3  \ Copyright 2012 Garrett D'Amore <garrett@damore.org>.  All rights reserved.
   4      -\ Copyright 2016 Joyent, Inc.
        4 +\ Copyright 2018 Joyent, Inc.
   5    5  \
   6    6  \ CDDL HEADER START
   7    7  \
   8    8  \ The contents of this file are subject to the terms of the
   9    9  \ Common Development and Distribution License (the "License").
  10   10  \ You may not use this file except in compliance with the License.
  11   11  \
  12   12  \ You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  13   13  \ or http://www.opensolaris.org/os/licensing.
  14   14  \ See the License for the specific language governing permissions
  15   15  \ and limitations under the License.
  16   16  \
  17   17  \ When distributing Covered Code, include this CDDL HEADER in each
  18   18  \ file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  19   19  \ If applicable, add the following below this CDDL HEADER, with the
  20   20  \ fields enclosed by brackets "[]" replaced with your own identifying
  21   21  \ information: Portions Copyright [yyyy] [name of copyright owner]
  22   22  \
  23   23  \ CDDL HEADER END
  24   24  \
  25   25  
  26   26  
  27   27  \
  28   28  \ offsets.in: input file to produce assym.h using the ctfstabs program
  29   29  \
  30   30  
  31   31  #ifndef _GENASSYM
  32   32  #define _GENASSYM
  33   33  #endif
  34   34  
  35   35  #define SIZES   1
  36   36  
  37   37  #include <sys/types.h>
  38   38  #include <sys/bootsvcs.h>
  39   39  #include <sys/systm.h>
  40   40  #include <sys/sysinfo.h>
  41   41  #include <sys/user.h>
  42   42  #include <sys/thread.h>
  43   43  #include <sys/proc.h>
  44   44  #include <sys/cpuvar.h>
  45   45  #include <sys/tss.h>
  46   46  #include <sys/privregs.h>
  47   47  #include <sys/segments.h>
  48   48  #include <sys/devops.h>
  49   49  #include <sys/ddi_impldefs.h>
  50   50  #include <vm/as.h>
  51   51  #include <sys/avintr.h>
  52   52  #include <sys/pic.h>
  53   53  #include <sys/rm_platter.h>
  54   54  #include <sys/stream.h>
  55   55  #include <sys/strsubr.h>
  56   56  #include <sys/sunddi.h>
  57   57  #include <sys/modctl.h>
  58   58  #include <sys/traptrace.h>
  59   59  #include <sys/ontrap.h>
  60   60  #include <sys/lgrp.h>
  61   61  #include <sys/dtrace.h>
  62   62  #include <sys/brand.h>
  63   63  #include <sys/fastboot.h>
  64   64  #include <sys/cpr_wakecode.h>
  65   65  #include <sys/comm_page.h>
  66   66  
  67   67  proc            PROCSIZE
  68   68          p_link
  69   69          p_next
  70   70          p_child
  71   71          p_sibling
  72   72          p_sig
  73   73          p_flag
  74   74          p_tlist
  75   75          p_as
  76   76          p_lockp
  77   77          p_user
  78   78          p_ldt
  79   79          p_ldt_desc
  80   80          p_model
  81   81          p_pctx
  82   82          p_agenttp
  83   83          p_zone
  84   84          p_brand
  85   85          p_brand_data
  86   86  
  87   87  _kthread        THREAD_SIZE
  88   88          t_pcb                   T_LABEL
  89   89          t_lock
  90   90          t_lockstat
  91   91          t_lockp
  92   92          t_lock_flush
  93   93          t_kpri_req
  94   94          t_oldspl
  95   95          t_pri
  96   96          t_pil
  97   97          t_lwp
  98   98          t_procp
  99   99          t_link
 100  100          t_state
 101  101          t_mstate
 102  102          t_preempt_lk
 103  103          t_stk                   T_STACK
 104  104          t_swap
 105  105          t_lwpchan.lc_wchan      T_WCHAN
 106  106          t_flag                  T_FLAGS
 107  107          t_ctx
 108  108          t_lofault
 109  109          t_onfault
 110  110          t_ontrap
 111  111          t_cpu
 112  112          t_lpl
 113  113          t_bound_cpu
 114  114          t_intr
 115  115          t_forw
 116  116          t_back
 117  117          t_sig
 118  118          t_tid
 119  119          t_pre_sys
 120  120          t_preempt
 121  121          t_proc_flag
 122  122          t_startpc
 123  123          t_sysnum
 124  124          t_intr_start
 125  125          _tu._ts._t_astflag      T_ASTFLAG
 126  126          _tu._ts._t_post_sys     T_POST_SYS
 127  127          _tu._t_post_sys_ast     T_POST_SYS_AST
 128  128          t_copyops
 129  129  #ifdef  __amd64
 130  130          t_useracc
 131  131  #endif
 132  132  
 133  133  ctxop
 134  134          save_op                 CTXOP_SAVE
 135  135  
 136  136  as
 137  137          a_hat
 138  138  
 139  139  user    USIZEBYTES
 140  140          u_comm
 141  141          u_signal
 142  142  
 143  143  _label_t
 144  144          val     LABEL_VAL
 145  145  
 146  146  \#define        LABEL_PC        LABEL_VAL
 147  147  \#define        LABEL_SP        _CONST(LABEL_VAL + LABEL_VAL_INCR)
 148  148  \#define        T_PC            _CONST(T_LABEL + LABEL_PC)
 149  149  \#define        T_SP            _CONST(T_LABEL + LABEL_SP)
 150  150  
 151  151  _klwp
 152  152          lwp_thread
 153  153          lwp_procp
 154  154          lwp_brand
 155  155          lwp_eosys
 156  156          lwp_regs
 157  157          lwp_arg
 158  158          lwp_ap
 159  159          lwp_cursig
 160  160          lwp_state
 161  161          lwp_mstate.ms_acct      LWP_MS_ACCT
 162  162          lwp_mstate.ms_prev      LWP_MS_PREV
 163  163          lwp_mstate.ms_start     LWP_MS_START
 164  164          lwp_mstate.ms_state_start LWP_MS_STATE_START
 165  165          lwp_pcb
 166  166          lwp_ru.sysc             LWP_RU_SYSC
 167  167  
 168  168  \#define        LWP_ACCT_USER   _CONST(LWP_MS_ACCT + _MUL(LMS_USER, LWP_MS_ACCT_INCR))
 169  169  \#define        LWP_ACCT_SYSTEM _CONST(LWP_MS_ACCT + _MUL(LMS_SYSTEM, LWP_MS_ACCT_INCR))
 170  170  
 171  171  fpu_ctx
 172  172          fpu_regs                FPU_CTX_FPU_REGS
 173  173          fpu_flags               FPU_CTX_FPU_FLAGS
 174  174          fpu_xsave_mask          FPU_CTX_FPU_XSAVE_MASK
 175  175  
 176  176  fxsave_state    FXSAVE_STATE_SIZE
 177  177          fx_fsw                  FXSAVE_STATE_FSW
 178  178          fx_mxcsr_mask           FXSAVE_STATE_MXCSR_MASK
 179  179  
 180  180  
 181  181  autovec         AUTOVECSIZE
 182  182          av_vector
 183  183          av_intarg1
 184  184          av_intarg2
 185  185          av_ticksp
 186  186          av_link
 187  187          av_prilevel
 188  188          av_dip
 189  189  
 190  190  av_head
 191  191          avh_link
 192  192          avh_hi_pri
 193  193          avh_lo_pri
 194  194  
 195  195  cpu
 196  196          cpu_id
 197  197          cpu_flags
 198  198          cpu_self
 199  199          cpu_thread
 200  200          cpu_thread_lock
 201  201          cpu_kprunrun
 202  202          cpu_lwp
 203  203          cpu_fpowner
 204  204          cpu_idle_thread
 205  205          cpu_intr_thread
 206  206          cpu_intr_actv
 207  207          cpu_base_spl
 208  208          cpu_intr_stack
 209  209          cpu_stats.sys.cpumigrate        CPU_STATS_SYS_CPUMIGRATE
 210  210          cpu_stats.sys.intr              CPU_STATS_SYS_INTR
 211  211          cpu_stats.sys.intrblk           CPU_STATS_SYS_INTRBLK
 212  212          cpu_stats.sys.syscall           CPU_STATS_SYS_SYSCALL
 213  213          cpu_profile_pc
 214  214          cpu_profile_upc
 215  215          cpu_profile_pil
 216  216          cpu_ftrace.ftd_state            CPU_FTRACE_STATE
 217  217          cpu_mstate
 218  218          cpu_intracct
 219  219  
 220  220  \#define        CPU_INTR_ACTV_REF       _CONST(CPU_INTR_ACTV + 2)
 221  221  
 222  222  cpu
 223  223          cpu_m.pil_high_start    CPU_PIL_HIGH_START
 224  224          cpu_m.intrstat          CPU_INTRSTAT
  
    | ↓ open down ↓ | 210 lines elided | ↑ open up ↑ | 
 225  225          cpu_m.mcpu_current_hat  CPU_CURRENT_HAT
 226  226          cpu_m.mcpu_gdt          CPU_GDT
 227  227          cpu_m.mcpu_idt          CPU_IDT
 228  228          cpu_m.mcpu_tss          CPU_TSS
 229  229          cpu_m.mcpu_softinfo     CPU_SOFTINFO
 230  230          cpu_m.mcpu_pri          CPU_PRI
 231  231  #if defined(__xpv)
 232  232          cpu_m.mcpu_vcpu_info    CPU_VCPU_INFO
 233  233  #endif
 234  234  
      235 +cpu
      236 +        cpu_m.mcpu_kpti.kf_kernel_cr3   CPU_KPTI_KCR3
      237 +        cpu_m.mcpu_kpti.kf_user_cr3     CPU_KPTI_UCR3
      238 +        cpu_m.mcpu_kpti.kf_tr_rsp       CPU_KPTI_TR_RSP
      239 +        cpu_m.mcpu_kpti.kf_tr_cr3       CPU_KPTI_TR_CR3
      240 +        cpu_m.mcpu_kpti.kf_r13          CPU_KPTI_R13
      241 +        cpu_m.mcpu_kpti.kf_r14          CPU_KPTI_R14
      242 +        cpu_m.mcpu_kpti.kf_tr_ret_rsp   CPU_KPTI_RET_RSP
      243 +
      244 +        cpu_m.mcpu_kpti.kf_ss           CPU_KPTI_SS
      245 +        cpu_m.mcpu_kpti.kf_rsp          CPU_KPTI_RSP
      246 +        cpu_m.mcpu_kpti.kf_rflags       CPU_KPTI_RFLAGS
      247 +        cpu_m.mcpu_kpti.kf_cs           CPU_KPTI_CS
      248 +        cpu_m.mcpu_kpti.kf_rip          CPU_KPTI_RIP
      249 +        cpu_m.mcpu_kpti.kf_err          CPU_KPTI_ERR
      250 +
      251 +        cpu_m.mcpu_pad2                 CPU_KPTI_START
      252 +        cpu_m.mcpu_pad3                 CPU_KPTI_END
      253 +
      254 +        cpu_m.mcpu_kpti_dbg             CPU_KPTI_DBG
      255 +
      256 +kpti_frame
      257 +        kf_r14          KPTI_R14
      258 +        kf_r13          KPTI_R13
      259 +        kf_err          KPTI_ERR
      260 +        kf_rip          KPTI_RIP
      261 +        kf_cs           KPTI_CS
      262 +        kf_rflags       KPTI_RFLAGS
      263 +        kf_rsp          KPTI_RSP
      264 +        kf_ss           KPTI_SS
      265 +
      266 +        kf_tr_rsp       KPTI_TOP
      267 +
      268 +        kf_kernel_cr3   KPTI_KCR3
      269 +        kf_user_cr3     KPTI_UCR3
      270 +        kf_tr_ret_rsp   KPTI_RET_RSP
      271 +        kf_tr_cr3       KPTI_TR_CR3
      272 +
      273 +        kf_tr_flag      KPTI_FLAG
      274 +
 235  275  standard_pic
 236  276          c_curmask
 237  277          c_iplmask
 238  278  
 239  279  ddi_dma_impl
 240  280          dmai_rflags
 241  281          dmai_rdip
 242  282  
 243  283  dev_info
 244  284          devi_ops                DEVI_DEV_OPS
 245  285          devi_bus_ctl
 246  286          devi_bus_dma_ctl
 247  287          devi_bus_dma_allochdl
 248  288          devi_bus_dma_freehdl
 249  289          devi_bus_dma_bindhdl
 250  290          devi_bus_dma_unbindhdl
 251  291          devi_bus_dma_flush
 252  292          devi_bus_dma_win
 253  293  
 254  294  dev_ops
 255  295          devo_bus_ops            DEVI_BUS_OPS
 256  296  
 257  297  bus_ops
 258  298          bus_ctl                 OPS_CTL
 259  299          bus_dma_map             OPS_MAP
 260  300          bus_dma_ctl             OPS_MCTL
 261  301          bus_dma_allochdl        OPS_ALLOCHDL
 262  302          bus_dma_freehdl         OPS_FREEHDL
 263  303          bus_dma_bindhdl         OPS_BINDHDL
 264  304          bus_dma_unbindhdl       OPS_UNBINDHDL
 265  305          bus_dma_flush           OPS_FLUSH
 266  306          bus_dma_win             OPS_WIN
 267  307  
 268  308  sysent  SYSENT_SIZE     SYSENT_SIZE_SHIFT
 269  309          sy_callc
 270  310          sy_flags
 271  311          sy_narg
 272  312  
 273  313  stdata
 274  314          sd_lock
 275  315  
 276  316  queue
 277  317          q_flag
 278  318          q_next
 279  319          q_stream
 280  320          q_syncq
 281  321          q_qinfo
 282  322  
 283  323  qinit
 284  324          qi_putp
 285  325  
 286  326  syncq
 287  327          sq_flags
 288  328          sq_count
 289  329          sq_lock
 290  330          sq_wait
 291  331  
 292  332  rm_platter
 293  333          rm_idt_lim              IDTROFF
 294  334          rm_gdt_lim              GDTROFF
 295  335          rm_pdbr                 CR3OFF
 296  336          rm_cpu                  CPUNOFF
 297  337          rm_cr4                  CR4OFF
 298  338          rm_cpu_halt_code        CPUHALTCODEOFF
 299  339          rm_cpu_halted           CPUHALTEDOFF
 300  340  
 301  341  ddi_acc_impl
 302  342          ahi_acc_attr    ACC_ATTR
 303  343          ahi_get8        ACC_GETB
 304  344          ahi_get16       ACC_GETW
 305  345          ahi_get32       ACC_GETL
 306  346          ahi_get64       ACC_GETLL
 307  347          ahi_put8        ACC_PUTB
 308  348          ahi_put16       ACC_PUTW
 309  349          ahi_put32       ACC_PUTL
 310  350          ahi_put64       ACC_PUTLL
 311  351          ahi_rep_get8    ACC_REP_GETB
 312  352          ahi_rep_get16   ACC_REP_GETW
 313  353          ahi_rep_get32   ACC_REP_GETL
 314  354          ahi_rep_get64   ACC_REP_GETLL
 315  355          ahi_rep_put8    ACC_REP_PUTB
 316  356          ahi_rep_put16   ACC_REP_PUTW
 317  357          ahi_rep_put32   ACC_REP_PUTL
 318  358          ahi_rep_put64   ACC_REP_PUTLL
 319  359  
 320  360  on_trap_data
 321  361          ot_prot
 322  362          ot_trap
 323  363          ot_trampoline
 324  364          ot_jmpbuf
 325  365          ot_prev
 326  366          ot_handle
 327  367          ot_pad1
 328  368  
 329  369  trap_trace_ctl_t        __TRAPTR_SIZE TRAPTR_SIZE_SHIFT
 330  370          ttc_next        TRAPTR_NEXT
 331  371          ttc_first       TRAPTR_FIRST
 332  372          ttc_limit       TRAPTR_LIMIT
 333  373  
 334  374  trap_trace_rec_t        TRAP_ENT_SIZE
 335  375          ttr_cr2
 336  376          ttr_info.idt_entry.vector       TTR_VECTOR
 337  377          ttr_info.idt_entry.ipl          TTR_IPL
 338  378          ttr_info.idt_entry.spl          TTR_SPL
 339  379          ttr_info.idt_entry.pri          TTR_PRI
 340  380          ttr_info.gate_entry.sysnum      TTR_SYSNUM
 341  381          ttr_marker
 342  382          ttr_stamp
 343  383          ttr_curthread
 344  384          ttr_sdepth
 345  385          ttr_stack
 346  386  
 347  387  lgrp_ld
 348  388          lpl_lgrpid
 349  389  
 350  390  dtrace_id_t     DTRACE_IDSIZE
 351  391  
 352  392  cpu_core        CPU_CORE_SIZE   CPU_CORE_SHIFT
 353  393          cpuc_dtrace_flags
 354  394          cpuc_dtrace_illval
 355  395  
 356  396  timespec        TIMESPEC_SIZE
 357  397  
 358  398  gate_desc       GATE_DESC_SIZE
 359  399  
 360  400  desctbr_t       DESCTBR_SIZE
 361  401          dtr_limit
 362  402          dtr_base
 363  403  
 364  404  mod_stub_info   MODS_SIZE
 365  405          mods_func_adr   MODS_INSTFCN
 366  406          mods_errfcn     MODS_RETFCN
 367  407          mods_flag
 368  408  
 369  409  \#define        TRAP_TSIZE              _MUL(TRAP_ENT_SIZE, TRAPTR_NENT)
 370  410  
 371  411  copyops
 372  412          cp_copyin
 373  413          cp_xcopyin
 374  414          cp_copyout
 375  415          cp_xcopyout
 376  416          cp_copyinstr
 377  417          cp_copyoutstr
 378  418          cp_fuword8
 379  419          cp_fuword16
 380  420          cp_fuword32
 381  421          cp_fuword64
 382  422          cp_suword8
 383  423          cp_suword16
 384  424          cp_suword32
 385  425          cp_suword64
 386  426          cp_physio
 387  427  
 388  428  brand
 389  429          b_machops
 390  430  
 391  431  brand_proc_data_t
 392  432          spd_handler
 393  433  
 394  434  fastboot_file_t
 395  435          fb_va
 396  436          fb_pte_list_va
 397  437          fb_pte_list_pa
 398  438          fb_dest_pa
 399  439          fb_size
 400  440          fb_next_pa
 401  441          fb_sections
 402  442          fb_sectcnt
 403  443  
 404  444  fastboot_section_t
 405  445          fb_sec_offset
 406  446          fb_sec_paddr
 407  447          fb_sec_size
 408  448          fb_sec_bss_size
 409  449  
 410  450  fastboot_info_t
 411  451          fi_files
 412  452          fi_has_pae
 413  453          fi_pagetable_va
 414  454          fi_pagetable_pa
 415  455          fi_last_table_pa
 416  456          fi_new_mbi_pa
 417  457          fi_valid
 418  458  
 419  459  zone
 420  460          zone_brand_data
 421  461  
 422  462  wc_cpu  WC_CPU_SIZE
 423  463          wc_retaddr
 424  464          wc_virtaddr
 425  465          wc_cr0
 426  466          wc_cr3
 427  467          wc_cr4
 428  468          wc_cr8
 429  469          wc_fs
 430  470          wc_fsbase
 431  471          wc_gs
 432  472          wc_gsbase
 433  473          wc_kgsbase
 434  474          wc_r8
 435  475          wc_r9
 436  476          wc_r10
 437  477          wc_r11
 438  478          wc_r12
 439  479          wc_r13
 440  480          wc_r14
 441  481          wc_r15
 442  482          wc_rax
 443  483          wc_rbp
 444  484          wc_rbx
 445  485          wc_rcx
 446  486          wc_rdi
 447  487          wc_rdx
 448  488          wc_rsi
 449  489          wc_rsp
 450  490          wc_gdt_limit    WC_GDT
 451  491          wc_gdt_base
 452  492          wc_idt_limit    WC_IDT
 453  493          wc_idt_base
 454  494          wc_tr
 455  495          wc_ldt
 456  496          wc_eflags
 457  497          wc_ebx
 458  498          wc_edi
 459  499          wc_esi
 460  500          wc_ebp
 461  501          wc_esp
 462  502          wc_esp
 463  503          wc_ss
 464  504          wc_cs
 465  505          wc_ds
 466  506          wc_es
 467  507          wc_cpu_id
 468  508          wc_saved_stack
 469  509  
 470  510  wc_wakecode
 471  511          wc_cpu
 472  512  
 473  513  comm_page_s     COMM_PAGE_S_SIZE
  
    | ↓ open down ↓ | 229 lines elided | ↑ open up ↑ | 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX