Skip to content

Commit 8610981

Browse files
ubizjaksuryasaimadhu
authored andcommitted
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 <ubizjak@gmail.com> Signed-off-by: Borislav Petkov <bp@suse.de> Link: https://lkml.kernel.org/r/20200707174722.58651-1-ubizjak@gmail.com
1 parent bf9c912 commit 8610981

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

arch/x86/include/asm/fpu/internal.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -602,9 +602,7 @@ static inline u64 xgetbv(u32 index)
602602
{
603603
u32 eax, edx;
604604

605-
asm volatile(".byte 0x0f,0x01,0xd0" /* xgetbv */
606-
: "=a" (eax), "=d" (edx)
607-
: "c" (index));
605+
asm volatile("xgetbv" : "=a" (eax), "=d" (edx) : "c" (index));
608606
return eax + ((u64)edx << 32);
609607
}
610608

@@ -613,8 +611,7 @@ static inline void xsetbv(u32 index, u64 value)
613611
u32 eax = value;
614612
u32 edx = value >> 32;
615613

616-
asm volatile(".byte 0x0f,0x01,0xd1" /* xsetbv */
617-
: : "a" (eax), "d" (edx), "c" (index));
614+
asm volatile("xsetbv" :: "a" (eax), "d" (edx), "c" (index));
618615
}
619616

620617
#endif /* _ASM_X86_FPU_INTERNAL_H */

0 commit comments

Comments
 (0)