Print this page
patch x2apic-x86fset
patch remove-unused-vars

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/i86pc/os/cpuid.c
          +++ new/usr/src/uts/i86pc/os/cpuid.c
↓ open down ↓ 14 lines elided ↑ open up ↑
  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 (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
  23   23   * Copyright (c) 2011 by Delphix. All rights reserved.
  24   24   * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
       25 + * Copyright 2014 Josef "Jeff" Sipek <jeffpc@josefsipek.net>
  25   26   */
  26   27  /*
  27   28   * Copyright (c) 2010, Intel Corporation.
  28   29   * All rights reserved.
  29   30   */
  30   31  /*
  31   32   * Portions Copyright 2009 Advanced Micro Devices, Inc.
  32   33   */
  33   34  /*
  34   35   * Copyright (c) 2012, Joyent, Inc. All rights reserved.
↓ open down ↓ 78 lines elided ↑ open up ↑
 113  114   * NOTE: The accessor functions (cpuid_get*) are aware of, and ASSERT upon,
 114  115   * the pass numbers.  Accordingly, changes to the pass code may require changes
 115  116   * to the accessor code.
 116  117   */
 117  118  
 118  119  uint_t x86_vendor = X86_VENDOR_IntelClone;
 119  120  uint_t x86_type = X86_TYPE_OTHER;
 120  121  uint_t x86_clflush_size = 0;
 121  122  
 122  123  uint_t pentiumpro_bug4046376;
 123      -uint_t pentiumpro_bug4064495;
 124  124  
 125  125  uchar_t x86_featureset[BT_SIZEOFMAP(NUM_X86_FEATURES)];
 126  126  
 127  127  static char *x86_feature_names[NUM_X86_FEATURES] = {
 128  128          "lgpg",
 129  129          "tsc",
 130  130          "msr",
 131  131          "mtrr",
 132  132          "pge",
 133  133          "de",
↓ open down ↓ 23 lines elided ↑ open up ↑
 157  157          "clfsh",
 158  158          "64",
 159  159          "aes",
 160  160          "pclmulqdq",
 161  161          "xsave",
 162  162          "avx",
 163  163          "vmx",
 164  164          "svm",
 165  165          "topoext",
 166  166          "f16c",
 167      -        "rdrand"
      167 +        "rdrand",
      168 +        "x2apic",
 168  169  };
 169  170  
 170  171  boolean_t
 171  172  is_x86_feature(void *featureset, uint_t feature)
 172  173  {
 173  174          ASSERT(feature < NUM_X86_FEATURES);
 174  175          return (BT_TEST((ulong_t *)featureset, feature));
 175  176  }
 176  177  
 177  178  void
↓ open down ↓ 29 lines elided ↑ open up ↑
 207  208          uint_t i;
 208  209  
 209  210          for (i = 0; i < NUM_X86_FEATURES; i++) {
 210  211                  if (is_x86_feature(featureset, i)) {
 211  212                          cmn_err(CE_CONT, "?x86_feature: %s\n",
 212  213                              x86_feature_names[i]);
 213  214                  }
 214  215          }
 215  216  }
 216  217  
 217      -uint_t enable486;
 218      -
 219  218  static size_t xsave_state_size = 0;
 220  219  uint64_t xsave_bv_all = (XFEATURE_LEGACY_FP | XFEATURE_SSE);
 221  220  boolean_t xsave_force_disable = B_FALSE;
 222  221  
 223  222  /*
 224  223   * This is set to platform type we are running on.
 225  224   */
 226  225  static int platform_type = -1;
 227  226  
 228  227  #if !defined(__xpv)
↓ open down ↓ 797 lines elided ↑ open up ↑
1026 1025  
1027 1026          cpi->cpi_pabits = cpi->cpi_vabits = 32;
1028 1027  
1029 1028          switch (cpi->cpi_vendor) {
1030 1029          case X86_VENDOR_Intel:
1031 1030                  if (cpi->cpi_family == 5)
1032 1031                          x86_type = X86_TYPE_P5;
1033 1032                  else if (IS_LEGACY_P6(cpi)) {
1034 1033                          x86_type = X86_TYPE_P6;
1035 1034                          pentiumpro_bug4046376 = 1;
1036      -                        pentiumpro_bug4064495 = 1;
1037 1035                          /*
1038 1036                           * Clear the SEP bit when it was set erroneously
1039 1037                           */
1040 1038                          if (cpi->cpi_model < 3 && cpi->cpi_step < 3)
1041 1039                                  cp->cp_edx &= ~CPUID_INTC_EDX_SEP;
1042 1040                  } else if (IS_NEW_F6(cpi) || cpi->cpi_family == 0xf) {
1043 1041                          x86_type = X86_TYPE_P4;
1044 1042                          /*
1045 1043                           * We don't currently depend on any of the %ecx
1046 1044                           * features until Prescott, so we'll only check
↓ open down ↓ 261 lines elided ↑ open up ↑
1308 1306                          if (cp->cp_ecx & CPUID_INTC_ECX_AVX) {
1309 1307                                  add_x86_feature(featureset,
1310 1308                                      X86FSET_AVX);
1311 1309  
1312 1310                                  if (cp->cp_ecx & CPUID_INTC_ECX_F16C)
1313 1311                                          add_x86_feature(featureset,
1314 1312                                              X86FSET_F16C);
1315 1313                          }
1316 1314                  }
1317 1315          }
     1316 +        if (cp->cp_ecx & CPUID_INTC_ECX_X2APIC) {
     1317 +                add_x86_feature(featureset, X86FSET_X2APIC);
     1318 +        }
1318 1319          if (cp->cp_edx & CPUID_INTC_EDX_DE) {
1319 1320                  add_x86_feature(featureset, X86FSET_DE);
1320 1321          }
1321 1322  #if !defined(__xpv)
1322 1323          if (cp->cp_ecx & CPUID_INTC_ECX_MON) {
1323 1324  
1324 1325                  /*
1325 1326                   * We require the CLFLUSH instruction for erratum workaround
1326 1327                   * to use MONITOR/MWAIT.
1327 1328                   */
↓ open down ↓ 3437 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX