Print this page
OS-7125 Need mitigation of L1TF (CVE-2018-3646)
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/sys/cpuvar.h
          +++ new/usr/src/uts/common/sys/cpuvar.h
↓ 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  /*
  23   23   * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
  24   24   * Copyright (c) 2012 by Delphix. All rights reserved.
  25   25   * Copyright 2014 Igor Kozhukhov <ikozhukhov@gmail.com>.
       26 + * Copyright 2018 Joyent, Inc.
  26   27   * Copyright 2017 RackTop Systems.
  27   28   */
  28   29  
  29   30  #ifndef _SYS_CPUVAR_H
  30   31  #define _SYS_CPUVAR_H
  31   32  
  32   33  #include <sys/thread.h>
  33   34  #include <sys/sysinfo.h>        /* has cpu_stat_t definition */
  34   35  #include <sys/disp.h>
  35   36  #include <sys/processor.h>
↓ open down ↓ 529 lines elided ↑ open up ↑
 565  566  extern processorid_t    max_cpu_seqid_ever;     /* maximum seqid ever given */
 566  567  
 567  568  #if defined(__i386) || defined(__amd64)
 568  569  extern struct cpu *curcpup(void);
 569  570  #define CPU             (curcpup())     /* Pointer to current CPU */
 570  571  #else
 571  572  #define CPU             (curthread->t_cpu)      /* Pointer to current CPU */
 572  573  #endif
 573  574  
 574  575  /*
 575      - * CPU_CURRENT indicates to thread_affinity_set to use CPU->cpu_id
 576      - * as the target and to grab cpu_lock instead of requiring the caller
 577      - * to grab it.
      576 + * CPU_CURRENT indicates to thread_affinity_set() to use whatever curthread's
      577 + * current CPU is; holding cpu_lock is not required.
 578  578   */
 579  579  #define CPU_CURRENT     -3
 580  580  
 581  581  /*
      582 + * CPU_BEST can be used by thread_affinity_set() callers to set affinity to a
      583 + * good CPU (in particular, an ht_acquire()-friendly choice); holding cpu_lock
      584 + * is not required.
      585 + */
      586 +#define CPU_BEST        -4
      587 +
      588 +/*
 582  589   * Per-CPU statistics
 583  590   *
 584  591   * cpu_stats_t contains numerous system and VM-related statistics, in the form
 585  592   * of gauges or monotonically-increasing event occurrence counts.
 586  593   */
 587  594  
 588  595  #define CPU_STATS_ENTER_K()     kpreempt_disable()
 589  596  #define CPU_STATS_EXIT_K()      kpreempt_enable()
 590  597  
 591  598  #define CPU_STATS_ADD_K(class, stat, amount) \
↓ open down ↓ 243 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX