forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
kernel/arch/x86/include/asm/jump_label.h
....@@ -2,6 +2,8 @@
22 #ifndef _ASM_X86_JUMP_LABEL_H
33 #define _ASM_X86_JUMP_LABEL_H
44
5
+#define HAVE_JUMP_LABEL_BATCH
6
+
57 #define JUMP_LABEL_NOP_SIZE 5
68
79 #ifdef CONFIG_X86_64
....@@ -24,7 +26,8 @@
2426 ".byte " __stringify(STATIC_KEY_INIT_NOP) "\n\t"
2527 ".pushsection __jump_table, \"aw\" \n\t"
2628 _ASM_ALIGN "\n\t"
27
- _ASM_PTR "1b, %l[l_yes], %c0 + %c1 \n\t"
29
+ ".long 1b - ., %l[l_yes] - . \n\t"
30
+ _ASM_PTR "%c0 + %c1 - .\n\t"
2831 ".popsection \n\t"
2932 : : "i" (key), "i" (branch) : : l_yes);
3033
....@@ -40,7 +43,8 @@
4043 "2:\n\t"
4144 ".pushsection __jump_table, \"aw\" \n\t"
4245 _ASM_ALIGN "\n\t"
43
- _ASM_PTR "1b, %l[l_yes], %c0 + %c1 \n\t"
46
+ ".long 1b - ., %l[l_yes] - . \n\t"
47
+ _ASM_PTR "%c0 + %c1 - .\n\t"
4448 ".popsection \n\t"
4549 : : "i" (key), "i" (branch) : : l_yes);
4650
....@@ -48,18 +52,6 @@
4852 l_yes:
4953 return true;
5054 }
51
-
52
-#ifdef CONFIG_X86_64
53
-typedef u64 jump_label_t;
54
-#else
55
-typedef u32 jump_label_t;
56
-#endif
57
-
58
-struct jump_entry {
59
- jump_label_t code;
60
- jump_label_t target;
61
- jump_label_t key;
62
-};
6355
6456 #else /* __ASSEMBLY__ */
6557
....@@ -75,7 +67,8 @@
7567 .endif
7668 .pushsection __jump_table, "aw"
7769 _ASM_ALIGN
78
- _ASM_PTR .Lstatic_jump_\@, \target, \key
70
+ .long .Lstatic_jump_\@ - ., \target - .
71
+ _ASM_PTR \key - .
7972 .popsection
8073 .endm
8174
....@@ -91,7 +84,8 @@
9184 .endif
9285 .pushsection __jump_table, "aw"
9386 _ASM_ALIGN
94
- _ASM_PTR .Lstatic_jump_\@, \target, \key + 1
87
+ .long .Lstatic_jump_\@ - ., \target - .
88
+ _ASM_PTR \key + 1 - .
9589 .popsection
9690 .endm
9791