]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
x86_64/bug: Inline the UD1
authorPeter Zijlstra <peterz@infradead.org>
Sat, 7 Jun 2025 08:06:40 +0000 (10:06 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Mon, 24 Nov 2025 19:23:25 +0000 (20:23 +0100)
commit860238af7a3348225de228dc0f33a7d631638333
treed9b6d53173913cb4953fe989bb76afc369ad6a0f
parent11bb4944f014d756f35261f5afcb346901ef1efa
x86_64/bug: Inline the UD1

(Ab)use the static_call infrastructure to convert all:

  call __WARN_trap

instances into the desired:

  ud1 (%edx), %rdi

eliminating the CALL/RET, but more importantly, fixing the
fact that all WARNs will have:

  RIP: 0010:__WARN_trap+0

Basically, by making it a static_call trampoline call, objtool will
collect the callsites, and then the inline rewrite will hit the
special case and replace the code with the magic instruction.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20251110115758.456717741@infradead.org
arch/x86/include/asm/bug.h
arch/x86/kernel/static_call.c
arch/x86/kernel/traps.c