From nobody@FreeBSD.org  Sun Jul  9 12:27:28 2006
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 3FAEF16A4DE
	for <freebsd-gnats-submit@FreeBSD.org>; Sun,  9 Jul 2006 12:27:28 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id EC9EC43D4C
	for <freebsd-gnats-submit@FreeBSD.org>; Sun,  9 Jul 2006 12:27:27 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id k69CRRLh014968
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 9 Jul 2006 12:27:27 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id k69CRRDN014965;
	Sun, 9 Jul 2006 12:27:27 GMT
	(envelope-from nobody)
Message-Id: <200607091227.k69CRRDN014965@www.freebsd.org>
Date: Sun, 9 Jul 2006 12:27:27 GMT
From: Franois Charlier <fcharlier@ploup.net>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Via Padlock ACE support not detected for via C7 (Esther) processor
X-Send-Pr-Version: www-2.3

>Number:         99959
>Category:       i386
>Synopsis:       Via Padlock ACE support not detected for via C7 (Esther) processor
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-i386
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jul 09 12:30:12 GMT 2006
>Closed-Date:    Thu Jul 13 09:25:36 GMT 2006
>Last-Modified:  Thu Jul 13 09:25:36 GMT 2006
>Originator:     Franois Charlier
>Release:        6.1
>Organization:
>Environment:
FreeBSD loin.ploup.net 6.1-STABLE FreeBSD 6.1-STABLE #0: Sun Jul  9 02:09:00 CEST 2006     naz@loin.ploup.net:/usr/obj/usr/src/sys/DEDIBOX  i386
>Description:
Via Padlock ACE support is not detected vor via Esther (C5J) and maybe Ruth (C5Q) processors. Loading the padlock module returns :
  PADLOCK: No ACE support.

The Via Padlock Programming Guide (http://www.via.com.tw/en/downloads/whitepapers/initiatives/padlock/programming_guide.pdf) specifies on page 5 that "Centaur Extended Features Flags are supported" "if CPUID with EAX = 0xC0000000 returns EAX >= 0xC0000001". However, the file src/sys/crypto/via/padlock.c does the following test in function padlock_init(void) [line 167 in 6.1-STABLE] :
  if (regs[0] == 0xc0000001) {
which is wrong and should be changed to :
  if (regs[0] >= 0xc0000001) {


>How-To-Repeat:
kldload padlock.ko
on a machine with a C7 processor
>Fix:
Follow the programming guide and modify src/sys/crypto/via/padlock.c in function padlock_init(void) [line 167 in 6.1-STABLE] from :
  if (regs[0] == 0xc0000001) {
to :
  if (regs[0] >= 0xc0000001) {

>Release-Note:
>Audit-Trail:

From: =?ISO-8859-1?Q?Fran=E7ois_Charlier?= <fcharlier@ploup.net>
To: bug-followup@FreeBSD.org, fcharlier@ploup.net
Cc:  
Subject: Re: i386/99959: Via Padlock ACE support not detected for via C7 (Esther)
 processor
Date: Sun, 09 Jul 2006 14:43:52 +0200

 The patch can be found here : 
 http://nazgull.ath.cx/pub/patches/padlock.c.patch
 -- 
 Franois Charlier
State-Changed-From-To: open->closed 
State-Changed-By: mr 
State-Changed-When: Thu Jul 13 09:22:28 UTC 2006 
State-Changed-Why:  
A similar patch got into i386/i386/initcpu.c 
padlock(4) and random(4) now use this aproach. 
The special probing in padlock(4) and random(4) is not needed 
any longer. 

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