Commit 5920da44 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'x86-urgent-2026-03-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 fixes from Ingo Molnar:

 - Fix speculative safety in fred_extint()

 - Fix __WARN_printf() trap in early_fixup_exception()

 - Fix clang-build boot bug for unusual alignments, triggered by
   CONFIG_DEBUG_FORCE_FUNCTION_ALIGN_64B=y

 - Replace the final few __ASSEMBLY__ stragglers that snuck in lately
   into non-UAPI x86 headers and use __ASSEMBLER__ consistently (again)

* tag 'x86-urgent-2026-03-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/headers: Replace __ASSEMBLY__ stragglers with __ASSEMBLER__
  x86/cfi: Fix CFI rewrite for odd alignments
  x86/bug: Handle __WARN_printf() trap in early_fixup_exception()
  x86/fred: Correct speculative safety in fred_extint()
parents f6542af9 237dc6a0
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -160,8 +160,6 @@ void __init fred_complete_exception_setup(void)
static noinstr void fred_extint(struct pt_regs *regs)
{
	unsigned int vector = regs->fred_ss.vector;
	unsigned int index = array_index_nospec(vector - FIRST_SYSTEM_VECTOR,
						NR_SYSTEM_VECTORS);

	if (WARN_ON_ONCE(vector < FIRST_EXTERNAL_VECTOR))
		return;
@@ -170,7 +168,8 @@ static noinstr void fred_extint(struct pt_regs *regs)
		irqentry_state_t state = irqentry_enter(regs);

		instrumentation_begin();
		sysvec_table[index](regs);
		sysvec_table[array_index_nospec(vector - FIRST_SYSTEM_VECTOR,
						NR_SYSTEM_VECTORS)](regs);
		instrumentation_end();
		irqentry_exit(regs, state);
	} else {
+3 −3
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@
#include <linux/objtool.h>
#include <asm/asm.h>

#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__
struct bug_entry;
extern void __WARN_trap(struct bug_entry *bug, ...);
#endif
@@ -137,7 +137,7 @@ do { \

#ifdef HAVE_ARCH_BUG_FORMAT_ARGS

#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__
#include <linux/static_call_types.h>
DECLARE_STATIC_CALL(WARN_trap, __WARN_trap);

@@ -153,7 +153,7 @@ struct arch_va_list {
	struct sysv_va_list args;
};
extern void *__warn_args(struct arch_va_list *args, struct pt_regs *regs);
#endif /* __ASSEMBLY__ */
#endif /* __ASSEMBLER__ */

#define __WARN_bug_entry(flags, format) ({				\
	struct bug_entry *bug;						\
+8 −4
Original line number Diff line number Diff line
@@ -111,6 +111,12 @@ extern bhi_thunk __bhi_args_end[];

struct pt_regs;

#ifdef CONFIG_CALL_PADDING
#define CFI_OFFSET (CONFIG_FUNCTION_PADDING_CFI+5)
#else
#define CFI_OFFSET 5
#endif

#ifdef CONFIG_CFI
enum bug_trap_type handle_cfi_failure(struct pt_regs *regs);
#define __bpfcall
@@ -119,11 +125,9 @@ static inline int cfi_get_offset(void)
{
	switch (cfi_mode) {
	case CFI_FINEIBT:
		return 16;
		return /* fineibt_prefix_size */ 16;
	case CFI_KCFI:
		if (IS_ENABLED(CONFIG_CALL_PADDING))
			return 16;
		return 5;
		return CFI_OFFSET;
	default:
		return 0;
	}
+2 −2
Original line number Diff line number Diff line
@@ -77,7 +77,7 @@ static __always_inline void native_local_irq_restore(unsigned long flags)
#endif

#ifndef CONFIG_PARAVIRT
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__
/*
 * Used in the idle loop; sti takes one instruction cycle
 * to complete:
@@ -95,7 +95,7 @@ static __always_inline void halt(void)
{
	native_halt();
}
#endif /* __ASSEMBLY__ */
#endif /* __ASSEMBLER__ */
#endif /* CONFIG_PARAVIRT */

#ifdef CONFIG_PARAVIRT_XXL
+2 −2
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@
 * Depending on -fpatchable-function-entry=N,N usage (CONFIG_CALL_PADDING) the
 * CFI symbol layout changes.
 *
 * Without CALL_THUNKS:
 * Without CALL_PADDING:
 *
 * 	.align	FUNCTION_ALIGNMENT
 * __cfi_##name:
@@ -77,7 +77,7 @@
 * 	.long	__kcfi_typeid_##name
 * name:
 *
 * With CALL_THUNKS:
 * With CALL_PADDING:
 *
 * 	.align FUNCTION_ALIGNMENT
 * __cfi_##name:
Loading