Print this page
3426 assertion failed: irq < 16 on VMware hardware version 9 (apix related)
Reviewed by: Albert Lee <trisk@nexenta.com>
Reviewed by: Dan McDonald <danmcd@nexenta.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/i86pc/io/apix/apix_utils.c
          +++ new/usr/src/uts/i86pc/io/apix/apix_utils.c
↓ open down ↓ 18 lines elided ↑ open up ↑
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright (c) 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 +/*
       30 + * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
       31 + */
  29   32  
  30   33  #include <sys/processor.h>
  31   34  #include <sys/time.h>
  32   35  #include <sys/psm.h>
  33   36  #include <sys/smp_impldefs.h>
  34   37  #include <sys/cram.h>
  35   38  #include <sys/acpi/acpi.h>
  36   39  #include <sys/acpica.h>
  37   40  #include <sys/psm_common.h>
  38   41  #include <sys/pit.h>
↓ open down ↓ 1783 lines elided ↑ open up ↑
1822 1825  static void
1823 1826  ioapix_setup_intr(int irqno, iflag_t *flagp)
1824 1827  {
1825 1828          extern struct av_head autovect[];
1826 1829          apix_vector_t *vecp;
1827 1830          apic_irq_t *irqp;
1828 1831          uchar_t ioapicindex, ipin;
1829 1832          ulong_t iflag;
1830 1833          struct autovec *avp;
1831 1834  
1832      -        irqp = apic_irq_table[irqno];
1833 1835          ioapicindex = acpi_find_ioapic(irqno);
1834 1836          ASSERT(ioapicindex != 0xFF);
1835 1837          ipin = irqno - apic_io_vectbase[ioapicindex];
1836 1838  
1837      -        if ((irqp != NULL) && (irqp->airq_mps_intr_index == ACPI_INDEX)) {
     1839 +        mutex_enter(&airq_mutex);
     1840 +        irqp = apic_irq_table[irqno];
     1841 +
     1842 +        /*
     1843 +         * The irq table entry should not exist unless the interrupts are shared.
     1844 +         * In that case, make sure it matches what we would initialize it to.
     1845 +         */
     1846 +        if (irqp != NULL) {
     1847 +                ASSERT(irqp->airq_mps_intr_index == ACPI_INDEX);
1838 1848                  ASSERT(irqp->airq_intin_no == ipin &&
1839 1849                      irqp->airq_ioapicindex == ioapicindex);
1840 1850                  vecp = xv_vector(irqp->airq_cpu, irqp->airq_vector);
1841 1851                  ASSERT(!IS_VECT_FREE(vecp));
     1852 +                mutex_exit(&airq_mutex);
1842 1853          } else {
1843      -                vecp = apix_alloc_intx(NULL, 0, irqno);
     1854 +                irqp = kmem_zalloc(sizeof (apic_irq_t), KM_SLEEP);
1844 1855  
1845      -                irqp = apic_irq_table[irqno];
     1856 +                irqp->airq_cpu = IRQ_UNINIT;
     1857 +                irqp->airq_origirq = (uchar_t)irqno;
1846 1858                  irqp->airq_mps_intr_index = ACPI_INDEX;
1847 1859                  irqp->airq_ioapicindex = ioapicindex;
1848 1860                  irqp->airq_intin_no = ipin;
1849 1861                  irqp->airq_iflag = *flagp;
1850 1862                  irqp->airq_share++;
1851      -                apic_record_rdt_entry(irqp, irqno);
     1863 +
     1864 +                apic_irq_table[irqno] = irqp;
     1865 +                mutex_exit(&airq_mutex);
     1866 +
     1867 +                vecp = apix_alloc_intx(NULL, 0, irqno);
1852 1868          }
1853 1869  
1854 1870          /* copy over autovect */
1855 1871          for (avp = autovect[irqno].avh_link; avp; avp = avp->av_link)
1856 1872                  apix_insert_av(vecp, avp->av_intr_id, avp->av_vector,
1857 1873                      avp->av_intarg1, avp->av_intarg2, avp->av_ticksp,
1858 1874                      avp->av_prilevel, avp->av_dip);
1859 1875  
1860 1876          /* Program I/O APIC */
1861 1877          iflag = intr_clear();
↓ open down ↓ 43 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX