Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F109373767
D35555.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D35555.diff
View Options
diff --git a/sys/amd64/amd64/initcpu.c b/sys/amd64/amd64/initcpu.c
--- a/sys/amd64/amd64/initcpu.c
+++ b/sys/amd64/amd64/initcpu.c
@@ -292,6 +292,9 @@
cr4 |= CR4_SMAP;
}
load_cr4(cr4);
+ /* Reload cpu ext features to reflect cr4 changes */
+ if (IS_BSP())
+ identify_cpu_ext_features();
if (IS_BSP() && (amd_feature & AMDID_NX) != 0) {
msr = rdmsr(MSR_EFER) | EFER_NXE;
wrmsr(MSR_EFER, msr);
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
@@ -128,6 +128,7 @@
void finishidentcpu(void);
void identify_cpu1(void);
void identify_cpu2(void);
+void identify_cpu_ext_features(void);
void identify_cpu_fixup_bsp(void);
void identify_hypervisor(void);
void initializecpu(void);
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
@@ -1608,6 +1608,18 @@
}
}
+void
+identify_cpu_ext_features(void)
+{
+ u_int regs[4];
+
+ if (cpu_high >= 7) {
+ cpuid_count(7, 0, regs);
+ cpu_stdext_feature2 = regs[2];
+ cpu_stdext_feature3 = regs[3];
+ }
+}
+
void
identify_cpu_fixup_bsp(void)
{
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Feb 5, 5:41 AM (21 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16468207
Default Alt Text
D35555.diff (1 KB)
Attached To
Mode
D35555: amd64: Reload cpu ext features after resume or cr4 changes
Attached
Detach File
Event Timeline
Log In to Comment