Module Name: src
Committed By: msaitoh
Date: Wed Nov 16 13:15:26 UTC 2022
Modified Files:
src/usr.sbin/cpuctl/arch: i386.c
Log Message:
Print AMD RAS features and Instruction-Based Sampling features.
To generate a diff of this commit:
cvs rdiff -u -r1.128 -r1.129 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.128 src/usr.sbin/cpuctl/arch/i386.c:1.129
--- src/usr.sbin/cpuctl/arch/i386.c:1.128 Wed Jun 15 16:28:01 2022
+++ src/usr.sbin/cpuctl/arch/i386.c Wed Nov 16 13:15:26 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: i386.c,v 1.128 2022/06/15 16:28:01 msaitoh Exp $ */
+/* $NetBSD: i386.c,v 1.129 2022/11/16 13:15:26 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.128 2022/06/15 16:28:01 msaitoh Exp $");
+__RCSID("$NetBSD: i386.c,v 1.129 2022/11/16 13:15:26 msaitoh Exp $");
#endif /* not lint */
#include <sys/types.h>
@@ -2232,6 +2232,11 @@ identifycpu(int fd, const char *cpuname)
}
if (cpu_vendor == CPUVENDOR_AMD) {
+ if (ci->ci_max_ext_cpuid >= 0x80000007) {
+ x86_cpuid(0x80000007, descs);
+ print_bits(cpuname, "RAS features",
+ CPUID_RAS_FLAGS, descs[1]);
+ }
if ((ci->ci_max_ext_cpuid >= 0x8000000a)
&& (ci->ci_feat_val[3] & CPUID_SVM) != 0) {
x86_cpuid(0x8000000a, descs);
@@ -2242,6 +2247,12 @@ identifycpu(int fd, const char *cpuname)
print_bits(cpuname, "SVM features",
CPUID_AMD_SVM_FLAGS, descs[3]);
}
+ if (ci->ci_max_ext_cpuid >= 0x8000001b) {
+ x86_cpuid(0x8000001b, descs);
+ print_bits(cpuname,
+ "Instruction-Based Sampling features",
+ CPUID_IBS_FLAGS, descs[0]);
+ }
if (ci->ci_max_ext_cpuid >= 0x8000001f) {
x86_cpuid(0x8000001f, descs);
print_bits(cpuname, "Encrypted Memory features",