Print this page
10924 Need mitigation of L1TF (CVE-2018-3646)
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: Peter Tribble <peter.tribble@gmail.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/os/lgrp.c
          +++ new/usr/src/uts/common/os/lgrp.c
↓ 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 2009 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
       24 + * Copyright 2018 Joyent, Inc.
  24   25   */
  25   26  
  26   27  /*
  27   28   * Basic NUMA support in terms of locality groups
  28   29   *
  29   30   * Solaris needs to know which CPUs, memory, etc. are near each other to
  30   31   * provide good performance on NUMA machines by optimizing for locality.
  31   32   * In order to do this, a new abstraction called a "locality group (lgroup)"
  32   33   * has been introduced to keep track of which CPU-like and memory-like hardware
  33   34   * resources are close to each other.  Currently, latency is the only measure
↓ open down ↓ 49 lines elided ↑ open up ↑
  83   84  #include <vm/as.h>
  84   85  #include <sys/atomic.h>
  85   86  #include <sys/systm.h>
  86   87  #include <sys/errno.h>
  87   88  #include <sys/cmn_err.h>
  88   89  #include <sys/kstat.h>
  89   90  #include <sys/sysmacros.h>
  90   91  #include <sys/pg.h>
  91   92  #include <sys/promif.h>
  92   93  #include <sys/sdt.h>
       94 +#include <sys/ht.h>
  93   95  
  94   96  lgrp_gen_t      lgrp_gen = 0;           /* generation of lgroup hierarchy */
  95   97  lgrp_t *lgrp_table[NLGRPS_MAX]; /* table of all initialized lgrp_t structs */
  96   98                                  /* indexed by lgrp_id */
  97   99  int     nlgrps;                 /* number of lgroups in machine */
  98  100  int     lgrp_alloc_hint = -1;   /* hint for where to try to allocate next */
  99  101  int     lgrp_alloc_max = 0;     /* max lgroup ID allocated so far */
 100  102  
 101  103  /*
 102  104   * Kstat data for lgroups.
↓ open down ↓ 410 lines elided ↑ open up ↑
 513  515  
 514  516  /*
 515  517   * Finish lgrp initialization after all CPUS are brought on-line.
 516  518   * This routine is called after start_other_cpus().
 517  519   */
 518  520  static void
 519  521  lgrp_main_mp_init(void)
 520  522  {
 521  523          klgrpset_t changed;
 522  524  
      525 +        ht_init();
      526 +
 523  527          /*
 524  528           * Update lgroup topology (if necessary)
 525  529           */
 526  530          klgrpset_clear(changed);
 527  531          (void) lgrp_topo_update(lgrp_table, lgrp_alloc_max + 1, &changed);
 528  532          lgrp_topo_initialized = 1;
 529  533  }
 530  534  
 531  535  /*
 532  536   * Change latency of lgroup with specified lgroup platform handle (if one is
↓ open down ↓ 3909 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX