linux/arch
Peter Zijlstra fc6ad5eadc x86/paravirt: Use static_call() for the paravirt spinlock ops
queued_spin_lock_slowpath() and queued_spin_unlock() are dispatched
through pv_ops_lock via the paravirt-ops ALTERNATIVE machinery, which
picks the target (native inline store / hypervisor call) once at boot
and cannot change at runtime.

Convert both to static_call(). The site becomes a direct call patched in
place (one byte smaller), and on native the unlock still collapses to
the inline "movb $0, (%rdi)" store, so the fast path is unchanged.

Unlike the ALTERNATIVE mechanism, a static_call() target can also be
updated at runtime via static_call_update(). This is a prerequisite for
the contended_release tracepoint, which has to swap in a traced unlock
while the system is running.

[ ilvokhin: commit message; fix PARAVIRT_SPINLOCKS=n build; teach
  __static_call_validate() about the inline unlock insn; make the
  slowpath site module-safe: static_call_mod() +
  EXPORT_STATIC_CALL_TRAMP(); pass @lock to the callee-save unlock,
  fixing a boot hang under CALL_DEPTH_TRACKING. Boot tested native + KVM
  PV guest. ]

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Co-developed-by: Dmitry Ilvokhin <d@ilvokhin.com>
Signed-off-by: Dmitry Ilvokhin <d@ilvokhin.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Juergen Gross <jgross@suse.com>
Link: https://lore.kernel.org/all/20260603120811.GW3493090@noisy.programming.kicks-ass.net/
Link: https://patch.msgid.link/9a32ae399eb804a02a31af04dcabe7e7ee4f3fdf.1785778551.git.d@ilvokhin.com
2026-08-07 17:58:09 +02:00
..
alpha pci-v7.2-changes 2026-06-24 12:48:43 -07:00
arc mm.git review status for mm-hotfixes-stable..mm-nonmm-stable 2026-06-21 13:20:19 -07:00
arm static_call / jump_label: Replace __ASSEMBLY__ with __ASSEMBLER__ in headers 2026-07-31 10:32:24 +02:00
arm64 arm64/runtime-const: Introduce runtime_const_mask_32() 2026-07-28 13:07:14 +02:00
csky
hexagon
loongarch Split <linux/mod_devicetable.h> in per subsystem headers 2026-07-02 20:54:26 -10:00
m68k mm.git review status for mm-hotfixes-stable..mm-nonmm-stable 2026-06-21 13:20:19 -07:00
microblaze
mips collected fixes for 7.2 2026-07-04 06:05:28 -10:00
nios2
openrisc mm.git review status for mm-hotfixes-stable..mm-nonmm-stable 2026-06-21 13:20:19 -07:00
parisc Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (headers) 2026-07-03 07:38:16 +02:00
powerpc Split <linux/mod_devicetable.h> in per subsystem headers 2026-07-02 20:54:26 -10:00
riscv riscv/runtime-const: Disable linker relaxation for RUNTIME_MAGIC 2026-08-04 12:29:45 +02:00
s390 s390/runtime-const: Introduce runtime_const_mask_32() 2026-07-29 13:17:52 +02:00
sh Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
sparc Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
um mm.git review status for mm-hotfixes-stable..mm-nonmm-stable 2026-06-21 13:20:19 -07:00
x86 x86/paravirt: Use static_call() for the paravirt spinlock ops 2026-08-07 17:58:09 +02:00
xtensa mm.git review status for mm-hotfixes-stable..mm-nonmm-stable 2026-06-21 13:20:19 -07:00
.gitignore
Kconfig