]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blame - include/linux/jump_label_ratelimit.h
seccomp: Move speculation migitation control to arch code
[mirror_ubuntu-artful-kernel.git] / include / linux / jump_label_ratelimit.h
CommitLineData
851cf6e7
AJ
1#ifndef _LINUX_JUMP_LABEL_RATELIMIT_H
2#define _LINUX_JUMP_LABEL_RATELIMIT_H
3
4#include <linux/jump_label.h>
5#include <linux/workqueue.h>
6
7#if defined(CC_HAVE_ASM_GOTO) && defined(CONFIG_JUMP_LABEL)
8struct static_key_deferred {
9 struct static_key key;
10 unsigned long timeout;
11 struct delayed_work work;
12};
13#endif
14
15#ifdef HAVE_JUMP_LABEL
16extern void static_key_slow_dec_deferred(struct static_key_deferred *key);
b6416e61 17extern void static_key_deferred_flush(struct static_key_deferred *key);
851cf6e7
AJ
18extern void
19jump_label_rate_limit(struct static_key_deferred *key, unsigned long rl);
20
21#else /* !HAVE_JUMP_LABEL */
22struct static_key_deferred {
23 struct static_key key;
24};
25static inline void static_key_slow_dec_deferred(struct static_key_deferred *key)
26{
c4b2c0c5 27 STATIC_KEY_CHECK_USE();
851cf6e7
AJ
28 static_key_slow_dec(&key->key);
29}
b6416e61
DM
30static inline void static_key_deferred_flush(struct static_key_deferred *key)
31{
32 STATIC_KEY_CHECK_USE();
33}
851cf6e7
AJ
34static inline void
35jump_label_rate_limit(struct static_key_deferred *key,
36 unsigned long rl)
37{
c4b2c0c5 38 STATIC_KEY_CHECK_USE();
851cf6e7
AJ
39}
40#endif /* HAVE_JUMP_LABEL */
41#endif /* _LINUX_JUMP_LABEL_RATELIMIT_H */