Print this page
11787 Kernel needs to be built with retpolines
11788 Kernel needs to generally use RSB stuffing
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: John Levon <john.levon@joyent.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/intel/ia32/ml/modstubs.s
          +++ new/usr/src/uts/intel/ia32/ml/modstubs.s
↓ 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  /*
  23   23   * Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved.
  24      - * Copyright (c) 2017, Joyent, Inc. All rights reserved.
       24 + * Copyright 2019 Joyent, Inc.
  25   25   */
  26   26  
  27   27  #include <sys/asm_linkage.h>
  28   28  
  29   29  #if defined(__lint)
  30   30  
  31   31  char stubs_base[1], stubs_end[1];
  32   32  
  33   33  #else   /* __lint */
  34   34  
↓ open down ↓ 22 lines elided ↑ open up ↑
  57   57   * and if you do, the kernel will most likely crash.  Be careful
  58   58   *
  59   59   * This file assumes that all of the contributions to the data segment
  60   60   * will be contiguous in the output file, even though they are separated
  61   61   * by pieces of text.  This is safe for all assemblers I know of now...
  62   62   */
  63   63  
  64   64  /*
  65   65   * This file uses ansi preprocessor features:
  66   66   *
  67      - * 1.   #define mac(a) extra_ ## a     -->   mac(x) expands to extra_a
       67 + * 1.   #define mac(a) extra_ ## a     -->   mac(x) expands to extra_a
  68   68   * The old version of this is
  69   69   *      #define mac(a) extra_/.*.*./a
  70   70   * but this fails if the argument has spaces "mac ( x )"
  71   71   * (Ignore the dots above, I had to put them in to keep this a comment.)
  72   72   *
  73   73   * 2.   #define mac(a) #a             -->    mac(x) expands to "x"
  74   74   * The old version is
  75   75   *      #define mac(a) "a"
  76   76   *
  77   77   * For some reason, the 5.0 preprocessor isn't happy with the above usage.
↓ open down ↓ 6 lines elided ↑ open up ↑
  84   84   * two tokens "." and "globl". For this reason, the traditional, non-ANSI
  85   85   * preprocessor is used on assembly files.
  86   86   *
  87   87   * It would be desirable to have a non-tokenizing cpp (accp?) to use for this.
  88   88   */
  89   89  
  90   90  /*
  91   91   * This file contains the stubs routines for modules which can be autoloaded.
  92   92   */
  93   93  
  94      -#if defined(__amd64)
  95      -
  96   94  /*
  97   95   * See the 'struct mod_modinfo' definition to see what this declaration
  98   96   * is trying to achieve here.
  99   97   */
 100   98  #define MODULE(module,namespace)        \
 101   99          .data;                          \
 102  100  module/**/_modname:                     \
 103  101          .string "namespace/module";     \
 104  102          SET_SIZE(module/**/_modname);   \
 105  103          .align  CPTRSIZE;               \
↓ open down ↓ 17 lines elided ↑ open up ↑
 123  121   * mod_stub_info structure for the stub function
 124  122   */
 125  123  
 126  124  #define STUB_COMMON(module, fcnname, install_fcn, retfcn, weak)         \
 127  125          ENTRY(fcnname);                                                 \
 128  126          leaq    fcnname/**/_info(%rip), %rax;                           \
 129  127          cmpl    $0, MODS_FLAG(%rax);                    /* weak? */     \
 130  128          je      stubs_common_code;                      /* not weak */  \
 131  129          testb   $MODS_INSTALLED, MODS_FLAG(%rax);       /* installed? */ \
 132  130          jne     stubs_common_code;              /* yes, do the mod_hold */ \
 133      -        jmp     *MODS_RETFCN(%rax);             /* no, jump to retfcn */ \
      131 +        movq    MODS_RETFCN(%rax), %rax;        /* no, load retfcn */   \
      132 +        INDIRECT_JMP_REG(rax);                  /* no, jump to retfcn */ \
 134  133          SET_SIZE(fcnname);                                              \
 135  134          .data;                                                          \
 136  135          .align   CPTRSIZE;                                              \
 137  136          .type   fcnname/**/_info, @object;                              \
 138  137  fcnname/**/_info:                                                       \
 139  138          .quad   install_fcn;            /* 0 */                         \
 140  139          .quad   module/**/_modinfo;     /* 0x8 */                       \
 141  140          .quad   fcnname;                /* 0x10 */                      \
 142  141          .quad   retfcn;                 /* 0x18 */                      \
 143  142          .long   weak;                   /* 0x20 */                      \
 144  143          SET_SIZE(fcnname/**/_info)
 145  144  
 146  145  #define STUB_NO_UNLOADABLE(module, fcnname, install_fcn, retfcn, weak)  \
 147  146          ENTRY(fcnname);                                                 \
 148  147          leaq    fcnname/**/_info(%rip), %rax;                           \
 149  148          testb   $MODS_INSTALLED, MODS_FLAG(%rax); /* installed? */      \
 150  149          je      5f;                     /* no */                        \
 151      -        jmp     *(%rax);                /* yes, jump to install_fcn */  \
      150 +        movq    MODS_INSTFCN(%rax), %rax; /* yes, load install_fcn */   \
      151 +        INDIRECT_JMP_REG(rax);          /* yes, jump to install_fcn */  \
 152  152  5:      testb   $MODS_WEAK, MODS_FLAG(%rax);    /* weak? */             \
 153  153          je      stubs_common_code;      /* no, do mod load */           \
 154      -        jmp     *MODS_RETFCN(%rax);     /* yes, jump to retfcn */       \
      154 +        movq    MODS_RETFCN(%rax), %rax; /* yes, load retfcn */         \
      155 +        INDIRECT_JMP_REG(rax);          /* yes, jump to retfcn */       \
 155  156          SET_SIZE(fcnname);                                              \
 156  157          .data;                                                          \
 157  158          .align  CPTRSIZE;                                               \
 158  159          .type   fcnname/**/_info, @object;                              \
 159  160  fcnname/**/_info:                                                       \
 160  161          .quad   install_fcn;            /* 0 */                         \
 161  162          .quad   module/**/_modinfo;     /* 0x8 */                       \
 162  163          .quad   fcnname;                /* 0x10 */                      \
 163  164          .quad   retfcn;                 /* 0x18 */                      \
 164  165          .long   weak;                   /* 0x20 */                      \
↓ open down ↓ 18 lines elided ↑ open up ↑
 183  184          pushq   %rdx
 184  185          pushq   %rcx
 185  186          pushq   %r8
 186  187          pushq   %r9
 187  188          /* (next 4 args, if any, are already on the stack above %rbp) */
 188  189          movq    %r15, %rdi
 189  190          call    mod_hold_stub           /* mod_hold_stub(mod_stub_info *) */
 190  191          cmpl    $-1, %eax               /* error? */
 191  192          jne     .L1
 192  193          movq    0x18(%r15), %rax
 193      -        call    *%rax
      194 +        INDIRECT_CALL_REG(rax)
 194  195          addq    $0x30, %rsp
 195  196          jmp     .L2
 196  197  .L1:
 197  198          /*
 198  199           * copy MAXNARG == 10 incoming arguments
 199  200           */
 200  201          popq    %r9
 201  202          popq    %r8
 202  203          popq    %rcx
 203  204          popq    %rdx
↓ open down ↓ 8 lines elided ↑ open up ↑
 212  213           *      saved %rip      0x18(%rsp)
 213  214           *      saved %rbp      0x10(%rsp)
 214  215           *      <pad>           0x8(%rsp)
 215  216           *      saved %r15      0x0(%rsp)
 216  217           */
 217  218          movl    $MAXNARG - 6 + 3, %r11d
 218  219          pushq   (%rsp, %r11, 8)
 219  220          pushq   (%rsp, %r11, 8)
 220  221          pushq   (%rsp, %r11, 8)
 221  222          pushq   (%rsp, %r11, 8)
 222      -        call    *(%r15)                 /* call the stub fn(arg, ..) */
      223 +        movq    (%r15), %rax
      224 +        INDIRECT_CALL_REG(rax)          /* call the stub fn(arg, ..) */
 223  225          addq    $0x20, %rsp             /* pop off last 4 args */
 224  226          pushq   %rax                    /* save any return values */
 225  227          pushq   %rdx
 226  228          movq    %r15, %rdi
 227  229          call    mod_release_stub        /* release hold on module */
 228  230          popq    %rdx                    /* restore return values */
 229  231          popq    %rax
 230  232  .L2:
 231  233          popq    %r15
 232  234          leave
 233  235          ret
 234  236          SET_SIZE(stubs_common_code)
 235  237  
 236      -#elif defined(__i386)
 237      -
 238      -/*
 239      - * See the 'struct mod_modinfo' definition to see what this declaration
 240      - * is trying to achieve here.
 241      - */
 242      -#define MODULE(module,namespace)        \
 243      -        .data;                          \
 244      -module/**/_modname:                     \
 245      -        .string "namespace/module";     \
 246      -        SET_SIZE(module/**/_modname);   \
 247      -        .align  CPTRSIZE;               \
 248      -        .globl  module/**/_modinfo;     \
 249      -        .type   module/**/_modinfo, @object;    \
 250      -module/**/_modinfo:                     \
 251      -        .long   module/**/_modname;     \
 252      -        .long   0       /* storage for modctl pointer */
 253      -
 254      -        /* then mod_stub_info structures follow until a mods_func_adr is 0 */
 255      -
 256      -/* this puts a 0 where the next mods_func_adr would be */
 257      -#define END_MODULE(module)              \
 258      -        .data;                          \
 259      -        .align  CPTRSIZE;               \
 260      -        .long 0;                        \
 261      -        SET_SIZE(module/**/_modinfo)
 262      -
 263      -/*
 264      - * The data section in the stub_common macro is the
 265      - * mod_stub_info structure for the stub function
 266      - */
 267      -
 268      -/*      
 269      - * The flag MODS_INSTALLED is stored in the stub data and is used to
 270      - * indicate if a module is installed and initialized.  This flag is used
 271      - * instead of the mod_stub_info->mods_modinfo->mod_installed flag
 272      - * to minimize the number of pointer de-references for each function
 273      - * call (and also to avoid possible TLB misses which could be induced
 274      - * by dereferencing these pointers.)
 275      - */     
 276      -
 277      -#define STUB_COMMON(module, fcnname, install_fcn, retfcn, weak)         \
 278      -        ENTRY(fcnname);                                                 \
 279      -        leal    fcnname/**/_info, %eax;                                 \
 280      -        cmpl    $0, MODS_FLAG(%eax);    /* weak? */                     \
 281      -        je      stubs_common_code;      /* not weak */                  \
 282      -        testb   $MODS_INSTALLED, MODS_FLAG(%eax); /* installed? */      \
 283      -        jne     stubs_common_code;      /* yes, do the mod_hold */      \
 284      -        jmp     *MODS_RETFCN(%eax);     /* no, just jump to retfcn */   \
 285      -        SET_SIZE(fcnname);                                              \
 286      -        .data;                                                          \
 287      -        .align   CPTRSIZE;                                              \
 288      -        .type   fcnname/**/_info, @object;                              \
 289      -fcnname/**/_info:                                                       \
 290      -        .long   install_fcn;                                            \
 291      -        .long   module/**/_modinfo;                                     \
 292      -        .long   fcnname;                                                \
 293      -        .long   retfcn;                                                 \
 294      -        .long   weak;                                                   \
 295      -        SET_SIZE(fcnname/**/_info)
 296      -        
 297      -#define STUB_NO_UNLOADABLE(module, fcnname, install_fcn, retfcn, weak)  \
 298      -        ENTRY(fcnname);                                                 \
 299      -        leal    fcnname/**/_info, %eax;                                 \
 300      -        testb   $MODS_INSTALLED, MODS_FLAG(%eax); /* installed? */      \
 301      -        je      5f;             /* no */                                \
 302      -        jmp     *(%eax);        /* yes, just jump to install_fcn */     \
 303      -5:      testb   $MODS_WEAK, MODS_FLAG(%eax);    /* weak? */             \
 304      -        je      stubs_common_code;      /* no, do mod load */           \
 305      -        jmp     *MODS_RETFCN(%eax);     /* yes, just jump to retfcn */  \
 306      -        SET_SIZE(fcnname);                                              \
 307      -        .data;                                                          \
 308      -        .align  CPTRSIZE;                                               \
 309      -        .type   fcnname/**/_info, @object;                              \
 310      -fcnname/**/_info:                                                       \
 311      -        .long   install_fcn;            /* 0 */                         \
 312      -        .long   module/**/_modinfo;     /* 0x4 */                       \
 313      -        .long   fcnname;                /* 0x8 */                       \
 314      -        .long   retfcn;                 /* 0xc */                       \
 315      -        .long   weak;                   /* 0x10 */                      \
 316      -        SET_SIZE(fcnname/**/_info)
 317      -
 318      -/*
 319      - * We branch here with the fcnname_info pointer in %eax
 320      - */
 321      -        ENTRY_NP(stubs_common_code)
 322      -        .globl  mod_hold_stub
 323      -        .globl  mod_release_stub
 324      -        pushl   %esi
 325      -        movl    %eax, %esi              / save the info pointer
 326      -        pushl   %eax
 327      -        call    mod_hold_stub           / mod_hold_stub(mod_stub_info *)
 328      -        popl    %ecx
 329      -        cmpl    $-1, %eax               / error?
 330      -        jne     .L1
 331      -        movl    MODS_RETFCN(%esi), %eax
 332      -        call    *%eax   
 333      -        popl    %esi                    / yes, return error (panic?)
 334      -        ret
 335      -.L1:
 336      -        movl    $MAXNARG+1, %ecx
 337      -        / copy incoming arguments
 338      -        pushl   (%esp, %ecx, 4)         / push MAXNARG times
 339      -        pushl   (%esp, %ecx, 4)
 340      -        pushl   (%esp, %ecx, 4)
 341      -        pushl   (%esp, %ecx, 4)
 342      -        pushl   (%esp, %ecx, 4)
 343      -        pushl   (%esp, %ecx, 4)
 344      -        pushl   (%esp, %ecx, 4)
 345      -        pushl   (%esp, %ecx, 4)
 346      -        pushl   (%esp, %ecx, 4)
 347      -        pushl   (%esp, %ecx, 4)
 348      -        call    *(%esi)                 / call the stub function(arg1,arg2, ...)
 349      -        add     $_MUL(MAXNARG, 4), %esp / pop off MAXNARG arguments
 350      -        pushl   %eax                    / save any return values from the stub
 351      -        pushl   %edx
 352      -        pushl   %esi
 353      -        call    mod_release_stub        / release hold on module
 354      -        addl    $4, %esp
 355      -        popl    %edx                    / restore return values
 356      -        popl    %eax
 357      -.L2:
 358      -        popl    %esi
 359      -        ret
 360      -        SET_SIZE(stubs_common_code)
 361      -
 362      -#endif  /* __i386 */
 363      -
 364  238  #define STUB(module, fcnname, retfcn)   \
 365  239      STUB_COMMON(module, fcnname, mod_hold_stub, retfcn, 0)
 366  240  
 367  241  /*
 368  242   * "weak stub", don't load on account of this call
 369  243   */
 370  244  #define WSTUB(module, fcnname, retfcn)  \
 371  245      STUB_COMMON(module, fcnname, retfcn, retfcn, MODS_WEAK)
 372  246  
 373  247  /*
↓ open down ↓ 12 lines elided ↑ open up ↑
 386  260      STUB_NO_UNLOADABLE(module, fcnname, retfcn, retfcn, MODS_NOUNLOAD|MODS_WEAK)
 387  261  
 388  262  /*
 389  263   * this is just a marker for the beginning area of text that contains stubs
 390  264   */
 391  265          ENTRY_NP(stubs_base)
 392  266          nop
 393  267  
 394  268  /*
 395  269   * WARNING WARNING WARNING!!!!!!
 396      - * 
      270 + *
 397  271   * On the MODULE macro you MUST NOT use any spaces!!! They are
 398  272   * significant to the preprocessor.  With ansi c there is a way around this
 399  273   * but for some reason (yet to be investigated) ansi didn't work for other
 400      - * reasons!  
      274 + * reasons!
 401  275   *
 402  276   * When zero is used as the return function, the system will call
 403  277   * panic if the stub can't be resolved.
 404  278   */
 405  279  
 406  280  /*
 407  281   * Stubs for devfs. A non-unloadable module.
 408  282   */
 409  283  
 410  284  #ifndef DEVFS_MODULE
↓ open down ↓ 21 lines elided ↑ open up ↑
 432  306  #endif
 433  307  
 434  308  /*
 435  309   * Stubs for specfs. A non-unloadable module.
 436  310   */
 437  311  
 438  312  #ifndef SPEC_MODULE
 439  313          MODULE(specfs,fs);
 440  314          NO_UNLOAD_STUB(specfs, common_specvp,           nomod_zero);
 441  315          NO_UNLOAD_STUB(specfs, makectty,                nomod_zero);
 442      -        NO_UNLOAD_STUB(specfs, makespecvp,              nomod_zero);
 443      -        NO_UNLOAD_STUB(specfs, smark,                   nomod_zero);
 444      -        NO_UNLOAD_STUB(specfs, spec_segmap,             nomod_einval);
 445      -        NO_UNLOAD_STUB(specfs, specfind,                nomod_zero);
 446      -        NO_UNLOAD_STUB(specfs, specvp,                  nomod_zero);
      316 +        NO_UNLOAD_STUB(specfs, makespecvp,              nomod_zero);
      317 +        NO_UNLOAD_STUB(specfs, smark,                   nomod_zero);
      318 +        NO_UNLOAD_STUB(specfs, spec_segmap,             nomod_einval);
      319 +        NO_UNLOAD_STUB(specfs, specfind,                nomod_zero);
      320 +        NO_UNLOAD_STUB(specfs, specvp,                  nomod_zero);
 447  321          NO_UNLOAD_STUB(specfs, devi_stillreferenced,    nomod_zero);
 448  322          NO_UNLOAD_STUB(specfs, spec_getvnodeops,        nomod_zero);
 449  323          NO_UNLOAD_STUB(specfs, spec_char_map,           nomod_zero);
 450      -        NO_UNLOAD_STUB(specfs, specvp_devfs,            nomod_zero);
      324 +        NO_UNLOAD_STUB(specfs, specvp_devfs,            nomod_zero);
 451  325          NO_UNLOAD_STUB(specfs, spec_assoc_vp_with_devi, nomod_void);
 452  326          NO_UNLOAD_STUB(specfs, spec_hold_devi_by_vp,    nomod_zero);
 453  327          NO_UNLOAD_STUB(specfs, spec_snode_walk,         nomod_void);
 454  328          NO_UNLOAD_STUB(specfs, spec_devi_open_count,    nomod_minus_one);
 455  329          NO_UNLOAD_STUB(specfs, spec_is_clone,           nomod_zero);
 456  330          NO_UNLOAD_STUB(specfs, spec_is_selfclone,       nomod_zero);
 457  331          NO_UNLOAD_STUB(specfs, spec_fence_snode,        nomod_minus_one);
 458  332          NO_UNLOAD_STUB(specfs, spec_unfence_snode,      nomod_minus_one);
 459  333          END_MODULE(specfs);
 460  334  #endif
 461  335  
 462  336  
 463  337  /*
 464  338   * Stubs for sockfs. A non-unloadable module.
 465  339   */
 466  340  #ifndef SOCK_MODULE
 467  341          MODULE(sockfs,fs);
 468      -        NO_UNLOAD_STUB(sockfs, so_socket,       nomod_zero);
      342 +        NO_UNLOAD_STUB(sockfs, so_socket,       nomod_zero);
 469  343          NO_UNLOAD_STUB(sockfs, so_socketpair,   nomod_zero);
 470      -        NO_UNLOAD_STUB(sockfs, bind,            nomod_zero);
 471      -        NO_UNLOAD_STUB(sockfs, listen,          nomod_zero);
 472      -        NO_UNLOAD_STUB(sockfs, accept,          nomod_zero);
 473      -        NO_UNLOAD_STUB(sockfs, connect,         nomod_zero);
 474      -        NO_UNLOAD_STUB(sockfs, shutdown,        nomod_zero);
 475      -        NO_UNLOAD_STUB(sockfs, recv,            nomod_zero);
 476      -        NO_UNLOAD_STUB(sockfs, recvfrom,        nomod_zero);
 477      -        NO_UNLOAD_STUB(sockfs, recvmsg,         nomod_zero);
 478      -        NO_UNLOAD_STUB(sockfs, send,            nomod_zero);
 479      -        NO_UNLOAD_STUB(sockfs, sendmsg,         nomod_zero);
 480      -        NO_UNLOAD_STUB(sockfs, sendto,          nomod_zero);
      344 +        NO_UNLOAD_STUB(sockfs, bind,            nomod_zero);
      345 +        NO_UNLOAD_STUB(sockfs, listen,          nomod_zero);
      346 +        NO_UNLOAD_STUB(sockfs, accept,          nomod_zero);
      347 +        NO_UNLOAD_STUB(sockfs, connect,         nomod_zero);
      348 +        NO_UNLOAD_STUB(sockfs, shutdown,        nomod_zero);
      349 +        NO_UNLOAD_STUB(sockfs, recv,            nomod_zero);
      350 +        NO_UNLOAD_STUB(sockfs, recvfrom,        nomod_zero);
      351 +        NO_UNLOAD_STUB(sockfs, recvmsg,         nomod_zero);
      352 +        NO_UNLOAD_STUB(sockfs, send,            nomod_zero);
      353 +        NO_UNLOAD_STUB(sockfs, sendmsg,         nomod_zero);
      354 +        NO_UNLOAD_STUB(sockfs, sendto,          nomod_zero);
 481  355  #ifdef _SYSCALL32_IMPL
 482  356          NO_UNLOAD_STUB(sockfs, recv32,          nomod_zero);
 483  357          NO_UNLOAD_STUB(sockfs, recvfrom32,      nomod_zero);
 484  358          NO_UNLOAD_STUB(sockfs, send32,          nomod_zero);
 485  359          NO_UNLOAD_STUB(sockfs, sendto32,        nomod_zero);
 486  360  #endif  /* _SYSCALL32_IMPL */
 487      -        NO_UNLOAD_STUB(sockfs, getpeername,     nomod_zero);
 488      -        NO_UNLOAD_STUB(sockfs, getsockname,     nomod_zero);
 489      -        NO_UNLOAD_STUB(sockfs, getsockopt,      nomod_zero);
 490      -        NO_UNLOAD_STUB(sockfs, setsockopt,      nomod_zero);
 491      -        NO_UNLOAD_STUB(sockfs, sockconfig,      nomod_zero);
 492      -        NO_UNLOAD_STUB(sockfs, sock_getmsg,     nomod_zero);
 493      -        NO_UNLOAD_STUB(sockfs, sock_putmsg,     nomod_zero);
 494      -        NO_UNLOAD_STUB(sockfs, sosendfile64,    nomod_zero);
 495      -        NO_UNLOAD_STUB(sockfs, snf_segmap,      nomod_einval);
 496      -        NO_UNLOAD_STUB(sockfs, sock_getfasync,  nomod_zero);
 497      -        NO_UNLOAD_STUB(sockfs, nl7c_sendfilev,  nomod_zero);
 498      -        NO_UNLOAD_STUB(sockfs, sotpi_sototpi,  nomod_zero);
 499      -        NO_UNLOAD_STUB(sockfs, socket_sendmblk,  nomod_zero);
      361 +        NO_UNLOAD_STUB(sockfs, getpeername,     nomod_zero);
      362 +        NO_UNLOAD_STUB(sockfs, getsockname,     nomod_zero);
      363 +        NO_UNLOAD_STUB(sockfs, getsockopt,      nomod_zero);
      364 +        NO_UNLOAD_STUB(sockfs, setsockopt,      nomod_zero);
      365 +        NO_UNLOAD_STUB(sockfs, sockconfig,      nomod_zero);
      366 +        NO_UNLOAD_STUB(sockfs, sock_getmsg,     nomod_zero);
      367 +        NO_UNLOAD_STUB(sockfs, sock_putmsg,     nomod_zero);
      368 +        NO_UNLOAD_STUB(sockfs, sosendfile64,    nomod_zero);
      369 +        NO_UNLOAD_STUB(sockfs, snf_segmap,      nomod_einval);
      370 +        NO_UNLOAD_STUB(sockfs, sock_getfasync,  nomod_zero);
      371 +        NO_UNLOAD_STUB(sockfs, nl7c_sendfilev,  nomod_zero);
      372 +        NO_UNLOAD_STUB(sockfs, sotpi_sototpi,   nomod_zero);
      373 +        NO_UNLOAD_STUB(sockfs, socket_sendmblk, nomod_zero);
 500  374          NO_UNLOAD_STUB(sockfs, socket_setsockopt,  nomod_zero);
 501  375          END_MODULE(sockfs);
 502  376  #endif
 503  377  
 504  378  /*
 505  379   * IPsec stubs.
 506  380   */
 507  381  
 508  382  #ifndef IPSECAH_MODULE
 509  383          MODULE(ipsecah,drv);
↓ open down ↓ 77 lines elided ↑ open up ↑
 587  461  
 588  462  /*
 589  463   * Stubs for kernel lock manager.
 590  464   */
 591  465  #ifndef KLM_MODULE
 592  466          MODULE(klmmod,misc);
 593  467          NO_UNLOAD_STUB(klmmod, lm_svc,          nomod_zero);
 594  468          NO_UNLOAD_STUB(klmmod, lm_shutdown,     nomod_zero);
 595  469          NO_UNLOAD_STUB(klmmod, lm_unexport,     nomod_zero);
 596  470          NO_UNLOAD_STUB(klmmod, lm_cprresume,    nomod_zero);
 597      -        NO_UNLOAD_STUB(klmmod, lm_cprsuspend,   nomod_zero); 
      471 +        NO_UNLOAD_STUB(klmmod, lm_cprsuspend,   nomod_zero);
 598  472          NO_UNLOAD_STUB(klmmod, lm_safelock, nomod_zero);
 599  473          NO_UNLOAD_STUB(klmmod, lm_safemap, nomod_zero);
 600  474          NO_UNLOAD_STUB(klmmod, lm_has_sleep, nomod_zero);
 601  475          NO_UNLOAD_STUB(klmmod, lm_free_config, nomod_zero);
 602  476          NO_UNLOAD_STUB(klmmod, lm_vp_active, nomod_zero);
 603  477          NO_UNLOAD_STUB(klmmod, lm_get_sysid, nomod_zero);
 604  478          NO_UNLOAD_STUB(klmmod, lm_rel_sysid, nomod_zero);
 605      -        NO_UNLOAD_STUB(klmmod, lm_alloc_sysidt, nomod_minus_one); 
 606      -        NO_UNLOAD_STUB(klmmod, lm_free_sysidt, nomod_zero); 
      479 +        NO_UNLOAD_STUB(klmmod, lm_alloc_sysidt, nomod_minus_one);
      480 +        NO_UNLOAD_STUB(klmmod, lm_free_sysidt, nomod_zero);
 607  481          NO_UNLOAD_STUB(klmmod, lm_sysidt, nomod_minus_one);
 608  482          END_MODULE(klmmod);
 609  483  #endif
 610  484  
 611  485  #ifndef KLMOPS_MODULE
 612  486          MODULE(klmops,misc);
 613  487          NO_UNLOAD_STUB(klmops, lm_frlock,       nomod_zero);
 614  488          NO_UNLOAD_STUB(klmops, lm4_frlock,      nomod_zero);
 615  489          NO_UNLOAD_STUB(klmops, lm_shrlock,      nomod_zero);
 616  490          NO_UNLOAD_STUB(klmops, lm4_shrlock,     nomod_zero);
↓ open down ↓ 39 lines elided ↑ open up ↑
 656  530          NO_UNLOAD_STUB(rpcmod, svc_queuereq,            nomod_minus_one);
 657  531          NO_UNLOAD_STUB(rpcmod, clist_add,               nomod_minus_one);
 658  532          END_MODULE(rpcmod);
 659  533  #endif
 660  534  
 661  535  /*
 662  536   * Stubs for des
 663  537   */
 664  538  #ifndef DES_MODULE
 665  539          MODULE(des,misc);
 666      -        STUB(des, cbc_crypt,            nomod_zero);
 667      -        STUB(des, ecb_crypt,            nomod_zero);
      540 +        STUB(des, cbc_crypt,            nomod_zero);
      541 +        STUB(des, ecb_crypt,            nomod_zero);
 668  542          STUB(des, _des_crypt,           nomod_zero);
 669  543          END_MODULE(des);
 670  544  #endif
 671  545  
 672  546  /*
 673  547   * Stubs for procfs. A non-unloadable module.
 674  548   */
 675  549  #ifndef PROC_MODULE
 676  550          MODULE(procfs,fs);
 677  551          NO_UNLOAD_STUB(procfs, prfree,          nomod_zero);
 678  552          NO_UNLOAD_STUB(procfs, prexit,          nomod_zero);
 679  553          NO_UNLOAD_STUB(procfs, prlwpfree,       nomod_zero);
 680  554          NO_UNLOAD_STUB(procfs, prlwpexit,       nomod_zero);
 681  555          NO_UNLOAD_STUB(procfs, prinvalidate,    nomod_zero);
 682  556          NO_UNLOAD_STUB(procfs, prnsegs,         nomod_zero);
 683  557          NO_UNLOAD_STUB(procfs, prgetcred,       nomod_zero);
 684  558          NO_UNLOAD_STUB(procfs, prgetpriv,       nomod_zero);
 685  559          NO_UNLOAD_STUB(procfs, prgetprivsize,   nomod_zero);
 686      -        NO_UNLOAD_STUB(procfs, prgetsecflags,   nomod_zero);
      560 +        NO_UNLOAD_STUB(procfs, prgetsecflags,   nomod_zero);
 687  561          NO_UNLOAD_STUB(procfs, prgetstatus,     nomod_zero);
 688  562          NO_UNLOAD_STUB(procfs, prgetlwpstatus,  nomod_zero);
 689  563          NO_UNLOAD_STUB(procfs, prgetpsinfo,     nomod_zero);
 690  564          NO_UNLOAD_STUB(procfs, prgetlwpsinfo,   nomod_zero);
 691  565          NO_UNLOAD_STUB(procfs, oprgetstatus,    nomod_zero);
 692  566          NO_UNLOAD_STUB(procfs, oprgetpsinfo,    nomod_zero);
 693  567  #ifdef _SYSCALL32_IMPL
 694  568          NO_UNLOAD_STUB(procfs, prgetstatus32,   nomod_zero);
 695  569          NO_UNLOAD_STUB(procfs, prgetlwpstatus32, nomod_zero);
 696  570          NO_UNLOAD_STUB(procfs, prgetpsinfo32,   nomod_zero);
↓ open down ↓ 17 lines elided ↑ open up ↑
 714  588          NO_UNLOAD_STUB(procfs, pr_allstopped,   nomod_zero);
 715  589          NO_UNLOAD_STUB(procfs, pr_free_watched_pages, nomod_zero);
 716  590          END_MODULE(procfs);
 717  591  #endif
 718  592  
 719  593  /*
 720  594   * Stubs for fifofs
 721  595   */
 722  596  #ifndef FIFO_MODULE
 723  597          MODULE(fifofs,fs);
 724      -        NO_UNLOAD_STUB(fifofs, fifovp,          nomod_zero);
      598 +        NO_UNLOAD_STUB(fifofs, fifovp,          nomod_zero);
 725  599          NO_UNLOAD_STUB(fifofs, fifo_getinfo,    nomod_zero);
 726  600          NO_UNLOAD_STUB(fifofs, fifo_vfastoff,   nomod_zero);
 727  601          END_MODULE(fifofs);
 728  602  #endif
 729  603  
 730  604  /*
 731  605   * Stubs for ufs
 732  606   *
 733  607   * This is needed to support the old quotactl system call.
 734  608   * When the old sysent stuff goes away, this will need to be revisited.
↓ open down ↓ 22 lines elided ↑ open up ↑
 757  631          MODULE(dcfs,fs);
 758  632          STUB(dcfs, decompvp, 0);
 759  633          END_MODULE(dcfs);
 760  634  #endif
 761  635  
 762  636  /*
 763  637   * Stubs for namefs
 764  638   */
 765  639  #ifndef NAMEFS_MODULE
 766  640          MODULE(namefs,fs);
 767      -        STUB(namefs, nm_unmountall,     0);
      641 +        STUB(namefs, nm_unmountall,     0);
 768  642          END_MODULE(namefs);
 769  643  #endif
 770  644  
 771  645  /*
 772  646   * Stubs for sysdc
 773  647   */
 774  648  #ifndef SDC_MODULE
 775  649          MODULE(SDC,sched);
 776  650          NO_UNLOAD_STUB(SDC, sysdc_thread_enter,         nomod_zero);
 777  651          END_MODULE(SDC);
↓ open down ↓ 79 lines elided ↑ open up ↑
 857  731  #ifndef CONSCONFIG_MODULE
 858  732          MODULE(consconfig,misc);
 859  733          STUB(consconfig, consconfig,    0);
 860  734          STUB(consconfig, consconfig_get_usb_kb_path,    0);
 861  735          STUB(consconfig, consconfig_get_usb_ms_path,    0);
 862  736          STUB(consconfig, consconfig_get_plat_fbpath,    0);
 863  737          STUB(consconfig, consconfig_console_is_ready,   0);
 864  738          END_MODULE(consconfig);
 865  739  #endif
 866  740  
 867      -/* 
      741 +/*
 868  742   * Stubs for accounting.
 869  743   */
 870  744  #ifndef SYSACCT_MODULE
 871  745          MODULE(sysacct,sys);
 872      -        NO_UNLOAD_WSTUB(sysacct, acct,                  nomod_zero);
 873      -        NO_UNLOAD_WSTUB(sysacct, acct_fs_in_use,        nomod_zero);
      746 +        NO_UNLOAD_WSTUB(sysacct, acct,                  nomod_zero);
      747 +        NO_UNLOAD_WSTUB(sysacct, acct_fs_in_use,        nomod_zero);
 874  748          END_MODULE(sysacct);
 875  749  #endif
 876  750  
 877  751  /*
 878  752   * Stubs for semaphore routines. sem.c
 879  753   */
 880  754  #ifndef SEMSYS_MODULE
 881  755          MODULE(semsys,sys);
 882  756          NO_UNLOAD_WSTUB(semsys, semexit,                nomod_zero);
 883  757          END_MODULE(semsys);
↓ open down ↓ 66 lines elided ↑ open up ↑
 950  824          STUB(idmap, idmap_purge_cache,          nomod_einval);
 951  825          END_MODULE(idmap);
 952  826  #endif
 953  827  
 954  828  /*
 955  829   * Stubs for auditing.
 956  830   */
 957  831  #ifndef C2AUDIT_MODULE
 958  832          MODULE(c2audit,sys);
 959  833          NO_UNLOAD_STUB(c2audit, audit_init_module,      nomod_zero);
 960      -        NO_UNLOAD_STUB(c2audit, audit_start,            nomod_zero);
      834 +        NO_UNLOAD_STUB(c2audit, audit_start,            nomod_zero);
 961  835          NO_UNLOAD_STUB(c2audit, audit_finish,           nomod_zero);
 962  836          NO_UNLOAD_STUB(c2audit, audit,                  nomod_zero);
 963  837          NO_UNLOAD_STUB(c2audit, auditdoor,              nomod_zero);
 964  838          NO_UNLOAD_STUB(c2audit, audit_closef,           nomod_zero);
 965  839          NO_UNLOAD_STUB(c2audit, audit_core_start,       nomod_zero);
 966  840          NO_UNLOAD_STUB(c2audit, audit_core_finish,      nomod_zero);
 967  841          NO_UNLOAD_STUB(c2audit, audit_strputmsg,        nomod_zero);
 968  842          NO_UNLOAD_STUB(c2audit, audit_savepath,         nomod_zero);
 969  843          NO_UNLOAD_STUB(c2audit, audit_anchorpath,       nomod_zero);
 970  844          NO_UNLOAD_STUB(c2audit, audit_exit,             nomod_zero);
↓ open down ↓ 31 lines elided ↑ open up ↑
1002  876   * Stubs for kernel rpc security service module
1003  877   */
1004  878  #ifndef RPCSEC_MODULE
1005  879          MODULE(rpcsec,misc);
1006  880          NO_UNLOAD_STUB(rpcsec, sec_clnt_revoke,         nomod_zero);
1007  881          NO_UNLOAD_STUB(rpcsec, authkern_create,         nomod_zero);
1008  882          NO_UNLOAD_STUB(rpcsec, sec_svc_msg,             nomod_zero);
1009  883          NO_UNLOAD_STUB(rpcsec, sec_svc_control,         nomod_zero);
1010  884          END_MODULE(rpcsec);
1011  885  #endif
1012      - 
      886 +
1013  887  /*
1014  888   * Stubs for rpc RPCSEC_GSS security service module
1015  889   */
1016  890  #ifndef RPCSEC_GSS_MODULE
1017  891          MODULE(rpcsec_gss,misc);
1018  892          NO_UNLOAD_STUB(rpcsec_gss, __svcrpcsec_gss,             nomod_zero);
1019  893          NO_UNLOAD_STUB(rpcsec_gss, rpc_gss_getcred,             nomod_zero);
1020  894          NO_UNLOAD_STUB(rpcsec_gss, rpc_gss_set_callback,        nomod_zero);
1021  895          NO_UNLOAD_STUB(rpcsec_gss, rpc_gss_secget,              nomod_zero);
1022  896          NO_UNLOAD_STUB(rpcsec_gss, rpc_gss_secfree,             nomod_zero);
↓ open down ↓ 76 lines elided ↑ open up ↑
1099  973          NO_UNLOAD_WSTUB(cl_bootstrap, clboot_mountroot, nomod_zero);
1100  974          NO_UNLOAD_WSTUB(cl_bootstrap, clconf_init, nomod_zero);
1101  975          NO_UNLOAD_WSTUB(cl_bootstrap, clconf_get_nodeid, nomod_zero);
1102  976          NO_UNLOAD_WSTUB(cl_bootstrap, clconf_maximum_nodeid, nomod_zero);
1103  977          NO_UNLOAD_WSTUB(cl_bootstrap, cluster, nomod_zero);
1104  978          END_MODULE(cl_bootstrap);
1105  979  #endif
1106  980  
1107  981  /*
1108  982   * Clustering: stubs for cluster infrastructure.
1109      - */     
      983 + */
1110  984  #ifndef CL_COMM_MODULE
1111  985          MODULE(cl_comm,misc);
1112  986          NO_UNLOAD_STUB(cl_comm, cladmin, nomod_minus_one);
1113  987          END_MODULE(cl_comm);
1114  988  #endif
1115  989  
1116  990  /*
1117  991   * Clustering: stubs for global file system operations.
1118  992   */
1119  993  #ifndef PXFS_MODULE
↓ open down ↓ 281 lines elided ↑ open up ↑
1401 1275          NO_UNLOAD_STUB(ksocket, ksocket_shutdown, nomod_minus_one);
1402 1276          NO_UNLOAD_STUB(ksocket, ksocket_close, nomod_minus_one);
1403 1277          END_MODULE(ksocket);
1404 1278  #endif
1405 1279  
1406 1280  /*
1407 1281   * Stubs for elfexec
1408 1282   */
1409 1283  #ifndef ELFEXEC_MODULE
1410 1284          MODULE(elfexec,exec);
1411      -        STUB(elfexec, elfexec,          nomod_einval);
     1285 +        STUB(elfexec, elfexec,          nomod_einval);
1412 1286          STUB(elfexec, mapexec_brand,    nomod_einval);
1413      -#if defined(__amd64)
1414 1287          STUB(elfexec, elf32exec,        nomod_einval);
1415 1288          STUB(elfexec, mapexec32_brand,  nomod_einval);
1416      -#endif
1417 1289          END_MODULE(elfexec);
1418 1290  #endif
1419 1291  
1420 1292  /*
1421 1293   * Stub(s) for APIX module.
1422 1294   */
1423 1295  #ifndef APIX_MODULE
1424 1296          MODULE(apix,mach);
1425 1297          WSTUB(apix, apix_loaded, nomod_zero);
1426 1298          END_MODULE(apix);
1427 1299  #endif
1428 1300  
1429      -/ this is just a marker for the area of text that contains stubs 
     1301 +/*
     1302 + * this is just a marker for the area of text that contains stubs
     1303 + */
1430 1304  
1431 1305          ENTRY_NP(stubs_end)
1432 1306          nop
1433 1307  
1434 1308  #endif  /* lint */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX