summaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/static_call.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2024-12-17 17:29:58 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2024-12-17 17:29:58 +0100
commit59dbb9d81adfe07a6f8483269146b407cf9d44d7 (patch)
treee772bc400f23dfc694910d62e1569191699e391d /arch/x86/include/asm/static_call.h
parentMerge tag 'soc-fixes-6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/s... (diff)
parentx86/xen: remove hypercall page (diff)
downloadlinux-59dbb9d81adfe07a6f8483269146b407cf9d44d7.tar.xz
linux-59dbb9d81adfe07a6f8483269146b407cf9d44d7.zip
Merge tag 'xsa465+xsa466-6.13-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip
Pull xen fixes from Juergen Gross: "Fix xen netfront crash (XSA-465) and avoid using the hypercall page that doesn't do speculation mitigations (XSA-466)" * tag 'xsa465+xsa466-6.13-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: x86/xen: remove hypercall page x86/xen: use new hypercall functions instead of hypercall page x86/xen: add central hypercall functions x86/xen: don't do PV iret hypercall through hypercall page x86/static-call: provide a way to do very early static-call updates objtool/x86: allow syscall instruction x86: make get_cpu_vendor() accessible from Xen code xen/netfront: fix crash when removing device
Diffstat (limited to 'arch/x86/include/asm/static_call.h')
-rw-r--r--arch/x86/include/asm/static_call.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/x86/include/asm/static_call.h b/arch/x86/include/asm/static_call.h
index 125c407e2abe..41502bd2afd6 100644
--- a/arch/x86/include/asm/static_call.h
+++ b/arch/x86/include/asm/static_call.h
@@ -65,4 +65,19 @@
extern bool __static_call_fixup(void *tramp, u8 op, void *dest);
+extern void __static_call_update_early(void *tramp, void *func);
+
+#define static_call_update_early(name, _func) \
+({ \
+ typeof(&STATIC_CALL_TRAMP(name)) __F = (_func); \
+ if (static_call_initialized) { \
+ __static_call_update(&STATIC_CALL_KEY(name), \
+ STATIC_CALL_TRAMP_ADDR(name), __F);\
+ } else { \
+ WRITE_ONCE(STATIC_CALL_KEY(name).func, _func); \
+ __static_call_update_early(STATIC_CALL_TRAMP_ADDR(name),\
+ __F); \
+ } \
+})
+
#endif /* _ASM_STATIC_CALL_H */