From nobody@FreeBSD.org  Thu Jan  8 15:40:34 2009
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 C06651065670
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  8 Jan 2009 15:40:34 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id AECBF8FC0C
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  8 Jan 2009 15:40:34 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n08FeYHB055355
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 8 Jan 2009 15:40:34 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id n08FeYW3055354;
	Thu, 8 Jan 2009 15:40:34 GMT
	(envelope-from nobody)
Message-Id: <200901081540.n08FeYW3055354@www.freebsd.org>
Date: Thu, 8 Jan 2009 15:40:34 GMT
From: Koen Smits <kgysmits@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: FreeBSD 7.1-RELEASE amd64 cannot boot on VIA Nano equipped systems
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         130303
>Category:       amd64
>Synopsis:       [boot] [patch] FreeBSD 7.1-RELEASE amd64 cannot boot on VIA Nano equipped systems
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    jkim
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jan 08 15:50:01 UTC 2009
>Closed-Date:    Mon Jan 12 16:31:42 UTC 2009
>Last-Modified:  Mon Jan 12 16:31:42 UTC 2009
>Originator:     Koen Smits
>Release:        7.1-RELEASE
>Organization:
>Environment:
>Description:
boot loader checks if the 64bit CPU is Intel or AMD, obviously VIA is neither of them. boot process reports "CPU does not support long mode" and asks for kernel.

See simple patch below.
Maybe this check should not be performed at all?
Note that VIA CPU's allow you to change the vendorstring. This could lead to more trouble.
>How-To-Repeat:
Boot 7.1-RELEASE Disc1 on VIA Nano equipped system. (VIA VB8001 for example)
>Fix:
/usr/src/sys/boot/i386/libi386/bootinfo64.c:

Line 152+:
        !           152:     /* Check for vendors that support AMD features. */
        !           153:     if (strncmp(cpu_vendor, "GenuineIntel", 12) != 0 &&
        !           154:        strncmp(cpu_vendor, "AuthenticAMD", 12) != 0)
        !           155:        return (0);

change to:

    /* Check for vendors that support AMD features. */
    if (strncmp(cpu_vendor, "GenuineIntel", 12) != 0 &&
	strncmp(cpu_vendor, "AuthenticAMD", 12) != 0 &&
	strncmp(cpu_vendor, "CentaurHauls", 12) != 0)
	return (0);


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-amd64->jkim 
Responsible-Changed-By: jkim 
Responsible-Changed-When: Mon Jan 12 16:23:21 UTC 2009 
Responsible-Changed-Why:  
I will take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=130303 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: amd64/130303: commit references a PR
Date: Mon, 12 Jan 2009 16:28:39 +0000 (UTC)

 Author: jkim
 Date: Mon Jan 12 16:28:19 2009
 New Revision: 187101
 URL: http://svn.freebsd.org/changeset/base/187101
 
 Log:
   Allow VIA Nano processors to boot FreeBSD/amd64.
   
   PR:		amd64/130303
   MFC after:	1 week
 
 Modified:
   head/sys/boot/i386/libi386/bootinfo64.c
 
 Modified: head/sys/boot/i386/libi386/bootinfo64.c
 ==============================================================================
 --- head/sys/boot/i386/libi386/bootinfo64.c	Mon Jan 12 16:07:03 2009	(r187100)
 +++ head/sys/boot/i386/libi386/bootinfo64.c	Mon Jan 12 16:28:19 2009	(r187101)
 @@ -150,8 +150,9 @@ bi_checkcpu(void)
      cpu_vendor = (char *)vendor;
  
      /* Check for vendors that support AMD features. */
 -    if (strncmp(cpu_vendor, "GenuineIntel", 12) != 0 &&
 -	strncmp(cpu_vendor, "AuthenticAMD", 12) != 0)
 +    if (strncmp(cpu_vendor, INTEL_VENDOR_ID, 12) != 0 &&
 +	strncmp(cpu_vendor, AMD_VENDOR_ID, 12) != 0 &&
 +	strncmp(cpu_vendor, CENTAUR_VENDOR_ID, 12) != 0)
  	return (0);
  
      /* Has to support AMD features. */
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->closed 
State-Changed-By: jkim 
State-Changed-When: Mon Jan 12 16:30:23 UTC 2009 
State-Changed-Why:  
Fix committed on HEAD with a slight style change.  Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=130303 
>Unformatted:
