From nobody@FreeBSD.org  Sat Apr 28 17:04:00 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B141B106566C
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 28 Apr 2012 17:04:00 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 9D34B8FC0A
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 28 Apr 2012 17:04:00 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q3SH40uR025903
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 28 Apr 2012 17:04:00 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q3SH405a025873;
	Sat, 28 Apr 2012 17:04:00 GMT
	(envelope-from nobody)
Message-Id: <201204281704.q3SH405a025873@red.freebsd.org>
Date: Sat, 28 Apr 2012 17:04:00 GMT
From: Dave Vasilevsky <dave@vasilevsky.ca>
To: freebsd-gnats-submit@FreeBSD.org
Subject: MacBook4,1 hangs on SMP boot
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         167393
>Category:       amd64
>Synopsis:       [boot] MacBook4,1 hangs on SMP boot
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-amd64
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Apr 28 17:10:04 UTC 2012
>Closed-Date:    
>Last-Modified:  Sat Apr 28 20:34:20 UTC 2012
>Originator:     Dave Vasilevsky
>Release:        9.0-RELEASE
>Organization:
>Environment:
FreeBSD anzio 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Tue Jan  3 07:46:30 UTC 2012     root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64

>Description:
Kernel hangs early in boot just after printing "ACPI APIC Table: <APPLE Apple00>", and a few seconds later starts printing something so quickly I can't read it. Boot process does not continue.

This sounds similar to bug 151385, but it's hard to tell if it's the same, and that bug is with an older kernel.

>How-To-Repeat:
Start up a MacBook4,1 from the FreeBSD-9.0-RELEASE-amd64-dvd1 DVD, observe that boot hangs and doesn't continue. Booting from an already installed FreeBSD 9.0 system will also produce this bug.

>Fix:
Turning off SMP (setting kern.smp.disabled=1 in loader) causes the bug to go away. This is how I was able to test an installed system. Losing use of the second CPU is non-optimal, though.

Alternatively, patching sys/amd64/amd64/machdep.c to add MacBook4,1 to the LEGACY_USB_EN blacklist makes the bug go away too. I haven't noticed any negative side effects. However, if I boot using grub2 instead of loader(8), the bug still manifests, even with this patch.


Patch attached with submission follows:

--- sys/amd64/amd64/machdep.c.bak	2012-04-22 08:54:09.236707582 -0400
+++ sys/amd64/amd64/machdep.c	2012-04-22 08:54:33.477730871 -0400
@@ -225,6 +225,7 @@
 	if (sysenv != NULL) {
 		if (strncmp(sysenv, "MacBook1,1", 10) == 0 ||
 		    strncmp(sysenv, "MacBook3,1", 10) == 0 ||
+		    strncmp(sysenv, "MacBook4,1", 10) == 0 ||
 		    strncmp(sysenv, "MacBookPro1,1", 13) == 0 ||
 		    strncmp(sysenv, "MacBookPro1,2", 13) == 0 ||
 		    strncmp(sysenv, "MacBookPro3,1", 13) == 0 ||


>Release-Note:
>Audit-Trail:
>Unformatted:
