Skip to content

x86: WARN() hackery

Peter Zijlstra lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest12 patches 9 repliesIn review
  2. v111 patches 5 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/12x86: Rework __bug_table helpersarch/x86/include/asm/bug.h+20 -170 replies
2/12bug: Add BUG_FORMAT infrastructureinclude/asm-generic/bug.h lib/bug.c+39 -70 replies
3/12bug: Clean up CONFIG_GENERIC_BUG_RELATIVE_POINTERSinclude/asm-generic/bug.h+8 -140 replies
4/12bug: Add BUG_FORMAT_ARGS infrastructureinclude/asm-generic/bug.h lib/bug.c+16 -20 replies
5/12bug: Add report_bug_entry()include/linux/bug.h lib/bug.c+23 -80 replies
6/12bug: Implement WARN_ON() using __WARN_FLAGS()include/asm-generic/bug.h+17 -70 replies
7/12bug: Allow architectures to provide __WARN_printf()include/asm-generic/bug.h+22 -150 replies
8/12x86/bug: Add BUG_FORMAT basicsarch/x86/include/asm/bug.h+21 -106 replies
9/12x86/bug: Use BUG_FORMAT for DEBUG_BUGVERBOSE_DETAILEDarch/x86/include/asm/bug.h include/asm-generic/bug.h+13 -50 replies
10/12x86_64/bug: Implement __WARN_printf()arch/x86/entry/entry.S arch/x86/include/asm/bug.h arch/x86/kernel/traps.c+168 -151 reply
11/12x86/bug: Implement WARN_ONCE()arch/x86/include/asm/bug.h include/asm-generic/bug.h+11 -00 replies
12/12x86_64/bug: Inline the UD1arch/x86/include/asm/bug.h arch/x86/kernel/static_call.c arch/x86/kernel/traps.c+19 -30 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

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

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/[email protected]