mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-23 04:34:11 +08: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 <ubizjak@gmail.com> Signed-off-by: Borislav Petkov <bp@suse.de> Link: https://lkml.kernel.org/r/20200707174722.58651-1-ubizjak@gmail.com
This commit is contained in:
parent
bf9c912f9a
commit
8610981399
@ -602,9 +602,7 @@ static inline u64 xgetbv(u32 index)
|
||||
{
|
||||
u32 eax, edx;
|
||||
|
||||
asm volatile(".byte 0x0f,0x01,0xd0" /* xgetbv */
|
||||
: "=a" (eax), "=d" (edx)
|
||||
: "c" (index));
|
||||
asm volatile("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;
|
||||
|
||||
asm volatile(".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 */
|
||||
|
Loading…
Reference in New Issue
Block a user