[PATCH v2 00/12] x86: WARN() hackery

From: Peter Zijlstra
Date: Mon Nov 10 2025 - 07:00:33 EST


Hi!

I was going through my patch cabinet the other day and found these patches.

Mark was going to see if he could make ARM64 play ball to see if the generic
bits really are that. But clearly he's forgotten about things just as much as I
had.

We should probably just merge these, as they improbe the code-gen for WARN()
significantly on x86 and then I'll help Mark out for ARM64 when he gets around
to it and needs a hand.

Freshly rebased and somewhat tested.

As a quick reminder, this makes WARN(), which has a vararg printf like
arguments work with the #UD based WARN infra by hiding the format in the
bug_table (its a constant after all) and replacing this first argument with the
address of the bug-table entry while making the actual function that's called a
UD1 instruction.

The exception handler then create a va_list from pt_regs and vprintk() does the
rest.

Also here:

git://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git x86/bugs


v1: https://lkml.kernel.org/r/20250607094224.104791182@xxxxxxxxxxxxx