x86/cpu: Use XGETBV and XSETBV mnemonics in fpu/internal.h
PATCH 1/1 x86/cpu: Use XGETBV and XSETBV mnemonics in fpu/internal.h
Current minimum required version of binutils is 2.23, which supports XGETBV and XSETBV instruction mnemonics.
Replace the byte-wise specification of XGETBV and
XSETBV with these proper mnemonics.
Signed-off-by Uros Bizjak <[email protected]>
--- arch/x86/include/asm/fpu/internal.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
arch/x86/include/asm/fpu/internal.h +2 -5
@@ -636,9 +636,7 @@ static inline u64 xgetbv(u32 index) {u32 eax, edx; - asmvolatile (".byte 0x0f,0x01,0xd0" /* xgetbv */ - :"=a" (eax),"=d" (edx) - :"c" (index)); + asmvolatile ("xgetbv" :"=a" (eax),"=d" (edx) :"c" (index));return eax + ((u64 )edx <<32 ); }
@@ -647,8 +645,7 @@ static inline void xsetbv(u32 index, u64 value)u32 eax = value;u32 edx = value >>32 ; - asmvolatile (".byte 0x0f,0x01,0xd1" /* xsetbv */ - : : "a" (eax), "d" (edx), "c" (index)); + asm volatile("xsetbv" :: "a" (eax), "d" (edx), "c" (index)); }#endif /* _ASM_X86_FPU_INTERNAL_H */
Signature · 1 line
2.26.2
The following commit has been merged into the x86/cpu branch of tip:
The following commit has been merged into the x86/cpu branch of tip:
Commit-ID: 86109813990b5d6d6cfb8072382ee69d11ea9460 Gitweb: https://git.kernel.org/tip/86109813990b5d6d6cfb8072382ee69d11ea9460 Author: Uros Bizjak <[email protected]> AuthorDate: Tue, 07 Jul 2020 19:47:22 +02:00 Committer: Borislav Petkov <[email protected]> CommitterDate: Tue, 18 Aug 2020 15:49:07 +02:00
x86/cpu: Use XGETBV and XSETBV mnemonics in fpu/internal.h
Current minimum required version of binutils is 2.23, which supports XGETBV and XSETBV instruction mnemonics.
Replace the byte-wise specification of XGETBV and XSETBV with these proper mnemonics.
Signed-off-by Uros Bizjak <[email protected]>
Signed-off-by Borislav Petkov <[email protected]>
--- arch/x86/include/asm/fpu/internal.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
arch/x86/include/asm/fpu/internal.h +2 -5
@@ -602,9 +602,7 @@ static inline u64 xgetbv(u32 index) {u32 eax, edx; - asmvolatile (".byte 0x0f,0x01,0xd0" /* xgetbv */ - :"=a" (eax),"=d" (edx) - :"c" (index)); + asmvolatile ("xgetbv" :"=a" (eax),"=d" (edx) :"c" (index));return eax + ((u64 )edx <<32 ); }
@@ -613,8 +611,7 @@ static inline void xsetbv(u32 index, u64 value)u32 eax = value;u32 edx = value >>32 ; - asmvolatile (".byte 0x0f,0x01,0xd1" /* xsetbv */ - : : "a" (eax), "d" (edx), "c" (index)); + asm volatile("xsetbv" :: "a" (eax), "d" (edx), "c" (index)); }#endif /* _ASM_X86_FPU_INTERNAL_H */