mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-11-07 04:36:52 -10:00
amd64: gate WRMSRNS immediate form on compiler support
This support was introduced in LLVM 20 and we still support releases with LLVM 19 so it's too early to require LLVM 20. Decay to the non-immediate form when the compiler it too old. This makes the ifunc pointless, but limits the need for other ifdefs. Reviewed by: kib Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D60023
This commit is contained in:
1 parent
2a717d519e
commit
53fe018630
1 file changed
+10
@@ -390,8 +390,18 @@ wrmsrns(u_int msr, uint64_t newval)
|
||||
__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))
|
||||
#else
|
||||
/*
|
||||
* When Clang does not support the immediate form of wrmsr, decay it
|
||||
* to plain wrmsr.
|
||||
*/
|
||||
#define wrmsr_imm(msr, val) \
|
||||
wrmsr((msr), (val));
|
||||
#endif
|
||||
|
||||
static __inline void
|
||||
load_cr0(u_long data)
|
||||
|
||||
Reference in new issue
Block a user