changeset 11075:e1d25eb89954

6898998 fastreboot provokes panic on Dell PowerEdge 1600SC (BIOS A09) after integration of CR 6472670
author Dana Myers <Dana.Myers@Sun.COM>
date Tue, 17 Nov 2009 08:00:02 -0800
parents 1bd0128fd072
children 445f05f9f7b4
files usr/src/cmd/halt/smf/boot-config.xml usr/src/uts/intel/io/pci/pci_boot.c
diffstat 2 files changed, 20 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/cmd/halt/smf/boot-config.xml	Tue Nov 17 11:08:43 2009 -0500
+++ b/usr/src/cmd/halt/smf/boot-config.xml	Tue Nov 17 08:00:02 2009 -0800
@@ -108,6 +108,7 @@
 			<value_node value='VMware Virtual Platform' />
 			<value_node value='MCP55' />
 			<value_node value='Precision WorkStation 650    ' />
+			<value_node value='PowerEdge 1600SC           ' />
 		    </astring_list>
 		</property>
 	</property_group>
--- a/usr/src/uts/intel/io/pci/pci_boot.c	Tue Nov 17 11:08:43 2009 -0500
+++ b/usr/src/uts/intel/io/pci/pci_boot.c	Tue Nov 17 08:00:02 2009 -0800
@@ -186,6 +186,7 @@
 	ACPI_BUFFER	rb;
 	ACPI_OBJECT	ro;
 	ACPI_DEVICE_INFO *adi;
+	int		busnum;
 
 	/*
 	 * Use AcpiGetObjectInfo() to find the device _HID
@@ -224,10 +225,24 @@
 	rb.Length = sizeof (ro);
 	if (ACPI_SUCCESS(AcpiEvaluateObjectTyped(hdl, "_BBN",
 	    NULL, &rb, ACPI_TYPE_INTEGER))) {
-		/* PCI with _BBN, process it, go no deeper */
-		if (pci_bus_res[ro.Integer.Value].par_bus == (uchar_t)-1 &&
-		    pci_bus_res[ro.Integer.Value].dip == NULL)
-			create_root_bus_dip((uchar_t)ro.Integer.Value);
+		busnum = ro.Integer.Value;
+
+		/*
+		 * Ignore invalid _BBN return values here (rather
+		 * than panic) and emit a warning; something else
+		 * may suffer failure as a result of the broken BIOS.
+		 */
+		if ((busnum < 0) || (busnum > pci_bios_maxbus)) {
+			cmn_err(CE_WARN,
+			    "pci_process_acpi_device: invalid _BBN 0x%x\n",
+			    busnum);
+			return (AE_CTRL_DEPTH);
+		}
+
+		/* PCI with valid _BBN */
+		if (pci_bus_res[busnum].par_bus == (uchar_t)-1 &&
+		    pci_bus_res[busnum].dip == NULL)
+			create_root_bus_dip((uchar_t)busnum);
 		return (AE_CTRL_DEPTH);
 	}