@@ -107,9 +107,6 @@ ENTRY(entry_SYSENTER_compat)
xorl %r15d, %r15d /* nospec r15 */
cld
- IBRS_ENTER
- CLEAR_BRANCH_HISTORY
-
/*
* SYSENTER doesn't filter flags, so we need to clear NT and AC
* ourselves. To save a few cycles, we can check whether
@@ -139,6 +136,15 @@ ENTRY(entry_SYSENTER_compat)
*/
TRACE_IRQS_OFF
+ /*
+ * CPU bugs mitigations mechanisms can call other functions. They
+ * should be invoked after making sure TF is cleared because
+ * single-step is ignored only for instructions inside the
+ * entry_SYSENTER_compat function.
+ */
+ IBRS_ENTER
+ CLEAR_BRANCH_HISTORY
+
movq %rsp, %rdi
call do_fast_syscall_32
/* XEN PV guests always use IRET path */