File tree 1 file changed +19
-3
lines changed
1 file changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -109,8 +109,22 @@ macro_rules! define_rust_probestack {
109
109
//
110
110
// The ABI here is that the stack frame size is located in `%rax`. Upon
111
111
// return we're not supposed to modify `%rsp` or `%rax`.
112
+ #[ cfg( all(
113
+ target_arch = "x86_64" ,
114
+ not( all( target_env = "sgx" , target_vendor = "fortanix" ) )
115
+ ) ) ]
116
+ macro_rules! ret ( ( ) => ( "ret" ) ) ;
117
+ #[ cfg( all(
118
+ target_arch = "x86_64" ,
119
+ all( target_env = "sgx" , target_vendor = "fortanix" )
120
+ ) ) ]
121
+ macro_rules! ret ( ( ) => ( "
122
+ pop %r11
123
+ lfence
124
+ jmp *%r11
125
+ " ) ) ;
112
126
#[ cfg( target_arch = "x86_64" ) ]
113
- global_asm ! ( define_rust_probestack!(
127
+ global_asm ! ( define_rust_probestack!( concat! (
114
128
"
115
129
.cfi_startproc
116
130
pushq %rbp
@@ -158,10 +172,12 @@ global_asm!(define_rust_probestack!(
158
172
leave
159
173
.cfi_def_cfa_register %rsp
160
174
.cfi_adjust_cfa_offset -8
161
- ret
175
+ " ,
176
+ ret!( ) ,
177
+ "
162
178
.cfi_endproc
163
179
"
164
- ) ) ;
180
+ ) ) ) ;
165
181
166
182
#[ cfg( target_arch = "x86" ) ]
167
183
// This is the same as x86_64 above, only translated for 32-bit sizes. Note
You can’t perform that action at this time.
0 commit comments