Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177649530
D61639.1794944611.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
3 KB
Referenced Files
None
Subscribers
None
D61639.1794944611.diff
View Options
diff --git a/sys/x86/include/specialreg.h b/sys/x86/include/specialreg.h
--- a/sys/x86/include/specialreg.h
+++ b/sys/x86/include/specialreg.h
@@ -489,6 +489,39 @@
#define AMDID_RDPRU_SHIFT 16
#define AMDID_RDPRU_ID 0xffff0000
+/*
+ * AMD extended function 8000_0021h eax info (amd_extended_feature2)
+ */
+#define AMDFE2_NO_NESTED_DATA_BP 0x00000001
+#define AMDFE2_FSGSKGSBASE_NS 0x00000002
+#define AMDFE2_LFENCE_SERIALIZE 0x00000004
+#define AMDFE2_SMM_PGCFG_LOCK 0x00000008
+#define AMDFE2_TLBSYNC_SFW_NO 0x00000010
+#define AMDFE2_VERW_CLEAR 0x00000020
+#define AMDFE2_NULL_SEL_CLR_BASE 0x00000040
+#define AMDFE2_UAI 0x00000080
+#define AMDFE2_AUTOIBRS 0x00000100
+#define AMDFE2_NO_SMM_CTL_MSR 0x00000200
+#define AMDFE2_L2TLB_SIZE_X32 0x00004000
+#define AMDFE2_CPUID_USER_DIS 0x00020000
+#define AMDFE2_PREFETCHI 0x00100000
+#define AMDFE2_WORKLOAD_CLASS 0x00400000
+#define AMDFE2_AVX512_BMM 0x00800000
+#define AMDFE2_ERAPS 0x01000000
+#define AMDFE2_SBPB 0x08000000
+#define AMDFE2_IBPB_BRTYPE 0x10000000
+#define AMDFE2_SRSO_NO 0x20000000
+#define AMDFE2_SRSO_USER_KERNEL_NO 0x40000000
+#define AMDFE2_SRSO_BP_SPEC_REDUCE 0x80000000
+
+/*
+ * AMD extended function 8000_0021h ecx info (amd_extended_feature2_ecx)
+ */
+#define AMDFE2_ECX_TSA_SQ_NO 0x00000002
+#define AMDFE2_ECX_TSA_L1_NO 0x00000004
+#define AMDFE2_ECX_TSA_FILL_NO 0x00000080
+#define AMDFE2_ECX_BTB_CTX_ISOLATION 0x00000100
+
/*
* CPUID instruction 7 Structured Extended Features, leaf 0 ebx info
*/
diff --git a/sys/x86/include/x86_var.h b/sys/x86/include/x86_var.h
--- a/sys/x86/include/x86_var.h
+++ b/sys/x86/include/x86_var.h
@@ -44,6 +44,8 @@
extern u_int amd_rascap;
extern u_int amd_pminfo;
extern u_int amd_extended_feature_extensions;
+extern u_int amd_extended_feature2;
+extern u_int amd_extended_feature2_ecx;
extern u_int via_feature_rng;
extern u_int via_feature_xcrypt;
extern u_int cpu_clflush_line_size;
diff --git a/sys/x86/x86/identcpu.c b/sys/x86/x86/identcpu.c
--- a/sys/x86/x86/identcpu.c
+++ b/sys/x86/x86/identcpu.c
@@ -100,6 +100,8 @@
u_int amd_rascap; /* AMD RAS capabilities */
u_int amd_pminfo; /* AMD advanced power management info */
u_int amd_extended_feature_extensions;
+u_int amd_extended_feature2; /* AMD 8000_0021h eax */
+u_int amd_extended_feature2_ecx; /* AMD 8000_0021h ecx */
u_int via_feature_rng; /* VIA RNG features */
u_int via_feature_xcrypt; /* VIA ACE features */
u_int cpu_high; /* Highest arg to CPUID */
@@ -1146,6 +1148,47 @@
);
}
+ if (amd_extended_feature2 != 0) {
+ printf("\n "
+ "AMD Extended Feature 2 ID EAX=0x%b",
+ amd_extended_feature2,
+ "\020"
+ "\001NoNestedDataBP"
+ "\002FsGsKernelGsBaseNS"
+ "\003LFenceSerialize"
+ "\004SmmPgCfgLock"
+ "\005TLBSYNC_SFW_NO"
+ "\006VERW_CLEAR"
+ "\007NullSelClrBase"
+ "\010UAI"
+ "\011AutoIBRS"
+ "\012NoSmmCtlMSR"
+ "\017L2TlbSizeX32"
+ "\022CpuidUserDis"
+ "\025PrefetchI"
+ "\027WorkloadClass"
+ "\030AVX512_BMM"
+ "\031ERAPS"
+ "\034SBPB"
+ "\035IBPB_BRTYPE"
+ "\036SRSO_NO"
+ "\037SRSO_USER_KERNEL_NO"
+ "\040SRSO_BP_SPEC_REDUCE"
+ );
+ }
+
+ if (amd_extended_feature2_ecx != 0) {
+ printf("\n "
+ "AMD Extended Feature 2 ID ECX=0x%b",
+ amd_extended_feature2_ecx,
+ "\020"
+ "\002TSA_SQ_NO"
+ "\003TSA_L1_NO"
+ "\010TSA_FILL_NO"
+ "\011BTB_CTX_ISOLATION"
+ );
+ }
+
if (via_feature_rng != 0 || via_feature_xcrypt != 0)
print_via_padlock_info();
@@ -1718,6 +1761,11 @@
} else {
cpu_maxphyaddr = (cpu_feature & CPUID_PAE) != 0 ? 36 : 32;
}
+ if (cpu_exthigh >= 0x80000021) {
+ do_cpuid(0x80000021, regs);
+ amd_extended_feature2 = regs[0];
+ amd_extended_feature2_ecx = regs[2];
+ }
#ifdef __i386__
if (cpu_vendor_id == CPU_VENDOR_CYRIX) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 17, 7:43 PM (22 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41806174
Default Alt Text
D61639.1794944611.diff (3 KB)
Attached To
Mode
D61639: x86: decode AMD CPUID leaf 0x80000021
Attached
Detach File
Event Timeline