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/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   * Copyright 2019 Joyent, Inc.
  28   29   */
  29   30  
  30   31  #ifndef _SYS_CPUVAR_H
  31   32  #define _SYS_CPUVAR_H
  32   33  
  33   34  #include <sys/thread.h>
  34   35  #include <sys/sysinfo.h>        /* has cpu_stat_t definition */
  35   36  #include <sys/disp.h>
↓ open down ↓ 486 lines elided ↑ open up ↑
 522  523  extern processorid_t    max_cpu_seqid_ever;     /* maximum seqid ever given */
 523  524  
 524  525  #if defined(__i386) || defined(__amd64)
 525  526  extern struct cpu *curcpup(void);
 526  527  #define CPU             (curcpup())     /* Pointer to current CPU */
 527  528  #else
 528  529  #define CPU             (curthread->t_cpu)      /* Pointer to current CPU */
 529  530  #endif
 530  531  
 531  532  /*
 532      - * CPU_CURRENT indicates to thread_affinity_set to use CPU->cpu_id
 533      - * as the target and to grab cpu_lock instead of requiring the caller
 534      - * to grab it.
      533 + * CPU_CURRENT indicates to thread_affinity_set() to use whatever curthread's
      534 + * current CPU is; holding cpu_lock is not required.
 535  535   */
 536  536  #define CPU_CURRENT     -3
 537  537  
 538  538  /*
      539 + * CPU_BEST can be used by thread_affinity_set() callers to set affinity to a
      540 + * good CPU (in particular, an ht_acquire()-friendly choice); holding cpu_lock
      541 + * is not required.
      542 + */
      543 +#define CPU_BEST        -4
      544 +
      545 +/*
 539  546   * Per-CPU statistics
 540  547   *
 541  548   * cpu_stats_t contains numerous system and VM-related statistics, in the form
 542  549   * of gauges or monotonically-increasing event occurrence counts.
 543  550   */
 544  551  
 545  552  #define CPU_STATS_ENTER_K()     kpreempt_disable()
 546  553  #define CPU_STATS_EXIT_K()      kpreempt_enable()
 547  554  
 548  555  #define CPU_STATS_ADD_K(class, stat, amount) \
↓ open down ↓ 249 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX