From jdc@koitsu.org  Sat Mar 23 19:11:18 2013
Return-Path: <jdc@koitsu.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1])
	by hub.freebsd.org (Postfix) with ESMTP id DD63B3CF9
	for <freebsd-gnats-submit@freebsd.org>; Sat, 23 Mar 2013 19:11:18 +0000 (UTC)
	(envelope-from jdc@koitsu.org)
Received: from qmta11.emeryville.ca.mail.comcast.net (qmta11.emeryville.ca.mail.comcast.net [IPv6:2001:558:fe2d:44:76:96:27:211])
	by mx1.freebsd.org (Postfix) with ESMTP id C4010DB8
	for <freebsd-gnats-submit@freebsd.org>; Sat, 23 Mar 2013 19:11:18 +0000 (UTC)
Received: from omta16.emeryville.ca.mail.comcast.net ([76.96.30.72])
	by qmta11.emeryville.ca.mail.comcast.net with comcast
	id F6131l0051ZMdJ4AB7BJAY; Sat, 23 Mar 2013 19:11:18 +0000
Received: from koitsu.strangled.net ([67.180.84.87])
	by omta16.emeryville.ca.mail.comcast.net with comcast
	id F7BH1l00V1t3BNj8c7BHFU; Sat, 23 Mar 2013 19:11:18 +0000
Received: by icarus.home.lan (Postfix, from userid 1000)
	id 93D6173A1C; Sat, 23 Mar 2013 12:11:17 -0700 (PDT)
Message-Id: <20130323191117.93D6173A1C@icarus.home.lan>
Date: Sat, 23 Mar 2013 12:11:17 -0700 (PDT)
From: Jeremy Chadwick <jdc@koitsu.org>
Reply-To: Jeremy Chadwick <jdc@koitsu.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: Add more x86 CPU feature flag definitions
X-Send-Pr-Version: 3.114
X-GNATS-Notify:

>Number:         177319
>Category:       kern
>Synopsis:       [kernel] [patch] Add more x86 CPU feature flag definitions
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Sat Mar 23 19:20:02 UTC 2013
>Closed-Date:    Wed Feb 26 14:30:20 CET 2014
>Last-Modified:  Wed Feb 26 14:30:20 CET 2014
>Originator:     Jeremy Chadwick
>Release:        FreeBSD 9.1-STABLE amd64
>Organization:
>Environment:
System: FreeBSD icarus.home.lan 9.1-STABLE FreeBSD 9.1-STABLE #0 r248403: Sat Mar 16 20:33:01 PDT 2013 root@icarus.home.lan:/usr/obj/usr/src/sys/X7SBA_RELENG_9_amd64 amd64
>Description:
	While reading this thread:

	http://lists.freebsd.org/pipermail/freebsd-current/2013-March/040666.html

	It occurred to me that we might be missing some x86 CPU feature flag
	definitions in comparison to other OSes (e.g. Linux).

	My comparison source was the Linux 3.8.4 source code, specifically
	arch/x86/include/asm/cpufeature.h.  That can be viewed here:

	http://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/tree/arch/x86/include/asm/cpufeature.h?h=linux-3.8.y
>How-To-Repeat:
	n/a
>Fix:
	Apply below patch (intended for stable/9, but can be backported to head
	I'm sure).  Patch is also available here once I get a PR number:

	http://jdc.koitsu.org/freebsd/{prnum}/

	I strongly recommend someone familiar with these bits review this patch
	first, as AFAIK these are only for cosmetical representation rather than
	operational, but I could be wrong.


Index: sys/amd64/amd64/identcpu.c
===================================================================
--- sys/amd64/amd64/identcpu.c	(revision 248655)
+++ sys/amd64/amd64/identcpu.c	(working copy)
@@ -366,13 +366,13 @@ printcpuinfo(void)
 				"\017<b14>"
 				"\020LWP"	/* Lightweight Profiling */
 				"\021FMA4"	/* 4-operand FMA instructions */
-				"\022<b17>"
+				"\022TCE"	/* Translation Cache Extension */
 				"\023<b18>"
 				"\024NodeId"	/* NodeId MSR support */
 				"\025<b20>"
 				"\026TBM"	/* Trailing Bit Manipulation */
 				"\027Topology"	/* Topology Extensions */
-				"\030<b23>"
+				"\030CorePerfC"	/* Core Perf. Counter Extensions */
 				"\031<b24>"
 				"\032<b25>"
 				"\033<b26>"
@@ -390,9 +390,17 @@ printcpuinfo(void)
 				       "\020"
 				       "\001GSFSBASE"
 				       "\002TSCADJ"
+				       "\004BMI1"
+				       "\005HLE"
+				       "\006AVX2"
 				       "\010SMEP"
+				       "\011BMI2"
 				       "\012ENHMOVSB"
 				       "\013INVPCID"
+				       "\014RTM"
+				       "\023RDSEED"
+				       "\024ADX"
+				       "\025SMAP"
 				       );
 			}
 
Index: sys/i386/i386/identcpu.c
===================================================================
--- sys/i386/i386/identcpu.c	(revision 248655)
+++ sys/i386/i386/identcpu.c	(working copy)
@@ -842,13 +842,13 @@ printcpuinfo(void)
 				"\017<b14>"
 				"\020LWP"	/* Lightweight Profiling */
 				"\021FMA4"	/* 4-operand FMA instructions */
-				"\022<b17>"
+				"\022TCE"	/* Translation Cache Extension */
 				"\023<b18>"
 				"\024NodeId"	/* NodeId MSR support */
 				"\025<b20>"
 				"\026TBM"	/* Trailing Bit Manipulation */
 				"\027Topology"	/* Topology Extensions */
-				"\030<b23>"
+				"\030CorePerfC"	/* Core Perf. Counter Extensions */
 				"\031<b24>"
 				"\032<b25>"
 				"\033<b26>"
>Release-Note:
>Audit-Trail:

From: Oliver Pinter <oliver.pntr@gmail.com>
To: Jeremy Chadwick <jdc@koitsu.org>
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: kern/177319: Add more x86 CPU feature flag definitions
Date: Sun, 24 Mar 2013 00:06:09 +0100

 The cpu_stdext_feature section looks fine based on Intel Architecture
 Instruction Set Extensions Programming Reference (aug. 2012)
 319433-014.pdf.
 
Responsible-Changed-From-To: freebsd-bugs->eadler 
Responsible-Changed-By: eadler 
Responsible-Changed-When: Sat Mar 23 23:11:25 UTC 2013 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=177319 
Responsible-Changed-From-To: eadler->freebsd-bugs 
Responsible-Changed-By: eadler 
Responsible-Changed-When: Tue Jun 25 19:40:57 UTC 2013 
Responsible-Changed-Why:  
I don't have time to deal with this. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=177319 
State-Changed-From-To: open->closed 
State-Changed-By: brueffer 
State-Changed-When: Wed Feb 26 14:28:45 CET 2014 
State-Changed-Why:  
These were added in r249577 and r257856.  Thanks for the submission! 

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