157 * r_rsp
158 * r_rfl
159 * r_cs
160 * r_rip <-- %rsp + 24
161 * r_err <-- %rsp + 16
162 * r_trapno <-- %rsp + 8
163 * (low address) %r11 <-- %rsp
164 */
165 leaq sys_sysenter(%rip), %r11
166 cmpq %r11, 24(%rsp) /* Compare to saved r_rip on the stack */
167 je 1f
168 leaq brand_sys_sysenter(%rip), %r11
169 cmpq %r11, 24(%rsp) /* Compare to saved r_rip on the stack */
170 je 1f
171 leaq tr_sys_sysenter(%rip), %r11
172 cmpq %r11, 24(%rsp)
173 je 1f
174 leaq tr_brand_sys_sysenter(%rip), %r11
175 cmpq %r11, 24(%rsp)
176 jne 2f
177 1: SWAPGS
178 2: popq %r11
179 #endif /* !__xpv */
180
181 INTR_PUSH
182 #if defined(__xpv)
183 movl $6, %edi
184 call kdi_dreg_get
185 movq %rax, %r15 /* %db6 -> %r15 */
186 movl $6, %edi
187 movl $0, %esi
188 call kdi_dreg_set /* 0 -> %db6 */
189 #else
190 movq %db6, %r15
191 xorl %eax, %eax
192 movq %rax, %db6
193 #endif
194
195 #elif defined(__i386)
196
197 INTR_PUSH
198 #if defined(__xpv)
|
157 * r_rsp
158 * r_rfl
159 * r_cs
160 * r_rip <-- %rsp + 24
161 * r_err <-- %rsp + 16
162 * r_trapno <-- %rsp + 8
163 * (low address) %r11 <-- %rsp
164 */
165 leaq sys_sysenter(%rip), %r11
166 cmpq %r11, 24(%rsp) /* Compare to saved r_rip on the stack */
167 je 1f
168 leaq brand_sys_sysenter(%rip), %r11
169 cmpq %r11, 24(%rsp) /* Compare to saved r_rip on the stack */
170 je 1f
171 leaq tr_sys_sysenter(%rip), %r11
172 cmpq %r11, 24(%rsp)
173 je 1f
174 leaq tr_brand_sys_sysenter(%rip), %r11
175 cmpq %r11, 24(%rsp)
176 jne 2f
177 1: swapgs
178 2: lfence /* swapgs mitigation */
179 popq %r11
180 #endif /* !__xpv */
181
182 INTR_PUSH
183 #if defined(__xpv)
184 movl $6, %edi
185 call kdi_dreg_get
186 movq %rax, %r15 /* %db6 -> %r15 */
187 movl $6, %edi
188 movl $0, %esi
189 call kdi_dreg_set /* 0 -> %db6 */
190 #else
191 movq %db6, %r15
192 xorl %eax, %eax
193 movq %rax, %db6
194 #endif
195
196 #elif defined(__i386)
197
198 INTR_PUSH
199 #if defined(__xpv)
|