forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-11 297b60346df8beafee954a0fd7c2d64f33f3b9bc
kernel/arch/x86/kernel/cpu/proc.c
....@@ -7,6 +7,10 @@
77
88 #include "cpu.h"
99
10
+#ifdef CONFIG_X86_VMX_FEATURE_NAMES
11
+extern const char * const x86_vmx_flags[NVMXINTS*32];
12
+#endif
13
+
1014 /*
1115 * Get CPU information for use by the procfs.
1216 */
....@@ -35,11 +39,11 @@
3539 "fpu_exception\t: %s\n"
3640 "cpuid level\t: %d\n"
3741 "wp\t\t: yes\n",
38
- static_cpu_has_bug(X86_BUG_FDIV) ? "yes" : "no",
39
- static_cpu_has_bug(X86_BUG_F00F) ? "yes" : "no",
40
- static_cpu_has_bug(X86_BUG_COMA) ? "yes" : "no",
41
- static_cpu_has(X86_FEATURE_FPU) ? "yes" : "no",
42
- static_cpu_has(X86_FEATURE_FPU) ? "yes" : "no",
42
+ boot_cpu_has_bug(X86_BUG_FDIV) ? "yes" : "no",
43
+ boot_cpu_has_bug(X86_BUG_F00F) ? "yes" : "no",
44
+ boot_cpu_has_bug(X86_BUG_COMA) ? "yes" : "no",
45
+ boot_cpu_has(X86_FEATURE_FPU) ? "yes" : "no",
46
+ boot_cpu_has(X86_FEATURE_FPU) ? "yes" : "no",
4347 c->cpuid_level);
4448 }
4549 #else
....@@ -102,6 +106,17 @@
102106 if (cpu_has(c, i) && x86_cap_flags[i] != NULL)
103107 seq_printf(m, " %s", x86_cap_flags[i]);
104108
109
+#ifdef CONFIG_X86_VMX_FEATURE_NAMES
110
+ if (cpu_has(c, X86_FEATURE_VMX) && c->vmx_capability[0]) {
111
+ seq_puts(m, "\nvmx flags\t:");
112
+ for (i = 0; i < 32*NVMXINTS; i++) {
113
+ if (test_bit(i, (unsigned long *)c->vmx_capability) &&
114
+ x86_vmx_flags[i] != NULL)
115
+ seq_printf(m, " %s", x86_vmx_flags[i]);
116
+ }
117
+ }
118
+#endif
119
+
105120 seq_puts(m, "\nbugs\t\t:");
106121 for (i = 0; i < 32*NBUGINTS; i++) {
107122 unsigned int bug_bit = 32*NCAPINTS + i;