From owner-freebsd-ports-bugs@FreeBSD.ORG Tue May 28 20:30:00 2013 Return-Path: Delivered-To: freebsd-ports-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C0F9D680 for ; Tue, 28 May 2013 20:30:00 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id A28CA3E2 for ; Tue, 28 May 2013 20:30:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id r4SKU0J9024449 for ; Tue, 28 May 2013 20:30:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id r4SKU0Nu024448; Tue, 28 May 2013 20:30:00 GMT (envelope-from gnats) Resent-Date: Tue, 28 May 2013 20:30:00 GMT Resent-Message-Id: <201305282030.r4SKU0Nu024448@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Arthur Mesh Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8ECE6364 for ; Tue, 28 May 2013 20:23:56 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from oldred.FreeBSD.org (oldred.freebsd.org [8.8.178.121]) by mx1.freebsd.org (Postfix) with ESMTP id 80C2B35A for ; Tue, 28 May 2013 20:23:56 +0000 (UTC) Received: from oldred.FreeBSD.org ([127.0.1.6]) by oldred.FreeBSD.org (8.14.5/8.14.5) with ESMTP id r4SKNuE6049657 for ; Tue, 28 May 2013 20:23:56 GMT (envelope-from nobody@oldred.FreeBSD.org) Received: (from nobody@localhost) by oldred.FreeBSD.org (8.14.5/8.14.5/Submit) id r4SKNumf049656; Tue, 28 May 2013 20:23:56 GMT (envelope-from nobody) Message-Id: <201305282023.r4SKNumf049656@oldred.FreeBSD.org> Date: Tue, 28 May 2013 20:23:56 GMT From: Arthur Mesh To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: ports/179065: Add RDRAND/F16C support to misc/cpuid X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2013 20:30:00 -0000 >Number: 179065 >Category: ports >Synopsis: Add RDRAND/F16C support to misc/cpuid >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Tue May 28 20:30:00 UTC 2013 >Closed-Date: >Last-Modified: >Originator: Arthur Mesh >Release: 9-stable >Organization: Juniper Networks >Environment: >Description: Upstream doesn't seem to be active. Hence, adding this to local patch >How-To-Repeat: unpatched: $ cpuid Feature flags set 2: 7f9ae3bf: AVX AVX extensions 29 - unknown feature 30 - unknown featur patched on a system that has RDRAND/F16C: $ cpuid Feature flags set 2: 7f9ae3bf: AVX AVX extensions F16C Half-precision conversions RDRAND RDRAND Instruction >Fix: see attached Patch attached with submission follows: Index: misc/cpuid/files/patch-cpuid.c =================================================================== --- misc/cpuid/files/patch-cpuid.c (revision 319319) +++ misc/cpuid/files/patch-cpuid.c (working copy) @@ -1,5 +1,5 @@ ---- cpuid.c -+++ cpuid.c +--- ./cpuid.c.orig 2002-01-01 22:14:51.000000000 -0800 ++++ ./cpuid.c 2013-05-28 13:14:27.000000000 -0700 @@ -3,34 +3,56 @@ * Updated 24 Apr 2001 to latest Intel CPUID spec * Updated 22 Dec 2001 to decode Intel flag 28, hyper threading @@ -45,8 +45,8 @@ + "Mobile Intel Pentium III processor-M", + "Mobile Intel Celeron processor", + /* 8 */ ++ "Intel Pentium 4 processor", "Intel Pentium 4 processor", -+ "Intel Pentium 4 processor", + "Intel Celeron processor", + "Intel Xeon processor", + "Intel Xeon processor MP", @@ -65,7 +65,7 @@ }; #define cpuid(in,a,b,c,d)\ -@@ -89,7 +110,7 @@ +@@ -89,7 +111,7 @@ exit(0); } @@ -74,7 +74,7 @@ "FPU Floating Point Unit", "VME Virtual 8086 Mode Enhancements", "DE Debugging Extensions", -@@ -121,7 +142,64 @@ +@@ -121,7 +143,66 @@ "HT Hyper Threading", "TM Thermal monitor", "30 reserved", @@ -112,7 +112,9 @@ + "XSAVE XSAVE/XSTOR states", + "OSXSAVE OS-enabled extended state managerment", + "AVX AVX extensions", -+ NULL, NULL, NULL ++ "F16C Half-precision conversions", ++ "RDRAND RDRAND Instruction", ++ NULL +}; + +char *Intel_ext_feature_flags[32] = { @@ -140,7 +142,7 @@ }; /* Intel-specific information */ -@@ -131,22 +209,31 @@ +@@ -131,22 +212,31 @@ if(maxi >= 1){ /* Family/model/type etc */ int clf,apic_id,feature_flags; @@ -179,7 +181,7 @@ printf("Type %d - ",type); switch(type){ -@@ -183,10 +270,6 @@ +@@ -183,10 +273,6 @@ printf("Pentium 4"); } printf("\n"); @@ -190,7 +192,7 @@ printf("Model %d - ",model); switch(family){ case 3: -@@ -253,33 +336,72 @@ +@@ -253,33 +339,72 @@ case 8: printf("Pentium III/Pentium III Xeon - internal L2 cache"); break; @@ -270,7 +272,7 @@ if(maxe >= 0x80000004){ int i; -@@ -303,12 +425,48 @@ +@@ -303,12 +428,48 @@ printf("Hyper threading siblings: %d\n",siblings); } @@ -320,7 +322,7 @@ printf("\n"); } if(maxi >= 2){ -@@ -396,18 +554,66 @@ +@@ -396,18 +557,66 @@ case 0x4: printf("Data TLB: 4MB pages, 4-way set assoc, 8 entries\n"); break; @@ -387,7 +389,7 @@ case 0x40: printf("No 2nd-level cache, or if 2nd-level cache exists, no 3rd-level cache\n"); break; -@@ -426,23 +632,67 @@ +@@ -426,23 +635,67 @@ case 0x45: printf("2nd-level cache: 2MB, 4-way set assoc, 32 byte line size\n"); break; @@ -461,7 +463,7 @@ break; case 0x66: printf("1st-level data cache: 8KB, 4-way set assoc, 64 byte line size\n"); -@@ -454,25 +704,37 @@ +@@ -454,25 +707,37 @@ printf("1st-level data cache: 32KB, 4-way set assoc, 64 byte line size\n"); break; case 0x70: @@ -504,7 +506,7 @@ break; case 0x82: printf("2nd-level cache: 256KB, 8-way set assoc, 32 byte line size\n"); -@@ -486,44 +748,189 @@ +@@ -486,44 +751,189 @@ case 0x85: printf("2nd-level cache: 2MB, 8-way set assoc, 32 byte line size\n"); break; @@ -726,7 +728,7 @@ }; char *Assoc[] = { -@@ -657,10 +1064,16 @@ +@@ -657,10 +1067,16 @@ printf("Global Paging Extensions\n"); } else { if(edx & (1<Release-Note: >Audit-Trail: >Unformatted: