Print this page
11859 need swapgs mitigation
Reviewed by: Robert Mustacchi <rm@fingolfin.org>
Reviewed by: Dan McDonald <danmcd@joyent.com>
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: Robert Mustacchi <rm@fingolfin.org>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/intel/amd64/ml/amd64.il
          +++ new/usr/src/uts/intel/amd64/ml/amd64.il
↓ open down ↓ 15 lines elided ↑ open up ↑
  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 2009 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
  24   24   */
  25   25  
       26 +/*
       27 + * Copyright 2019 Joyent, Inc.
       28 + */
       29 +
  26   30  /
  27   31  / In-line functions for amd64 kernels.
  28   32  /
  29   33  
  30   34  /
  31   35  / return current thread pointer
  32   36  /
  33   37  / NOTE: the "0x18" should be replaced by the computed value of the
  34   38  /       offset of "cpu_thread" from the beginning of the struct cpu.
  35   39  /       Including "assym.h" does not work, however, since that stuff
↓ open down ↓ 146 lines elided ↑ open up ↑
 182  186          .end
 183  187  
 184  188          .inline __set_fs, 0
 185  189          movw    %di, %fs
 186  190          .end
 187  191  
 188  192          .inline __set_gs, 0
 189  193          movw    %di, %gs
 190  194          .end
 191  195  
 192      -        /*
 193      -         * OPTERON_ERRATUM_88 requires mfence
 194      -         */
 195      -        .inline __swapgs, 0
 196      -        mfence
 197      -        swapgs
 198      -        .end
 199      -
 200  196  /*
 201  197   * prefetch 64 bytes
 202  198   */
 203  199  
 204      -        .inline prefetch_read_many,8
      200 +        .inline prefetch_read_many,8
 205  201          prefetcht0      (%rdi)
 206  202          prefetcht0      32(%rdi)
 207  203          .end
 208  204  
 209      -        .inline prefetch_read_once,8
      205 +        .inline prefetch_read_once,8
 210  206          prefetchnta     (%rdi)
 211  207          prefetchnta     32(%rdi)
 212  208          .end
 213  209  
 214      -        .inline prefetch_write_many,8
      210 +        .inline prefetch_write_many,8
 215  211          prefetcht0      (%rdi)
 216  212          prefetcht0      32(%rdi)
 217  213          .end
 218  214  
 219      -        .inline prefetch_write_once,8
      215 +        .inline prefetch_write_once,8
 220  216          prefetcht0      (%rdi)
 221  217          prefetcht0      32(%rdi)
 222  218          .end
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX