Print this page
9578 HVM fails assertion in opteron_get_nnodes() with a Opteron 6262 HE CPU on the host system

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/i86pc/os/mp_startup.c
          +++ new/usr/src/uts/i86pc/os/mp_startup.c
↓ open down ↓ 20 lines elided ↑ open up ↑
  21   21  
  22   22  /*
  23   23   * Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved.
  24   24   */
  25   25  /*
  26   26   * Copyright (c) 2010, Intel Corporation.
  27   27   * All rights reserved.
  28   28   */
  29   29  /*
  30   30   * Copyright 2018 Joyent, Inc.
  31      - * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
       31 + * Copyright 2018 Nexenta Systems, Inc.
  32   32   * Copyright 2018 OmniOS Community Edition (OmniOSce) Association.
  33   33   */
  34   34  
  35   35  #include <sys/types.h>
  36   36  #include <sys/thread.h>
  37   37  #include <sys/cpuvar.h>
  38   38  #include <sys/cpu.h>
  39   39  #include <sys/t_lock.h>
  40   40  #include <sys/param.h>
  41   41  #include <sys/proc.h>
↓ open down ↓ 670 lines elided ↑ open up ↑
 712  712  }
 713  713  
 714  714  static void
 715  715  msr_warning(cpu_t *cp, const char *rw, uint_t msr, int error)
 716  716  {
 717  717          cmn_err(CE_WARN, "cpu%d: couldn't %smsr 0x%x, error %d",
 718  718              cp->cpu_id, rw, msr, error);
 719  719  }
 720  720  
 721  721  /*
 722      - * Determine the number of nodes in a Hammer / Greyhound / Griffin family
 723      - * system.
      722 + * Determine the number of nodes in a system.
      723 + *
      724 + * This routine uses a PCI config space based mechanism
      725 + * for retrieving the number of nodes in the system.
      726 + *
      727 + * Current processor families that support this mechanism are
      728 + * 0xf, 0x10, 0x11, and 0x15.
 724  729   */
 725  730  static uint_t
 726  731  opteron_get_nnodes(void)
 727  732  {
 728  733          static uint_t nnodes = 0;
 729  734  
 730      -        if (nnodes == 0) {
 731      -#ifdef  DEBUG
 732      -                uint_t family;
 733      -
 734      -                /*
 735      -                 * This routine uses a PCI config space based mechanism
 736      -                 * for retrieving the number of nodes in the system.
 737      -                 * Device 24, function 0, offset 0x60 as used here is not
 738      -                 * AMD processor architectural, and may not work on processor
 739      -                 * families other than those listed below.
 740      -                 *
 741      -                 * Callers of this routine must ensure that we're running on
 742      -                 * a processor which supports this mechanism.
 743      -                 * The assertion below is meant to catch calls on unsupported
 744      -                 * processors.
 745      -                 */
 746      -                family = cpuid_getfamily(CPU);
 747      -                ASSERT(family == 0xf || family == 0x10 || family == 0x11);
 748      -#endif  /* DEBUG */
 749      -
 750      -                /*
 751      -                 * Obtain the number of nodes in the system from
 752      -                 * bits [6:4] of the Node ID register on node 0.
 753      -                 *
 754      -                 * The actual node count is NodeID[6:4] + 1
 755      -                 *
 756      -                 * The Node ID register is accessed via function 0,
 757      -                 * offset 0x60. Node 0 is device 24.
 758      -                 */
      735 +        /*
      736 +         * Obtain the number of nodes in the system from
      737 +         * bits [6:4] of the Node ID register on node 0.
      738 +         *
      739 +         * The actual node count is NodeID[6:4] + 1
      740 +         *
      741 +         * The Node ID register is accessed via function 0,
      742 +         * offset 0x60. Node 0 is device 24.
      743 +         */
      744 +        if (nnodes == 0)
 759  745                  nnodes = ((pci_getl_func(0, 24, 0, 0x60) & 0x70) >> 4) + 1;
 760      -        }
      746 +
 761  747          return (nnodes);
 762  748  }
 763  749  
 764  750  uint_t
 765  751  do_erratum_298(struct cpu *cpu)
 766  752  {
 767  753          static int      osvwrc = -3;
 768  754          extern int      osvw_opteron_erratum(cpu_t *, uint_t);
 769  755  
 770  756          /*
↓ open down ↓ 1353 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX