File tree Expand file tree Collapse file tree 2 files changed +13
-23
lines changed Expand file tree Collapse file tree 2 files changed +13
-23
lines changed Original file line number Diff line number Diff line change 7
7
#![ feature( compiler_builtins) ]
8
8
#![ feature( core_intrinsics) ]
9
9
#![ feature( linkage) ]
10
+ #![ feature( asm_cfg) ]
10
11
#![ feature( naked_functions) ]
11
12
#![ feature( repr_simd) ]
12
13
#![ feature( macro_metavar_expr_concat) ]
Original file line number Diff line number Diff line change 58
58
#[ unsafe( naked) ]
59
59
#[ rustc_std_internal_symbol]
60
60
pub unsafe extern "custom" fn __rust_probestack ( ) {
61
- #[ cfg( not( all( target_env = "sgx" , target_vendor = "fortanix" ) ) ) ]
62
- macro_rules! ret {
63
- ( ) => {
64
- "ret"
65
- } ;
66
- }
67
-
68
- #[ cfg( all( target_env = "sgx" , target_vendor = "fortanix" ) ) ]
69
- macro_rules! ret {
70
- // for this target, [manually patch for LVI].
71
- //
72
- // [manually patch for LVI]: https://software.intel.com/security-software-guidance/insights/deep-dive-load-value-injection#specialinstructions
73
- ( ) => {
74
- "
75
- pop %r11
76
- lfence
77
- jmp *%r11
78
- "
79
- } ;
80
- }
81
-
82
61
core:: arch:: naked_asm!(
83
62
"
84
63
.cfi_startproc
@@ -128,8 +107,18 @@ pub unsafe extern "custom" fn __rust_probestack() {
128
107
.cfi_def_cfa_register %rsp
129
108
.cfi_adjust_cfa_offset -8
130
109
" ,
131
- ret!( ) ,
132
- "
110
+ #[ cfg( not( all( target_env = "sgx" , target_vendor = "fortanix" ) ) ) ]
111
+ " ret" ,
112
+ #[ cfg( all( target_env = "sgx" , target_vendor = "fortanix" ) ) ]
113
+ "
114
+ // for this target, [manually patch for LVI].
115
+ //
116
+ // [manually patch for LVI]: https://software.intel.com/security-software-guidance/insights/deep-dive-load-value-injection#specialinstructions
117
+ pop %r11
118
+ lfence
119
+ jmp *%r11
120
+ " ,
121
+ "
133
122
.cfi_endproc
134
123
" ,
135
124
options( att_syntax)
You can’t perform that action at this time.
0 commit comments