| .. | .. |
|---|
| 2 | 2 | #ifndef _ASM_X86_JUMP_LABEL_H |
|---|
| 3 | 3 | #define _ASM_X86_JUMP_LABEL_H |
|---|
| 4 | 4 | |
|---|
| 5 | +#define HAVE_JUMP_LABEL_BATCH |
|---|
| 6 | + |
|---|
| 5 | 7 | #define JUMP_LABEL_NOP_SIZE 5 |
|---|
| 6 | 8 | |
|---|
| 7 | 9 | #ifdef CONFIG_X86_64 |
|---|
| .. | .. |
|---|
| 24 | 26 | ".byte " __stringify(STATIC_KEY_INIT_NOP) "\n\t" |
|---|
| 25 | 27 | ".pushsection __jump_table, \"aw\" \n\t" |
|---|
| 26 | 28 | _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" |
|---|
| 28 | 31 | ".popsection \n\t" |
|---|
| 29 | 32 | : : "i" (key), "i" (branch) : : l_yes); |
|---|
| 30 | 33 | |
|---|
| .. | .. |
|---|
| 40 | 43 | "2:\n\t" |
|---|
| 41 | 44 | ".pushsection __jump_table, \"aw\" \n\t" |
|---|
| 42 | 45 | _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" |
|---|
| 44 | 48 | ".popsection \n\t" |
|---|
| 45 | 49 | : : "i" (key), "i" (branch) : : l_yes); |
|---|
| 46 | 50 | |
|---|
| .. | .. |
|---|
| 48 | 52 | l_yes: |
|---|
| 49 | 53 | return true; |
|---|
| 50 | 54 | } |
|---|
| 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 | | -}; |
|---|
| 63 | 55 | |
|---|
| 64 | 56 | #else /* __ASSEMBLY__ */ |
|---|
| 65 | 57 | |
|---|
| .. | .. |
|---|
| 75 | 67 | .endif |
|---|
| 76 | 68 | .pushsection __jump_table, "aw" |
|---|
| 77 | 69 | _ASM_ALIGN |
|---|
| 78 | | - _ASM_PTR .Lstatic_jump_\@, \target, \key |
|---|
| 70 | + .long .Lstatic_jump_\@ - ., \target - . |
|---|
| 71 | + _ASM_PTR \key - . |
|---|
| 79 | 72 | .popsection |
|---|
| 80 | 73 | .endm |
|---|
| 81 | 74 | |
|---|
| .. | .. |
|---|
| 91 | 84 | .endif |
|---|
| 92 | 85 | .pushsection __jump_table, "aw" |
|---|
| 93 | 86 | _ASM_ALIGN |
|---|
| 94 | | - _ASM_PTR .Lstatic_jump_\@, \target, \key + 1 |
|---|
| 87 | + .long .Lstatic_jump_\@ - ., \target - . |
|---|
| 88 | + _ASM_PTR \key + 1 - . |
|---|
| 95 | 89 | .popsection |
|---|
| 96 | 90 | .endm |
|---|
| 97 | 91 | |
|---|