Commit 35ce4632 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'x86_urgent_for_v6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 fix from Borislav Petkov:

 - Make sure TF is cleared before calling other functions (BHI
   mitigation in this case) in the SYSENTER compat handler, as
   otherwise it will warn about being in single-step mode

* tag 'x86_urgent_for_v6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/bhi: Avoid warning in #DB handler due to BHI mitigation
parents 4d145e3f ac8b270b
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -89,10 +89,6 @@ SYM_INNER_LABEL(entry_SYSENTER_compat_after_hwframe, SYM_L_GLOBAL)

	cld

	IBRS_ENTER
	UNTRAIN_RET
	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
@@ -116,6 +112,16 @@ SYM_INNER_LABEL(entry_SYSENTER_compat_after_hwframe, SYM_L_GLOBAL)
	jnz	.Lsysenter_fix_flags
.Lsysenter_flags_fixed:

	/*
	 * 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
	UNTRAIN_RET
	CLEAR_BRANCH_HISTORY

	movq	%rsp, %rdi
	call	do_SYSENTER_32
	jmp	sysret32_from_system_call