Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F173382292
D60023.id187669.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
D60023.id187669.diff
View Options
diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c
--- a/sys/amd64/amd64/machdep.c
+++ b/sys/amd64/amd64/machdep.c
@@ -1936,6 +1936,7 @@
wrmsr(MSR_MEMORY_CTL, PCPU_GET(msr_memctl) | MSR_MEMORY_CTL_SPLITLOCK);
}
+#ifdef wrmsr_imm
static void
enable_splitlock_ac_wrmsrimm(void)
{
@@ -1943,11 +1944,14 @@
wrmsr_imm(MSR_MEMORY_CTL, PCPU_GET(msr_memctl) |
MSR_MEMORY_CTL_SPLITLOCK);
}
+#endif
DEFINE_IFUNC(, void, enable_splitlock_ac, (void))
{
+#ifdef wrmsr_imm
if ((cpu_stdext_feature5 & CPUID_STDEXT5_MSR_IMM) != 0)
return (enable_splitlock_ac_wrmsrimm);
+#endif
return (enable_splitlock_ac_wrmsr);
}
@@ -1968,6 +1972,7 @@
wrmsr(MSR_MEMORY_CTL, PCPU_GET(msr_memctl) & ~MSR_MEMORY_CTL_SPLITLOCK);
}
+#ifdef wrmsr_imm
static void
disable_splitlock_ac_wrmsrimm(void)
{
@@ -1975,11 +1980,14 @@
wrmsr_imm(MSR_MEMORY_CTL, PCPU_GET(msr_memctl) &
~MSR_MEMORY_CTL_SPLITLOCK);
}
+#endif
DEFINE_IFUNC(, void, disable_splitlock_ac, (void))
{
+#ifdef wrmsr_imm
if ((cpu_stdext_feature5 & CPUID_STDEXT5_MSR_IMM) != 0)
return (disable_splitlock_ac_wrmsrimm);
+#endif
return (disable_splitlock_ac_wrmsr);
}
diff --git a/sys/amd64/include/cpufunc.h b/sys/amd64/include/cpufunc.h
--- a/sys/amd64/include/cpufunc.h
+++ b/sys/amd64/include/cpufunc.h
@@ -390,8 +390,11 @@
__asm __volatile("wrmsrns" : : "a" (low), "d" (high), "c" (msr));
}
+#if defined(__clang__) && \
+ (__clang_major__ > 20 || (__clang_major__ == 20 && __clang_minor__ >= 1))
#define wrmsr_imm(msr, val) \
__asm __volatile("wrmsrns %0, %1" : : "r" (val), "i" (msr))
+#endif
static __inline void
load_cr0(u_long data)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Sep 26, 2:27 PM (16 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
39667192
Default Alt Text
D60023.id187669.diff (1 KB)
Attached To
Mode
D60023: amd64: gate WRMSRNS immediate form on compiler support
Attached
Detach File
Event Timeline
Log In to Comment