Print this page
3605 Xen HVM hangs during boot if apix is enabled

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/i86pc/io/apix/apix.c
          +++ new/usr/src/uts/i86pc/io/apix/apix.c
↓ open down ↓ 106 lines elided ↑ open up ↑
 107  107  static apix_vector_t *apix_get_req_vector(ddi_intr_handle_impl_t *, ushort_t);
 108  108  static int apix_get_intr_info(ddi_intr_handle_impl_t *, apic_get_intr_t *);
 109  109  static char *apix_get_apic_type(void);
 110  110  static int apix_intx_get_pending(int);
 111  111  static void apix_intx_set_mask(int irqno);
 112  112  static void apix_intx_clear_mask(int irqno);
 113  113  static int apix_intx_get_shared(int irqno);
 114  114  static void apix_intx_set_shared(int irqno, int delta);
 115  115  static apix_vector_t *apix_intx_xlate_vector(dev_info_t *, int,
 116  116      struct intrspec *);
 117      -static int apix_intx_alloc_vector(dev_info_t *, int, struct intrspec *);
      117 +static int apix_intx_alloc_vector(dev_info_t *, ddi_intr_handle_impl_t *,
      118 +    struct intrspec *);
 118  119  
 119  120  extern int apic_clkinit(int);
 120  121  
 121  122  /* IRM initialization for APIX PSM module */
 122  123  extern void apix_irm_init(void);
 123  124  
 124  125  extern int irm_enable;
 125  126  
 126  127  /*
 127  128   *      Local static data
↓ open down ↓ 126 lines elided ↑ open up ↑
 254  255  }
 255  256  
 256  257  static int
 257  258  apix_probe()
 258  259  {
 259  260          int rval;
 260  261  
 261  262          if (apix_enable == 0)
 262  263                  return (PSM_FAILURE);
 263  264  
 264      -        /*
 265      -         * FIXME Temporarily disable apix module on Xen HVM platform due to
 266      -         * known hang during boot (see #3605).
 267      -         *
 268      -         * Please remove when/if the issue is resolved.
 269      -         */
 270      -        if (get_hwenv() == HW_XEN_HVM)
 271      -                return (PSM_FAILURE);
 272      -
 273  265          /* check for hw features if specified  */
 274  266          if (apix_hw_chk_enable) {
 275  267                  /* check if x2APIC mode is supported */
 276  268                  if ((apix_supported_hw & APIX_SUPPORT_X2APIC) ==
 277  269                      APIX_SUPPORT_X2APIC) {
 278  270                          if (apic_local_mode() == LOCAL_X2APIC) {
 279  271                                  /* x2APIC mode activated by BIOS, switch ops */
 280  272                                  apic_mode = LOCAL_X2APIC;
 281  273                                  apic_change_ops();
 282  274                          } else if (!apic_detect_x2apic()) {
↓ open down ↓ 894 lines elided ↑ open up ↑
1177 1169                          *result = apix_alloc_msix(dip, hdlp->ih_inum,
1178 1170                              hdlp->ih_scratch1,
1179 1171                              (int)(uintptr_t)hdlp->ih_scratch2);
1180 1172                          break;
1181 1173                  case DDI_INTR_TYPE_FIXED:
1182 1174                          /* allocate or share vector for fixed */
1183 1175                          if ((ihdl_plat_t *)hdlp->ih_private == NULL) {
1184 1176                                  return (PSM_FAILURE);
1185 1177                          }
1186 1178                          ispec = ((ihdl_plat_t *)hdlp->ih_private)->ip_ispecp;
1187      -                        *result = apix_intx_alloc_vector(dip, hdlp->ih_inum,
1188      -                            ispec);
     1179 +                        *result = apix_intx_alloc_vector(dip, hdlp, ispec);
1189 1180                          break;
1190 1181                  default:
1191 1182                          return (PSM_FAILURE);
1192 1183                  }
1193 1184                  break;
1194 1185          case PSM_INTR_OP_FREE_VECTORS:
1195 1186                  apix_free_vectors(dip, hdlp->ih_inum, hdlp->ih_scratch1,
1196 1187                      hdlp->ih_type);
1197 1188                  break;
1198 1189          case PSM_INTR_OP_XLATE_VECTOR:
↓ open down ↓ 1317 lines elided ↑ open up ↑
2516 2507                  mutex_exit(&airq_mutex);
2517 2508                  return (-1);
2518 2509          }
2519 2510  done:
2520 2511          ASSERT(apic_irq_table[newirq]);
2521 2512          mutex_exit(&airq_mutex);
2522 2513          return (newirq);
2523 2514  }
2524 2515  
2525 2516  static int
2526      -apix_intx_alloc_vector(dev_info_t *dip, int inum, struct intrspec *ispec)
     2517 +apix_intx_alloc_vector(dev_info_t *dip, ddi_intr_handle_impl_t *hdlp,
     2518 +    struct intrspec *ispec)
2527 2519  {
2528 2520          int irqno;
2529 2521          apix_vector_t *vecp;
2530 2522  
2531      -        if ((irqno = apix_intx_xlate_irq(dip, inum, ispec)) == -1)
     2523 +        if ((irqno = apix_intx_xlate_irq(dip, hdlp->ih_inum, ispec)) == -1)
2532 2524                  return (0);
2533 2525  
2534      -        if ((vecp = apix_alloc_intx(dip, inum, irqno)) == NULL)
     2526 +        if ((vecp = apix_alloc_intx(dip, hdlp->ih_inum, irqno)) == NULL)
2535 2527                  return (0);
2536 2528  
     2529 +        hdlp->ih_irq = irqno;
     2530 +
2537 2531          DDI_INTR_IMPLDBG((CE_CONT, "apix_intx_alloc_vector: dip=0x%p name=%s "
2538 2532              "irqno=0x%x cpuid=%d vector=0x%x\n",
2539 2533              (void *)dip, ddi_driver_name(dip), irqno,
2540 2534              vecp->v_cpuid, vecp->v_vector));
2541 2535  
2542 2536          return (1);
2543 2537  }
2544 2538  
2545 2539  /*
2546 2540   * Return the vector number if the translated IRQ for this device
↓ open down ↓ 64 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX