RESTORE_IBRS_CLOBBER executes after we have already switched
to the USER_CR3. This blows up because RESTORE_IBRS_CLOBBER
looks at a kernel variable (use_ibrs).
Orabug:
27501734
Signed-off-by: Ankur Arora <ankur.a.arora@oracle.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
(cherry picked from commit
a2b15d7844fc60bc3ebb5f1703cd2fe39256db35)
DISABLE_INTERRUPTS(CLBR_NONE)
TRACE_IRQS_OFF_DEBUG
TRACE_IRQS_IRETQ_DEBUG
+
+ RESTORE_IBRS_CLOBBER save_reg=%r13d
+
#ifdef CONFIG_PAGE_TABLE_ISOLATION
/* No ALTERNATIVE for X86_FEATURE_PTI: paranoid_entry sets %ebx */
testl $2, %ebx /* SWITCH_USER_CR3 needed? */
#endif
testl $1, %ebx /* swapgs needed? */
jnz paranoid_exit_no_swapgs
- RESTORE_IBRS_CLOBBER save_reg=%r13d
SWAPGS_UNSAFE_STACK
paranoid_exit_no_swapgs:
RESTORE_EXTRA_REGS