Skip to content

Commit 13bdfb5

Browse files
ubizjakbp3tk0v
authored andcommitted
x86/sgx: Use ENCLS mnemonic in <kernel/cpu/sgx/encls.h>
Current minimum required version of binutils is 2.30, which supports ENCLS instruction mnemonic. Replace the byte-wise specification of ENCLS with this proper mnemonic. No functional change intended. Signed-off-by: Uros Bizjak <ubizjak@gmail.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org> Link: https://lore.kernel.org/20250616085716.158942-1-ubizjak@gmail.com
1 parent 045f6a6 commit 13bdfb5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

arch/x86/kernel/cpu/sgx/encls.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ static inline bool encls_failed(int ret)
6868
({ \
6969
int ret; \
7070
asm volatile( \
71-
"1: .byte 0x0f, 0x01, 0xcf;\n\t" \
71+
"1: encls\n" \
7272
"2:\n" \
7373
_ASM_EXTABLE_TYPE(1b, 2b, EX_TYPE_FAULT_SGX) \
7474
: "=a"(ret) \
@@ -111,8 +111,8 @@ static inline bool encls_failed(int ret)
111111
({ \
112112
int ret; \
113113
asm volatile( \
114-
"1: .byte 0x0f, 0x01, 0xcf;\n\t" \
115-
" xor %%eax,%%eax;\n" \
114+
"1: encls\n\t" \
115+
"xor %%eax,%%eax\n" \
116116
"2:\n" \
117117
_ASM_EXTABLE_TYPE(1b, 2b, EX_TYPE_FAULT_SGX) \
118118
: "=a"(ret), "=b"(rbx_out) \

0 commit comments

Comments
 (0)