Print this page
*** NO COMMENTS ***

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/i86pc/os/mp_machdep.c
          +++ new/usr/src/uts/i86pc/os/mp_machdep.c
↓ open down ↓ 237 lines elided ↑ open up ↑
 238  238          switch (hw) {
 239  239          case PGHW_IPIPE:
 240  240                  if (is_x86_feature(x86_featureset, X86FSET_HTT)) {
 241  241                          /*
 242  242                           * Hyper-threading is SMT
 243  243                           */
 244  244                          return (1);
 245  245                  } else {
 246  246                          return (0);
 247  247                  }
      248 +        case PGHW_FPU:
      249 +                if (cpuid_get_cores_per_compunit(cp) > 1)
      250 +                        return (1);
      251 +                else
      252 +                        return (0);
 248  253          case PGHW_PROCNODE:
 249  254                  if (cpuid_get_procnodes_per_pkg(cp) > 1)
 250  255                          return (1);
 251  256                  else
 252  257                          return (0);
 253  258          case PGHW_CHIP:
 254  259                  if (is_x86_feature(x86_featureset, X86FSET_CMP) ||
 255  260                      is_x86_feature(x86_featureset, X86FSET_HTT))
 256  261                          return (1);
 257  262                  else
↓ open down ↓ 41 lines elided ↑ open up ↑
 299  304   * relationships
 300  305   */
 301  306  id_t
 302  307  pg_plat_hw_instance_id(cpu_t *cpu, pghw_type_t hw)
 303  308  {
 304  309          switch (hw) {
 305  310          case PGHW_IPIPE:
 306  311                  return (cpuid_get_coreid(cpu));
 307  312          case PGHW_CACHE:
 308  313                  return (cpuid_get_last_lvl_cacheid(cpu));
      314 +        case PGHW_FPU:
      315 +                return (cpuid_get_compunitid(cpu));
 309  316          case PGHW_PROCNODE:
 310  317                  return (cpuid_get_procnodeid(cpu));
 311  318          case PGHW_CHIP:
 312  319                  return (cpuid_get_chipid(cpu));
 313  320          case PGHW_POW_ACTIVE:
 314  321                  return (cpupm_domain_id(cpu, CPUPM_DTYPE_ACTIVE));
 315  322          case PGHW_POW_IDLE:
 316  323                  return (cpupm_domain_id(cpu, CPUPM_DTYPE_IDLE));
 317  324          default:
 318  325                  return (-1);
↓ open down ↓ 5 lines elided ↑ open up ↑
 324  331   * hw1 vs hw2
 325  332   */
 326  333  pghw_type_t
 327  334  pg_plat_hw_rank(pghw_type_t hw1, pghw_type_t hw2)
 328  335  {
 329  336          int i, rank1, rank2;
 330  337  
 331  338          static pghw_type_t hw_hier[] = {
 332  339                  PGHW_IPIPE,
 333  340                  PGHW_CACHE,
      341 +                PGHW_FPU,
 334  342                  PGHW_PROCNODE,
 335  343                  PGHW_CHIP,
 336  344                  PGHW_POW_IDLE,
 337  345                  PGHW_POW_ACTIVE,
 338  346                  PGHW_NUM_COMPONENTS
 339  347          };
 340  348  
 341  349          for (i = 0; hw_hier[i] != PGHW_NUM_COMPONENTS; i++) {
 342  350                  if (hw_hier[i] == hw1)
 343  351                          rank1 = i;
↓ open down ↓ 10 lines elided ↑ open up ↑
 354  362  /*
 355  363   * Override the default CMT dispatcher policy for the specified
 356  364   * hardware sharing relationship
 357  365   */
 358  366  pg_cmt_policy_t
 359  367  pg_plat_cmt_policy(pghw_type_t hw)
 360  368  {
 361  369          /*
 362  370           * For shared caches, also load balance across them to
 363  371           * maximize aggregate cache capacity
      372 +         *
      373 +         * On AMD family 0x15 CPUs, cores come in pairs called
      374 +         * compute units, sharing the FPU and the L1I and L2
      375 +         * caches. Use balancing and cache affinity.
 364  376           */
 365  377          switch (hw) {
      378 +        case PGHW_FPU:
 366  379          case PGHW_CACHE:
 367  380                  return (CMT_BALANCE|CMT_AFFINITY);
 368  381          default:
 369  382                  return (CMT_NO_POLICY);
 370  383          }
 371  384  }
 372  385  
 373  386  id_t
 374  387  pg_plat_get_core_id(cpu_t *cpu)
 375  388  {
↓ open down ↓ 1445 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX