Module Name:    src
Committed By:   msaitoh
Date:           Sat Oct 19 06:36:38 UTC 2024

Modified Files:
        src/usr.sbin/cpuctl/arch: i386.c

Log Message:
cpuctl(8): Print AMD's hetero workload classification.


To generate a diff of this commit:
cvs rdiff -u -r1.144 -r1.145 src/usr.sbin/cpuctl/arch/i386.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/cpuctl/arch/i386.c
diff -u src/usr.sbin/cpuctl/arch/i386.c:1.144 src/usr.sbin/cpuctl/arch/i386.c:1.145
--- src/usr.sbin/cpuctl/arch/i386.c:1.144	Fri Mar  8 20:29:17 2024
+++ src/usr.sbin/cpuctl/arch/i386.c	Sat Oct 19 06:36:38 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: i386.c,v 1.144 2024/03/08 20:29:17 rillig Exp $	*/
+/*	$NetBSD: i386.c,v 1.145 2024/10/19 06:36:38 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: i386.c,v 1.144 2024/03/08 20:29:17 rillig Exp $");
+__RCSID("$NetBSD: i386.c,v 1.145 2024/10/19 06:36:38 msaitoh Exp $");
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -2304,6 +2304,14 @@ identifycpu(int fd, const char *cpuname)
 			aprint_verbose("%s: Perfmon: LBR Stack %hhu entries\n",
 			    cpuname, nlbrs);
 		}
+		if (ci->ci_max_ext_cpuid >= 0x80000027) {
+			uint8_t classes;
+
+			x86_cpuid(0x80000027, descs);
+			classes = __SHIFTOUT(descs[0], CPUID_HWC_NWC);
+			aprint_verbose("%s: Hetero workload class: "
+			    "%hhu classes\n", cpuname, classes);
+		}
 	} else if (cpu_vendor == CPUVENDOR_INTEL) {
 		if (ci->ci_max_cpuid >= 0x0a) {
 			unsigned int pmcver, ncounter, veclen;

Reply via email to