--- old/usr/src/uts/i86pc/io/isa.c Tue Jun 2 03:58:21 2009 +++ new/usr/src/uts/i86pc/io/isa.c Tue Jun 2 03:58:20 2009 @@ -46,6 +46,7 @@ #include #include #include +#include #if defined(__xpv) #include #include @@ -1094,15 +1095,6 @@ /* serial ports */ for (i = 0; i < 2; i++) { -#if defined(__xpv) - /* - * the hypervisor may be reserving the serial ports for console - * and/or debug use. Probe the irqs to see if they are - * available. - */ - if (ec_probe_pirq(asy_intrs[i]) == 0) - continue; /* in use */ -#endif ndi_devi_alloc_sleep(isa_dip, "asy", (pnode_t)DEVI_SID_NODEID, &xdip); (void) ndi_prop_update_int_array(DDI_DEV_T_NONE, xdip, @@ -1217,47 +1209,41 @@ isa_extra_count++; } } -#if defined(__xpv) + /* - * Check each serial port to see if it is in use by the hypervisor. - * If it is in use, then remove the node from the device tree. + * An asy node may have been attached via ACPI enumeration, or + * directly from this file. Check each serial port to see if it + * is in use by the hypervisor. If it is in use, then remove + * the node from the device tree. */ +#if defined(__xpv) i = 0; + for (xdip = ddi_get_child(isa_dip); xdip != NULL; ) { - int asy_intr; + extern int console_hypervisor_device; dev_info_t *curdip; curdip = xdip; xdip = ddi_get_next_sibling(xdip); - if (strncmp(ddi_node_name(curdip), "asy", 3) != 0) { - /* skip non asy */ - continue; - } - /* - * Check if the hypervisor is using the serial port by probing - * the irq and if it is using it remove the node - * from the device tree - */ - asy_intr = ddi_prop_get_int(DDI_DEV_T_ANY, curdip, - DDI_PROP_DONTPASS, "interrupts", -1); - if (asy_intr == -1) { - /* error */ - continue; - } - if (ec_probe_pirq(asy_intr)) { + if (strncmp(ddi_node_name(curdip), "asy", 3) != 0) continue; - } - ret = ndi_devi_free(curdip); - if (ret != DDI_SUCCESS) - cmn_err(CE_WARN, - "could not remove asy%d node", i); - else + + if ((i == 0 && console_hypervisor_device == CONS_TTYA) || + (i == 1 && console_hypervisor_device == CONS_TTYB)) { + ret = ndi_devi_free(curdip); + if (ret != DDI_SUCCESS) { + cmn_err(CE_WARN, + "could not remove asy%d node", i); + } + cmn_err(CE_NOTE, "!asy%d unavailable, reserved" - " to hypervisor", i); + " to hypervisor", i); + } + i++; } -#endif /* __xpv */ +#endif psm_unmap((caddr_t)bios_data, size); }