Fix objtool: missing int3 after ret warning

Resolve straight-line speculation warnings reported by objtool
for x86_64 assembly on Linux when CONFIG_SLS is set.  See the
following LWN article for the complete details.

https://lwn.net/Articles/877845/

Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #13528
Closes #13575
This commit is contained in:
Brian Behlendorf
2022-06-20 23:36:21 +00:00
parent 8aceded193
commit 43569ee374
12 changed files with 44 additions and 32 deletions
+12 -12
View File
@@ -208,7 +208,7 @@ _key_expansion_256a_local:
pxor %xmm1, %xmm0
movups %xmm0, (%rcx)
add $0x10, %rcx
ret
RET
nop
SET_SIZE(_key_expansion_128)
SET_SIZE(_key_expansion_256a)
@@ -236,7 +236,7 @@ _key_expansion_192a_local:
shufps $0b01001110, %xmm2, %xmm1
movups %xmm1, 0x10(%rcx)
add $0x20, %rcx
ret
RET
SET_SIZE(_key_expansion_192a)
@@ -257,7 +257,7 @@ _key_expansion_192b_local:
movups %xmm0, (%rcx)
add $0x10, %rcx
ret
RET
SET_SIZE(_key_expansion_192b)
@@ -271,7 +271,7 @@ _key_expansion_256b_local:
pxor %xmm1, %xmm2
movups %xmm2, (%rcx)
add $0x10, %rcx
ret
RET
SET_SIZE(_key_expansion_256b)
@@ -376,7 +376,7 @@ rijndael_key_setup_enc_intel_local:
mov $14, %rax // return # rounds = 14
#endif
FRAME_END
ret
RET
.align 4
.Lenc_key192:
@@ -413,7 +413,7 @@ rijndael_key_setup_enc_intel_local:
mov $12, %rax // return # rounds = 12
#endif
FRAME_END
ret
RET
.align 4
.Lenc_key128:
@@ -453,13 +453,13 @@ rijndael_key_setup_enc_intel_local:
mov $10, %rax // return # rounds = 10
#endif
FRAME_END
ret
RET
.Lenc_key_invalid_param:
#ifdef OPENSSL_INTERFACE
mov $-1, %rax // user key or AES key pointer is NULL
FRAME_END
ret
RET
#else
/* FALLTHROUGH */
#endif /* OPENSSL_INTERFACE */
@@ -471,7 +471,7 @@ rijndael_key_setup_enc_intel_local:
xor %rax, %rax // a key pointer is NULL or invalid keysize
#endif /* OPENSSL_INTERFACE */
FRAME_END
ret
RET
SET_SIZE(rijndael_key_setup_enc_intel)
@@ -548,7 +548,7 @@ FRAME_BEGIN
// OpenSolaris: rax = # rounds (10, 12, or 14) or 0 for error
// OpenSSL: rax = 0 for OK, or non-zero for error
FRAME_END
ret
RET
SET_SIZE(rijndael_key_setup_dec_intel)
@@ -655,7 +655,7 @@ ENTRY_NP(aes_encrypt_intel)
aesenclast %KEY, %STATE // last round
movups %STATE, (%OUTP) // output
ret
RET
SET_SIZE(aes_encrypt_intel)
@@ -738,7 +738,7 @@ ENTRY_NP(aes_decrypt_intel)
aesdeclast %KEY, %STATE // last round
movups %STATE, (%OUTP) // output
ret
RET
SET_SIZE(aes_decrypt_intel)
#endif /* lint || __lint */
+2 -2
View File
@@ -785,7 +785,7 @@ ENTRY_NP(aes_encrypt_amd64)
mov 2*8(%rsp), %rbp
mov 3*8(%rsp), %r12
add $[4*8], %rsp
ret
RET
SET_SIZE(aes_encrypt_amd64)
@@ -896,7 +896,7 @@ ENTRY_NP(aes_decrypt_amd64)
mov 2*8(%rsp), %rbp
mov 3*8(%rsp), %r12
add $[4*8], %rsp
ret
RET
SET_SIZE(aes_decrypt_amd64)
#endif /* lint || __lint */