Print this page
4806 define x2apic feature flag
4807 pcplusmp & apix should use x2apic feature flag
Reviewed by: Robert Mustacchi <rm@joyent.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/i86pc/io/pcplusmp/apic_regops.c
          +++ new/usr/src/uts/i86pc/io/pcplusmp/apic_regops.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 2009 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
  24   24   */
       25 +/*
       26 + * Copyright 2014 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
       27 + */
  25   28  
  26   29  #include <sys/cpuvar.h>
  27   30  #include <sys/psm.h>
  28   31  #include <sys/archsystm.h>
  29   32  #include <sys/apic.h>
  30   33  #include <sys/sunddi.h>
  31   34  #include <sys/ddi_impldefs.h>
  32   35  #include <sys/mach_intr.h>
  33   36  #include <sys/sysmacros.h>
  34   37  #include <sys/trap.h>
↓ open down ↓ 52 lines elided ↑ open up ↑
  87   90  
  88   91  /* The default ops is local APIC (Memory Mapped IO) */
  89   92  apic_reg_ops_t *apic_reg_ops = &local_apic_regs_ops;
  90   93  
  91   94  /*
  92   95   * APIC register ops related data sturctures and functions.
  93   96   */
  94   97  void apic_send_EOI();
  95   98  void apic_send_directed_EOI(uint32_t irq);
  96   99  
  97      -#define X2APIC_CPUID_BIT        21
  98  100  #define X2APIC_ENABLE_BIT       10
  99  101  
 100  102  /*
 101  103   * Local APIC Implementation
 102  104   */
 103  105  static uint64_t
 104  106  local_apic_read(uint32_t reg)
 105  107  {
 106  108          return ((uint32_t)apicadr[reg]);
 107  109  }
↓ open down ↓ 118 lines elided ↑ open up ↑
 226  228                          vector = apic_irq->airq_vector;
 227  229                          ioapic_write_eoi(ioapicindex, vector);
 228  230                  }
 229  231                  apic_irq = apic_irq->airq_next;
 230  232          }
 231  233  }
 232  234  
 233  235  int
 234  236  apic_detect_x2apic(void)
 235  237  {
 236      -        struct cpuid_regs cp;
 237      -
 238  238          if (x2apic_enable == 0)
 239  239                  return (0);
 240  240  
 241      -        cp.cp_eax = 1;
 242      -        (void) __cpuid_insn(&cp);
 243      -
 244      -        return ((cp.cp_ecx & (0x1 << X2APIC_CPUID_BIT)) ? 1 : 0);
      241 +        return (is_x86_feature(x86_featureset, X86FSET_X2APIC));
 245  242  }
 246  243  
 247  244  void
 248  245  apic_enable_x2apic(void)
 249  246  {
 250  247          uint64_t apic_base_msr;
 251  248  
 252  249          if (apic_local_mode() == LOCAL_X2APIC) {
 253  250                  /* BIOS apparently has enabled X2APIC */
 254  251                  if (apic_mode != LOCAL_X2APIC)
↓ open down ↓ 152 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX