1 struct ftrace_branch_data {
5 int __static_cpu_has(unsigned short bit)
7 asm goto ("1: jmp %l[t_no]\n" "2:\n" ".section .altinstructions,\"a\"\n"
8 " " ".balign 4" " " "\n" " " ".long" " " "1b\n" " " ".long"
9 " " "0\n" " .word %P0\n" " .byte 2b - 1b\n" " .byte 0\n"
10 ".previous\n"::"i" (bit)::t_no);
17 unsigned int x86_capability[10];
18 } __attribute__ ((__aligned__((1 << (6)))));
19 extern struct cpuinfo_x86 boot_cpu_data;
20 struct i387_fxsave_struct {
22 } __attribute__ ((aligned(16)));
23 struct xsave_hdr_struct {
24 unsigned long long xstate_bv;
25 } __attribute__ ((packed));
27 struct xsave_hdr_struct xsave_hdr;
28 } __attribute__ ((packed, aligned(64)));
30 struct i387_fxsave_struct fxsave;
31 struct xsave_struct xsave;
34 union thread_xstate *state;
36 struct thread_struct {
40 struct task_struct *task;
44 unsigned int cia_min_keysize;
45 unsigned int cia_max_keysize;
46 int (*cia_setkey) (struct crypto_tfm * tfm, const unsigned char * key,
48 void (*cia_encrypt) (struct crypto_tfm * tfm, unsigned char * dst, const unsigned char * src);
49 void (*cia_decrypt) (struct crypto_tfm * tfm, unsigned char * dst, const unsigned char * src);
52 struct list_head cra_list;
53 unsigned int cra_flags;
54 unsigned int cra_blocksize;
55 unsigned int cra_ctxsize;
56 unsigned int cra_alignmask;
59 char cra_driver_name[64];
60 const struct crypto_type *cra_type;
62 struct cipher_alg cipher;
64 struct module *cra_module;
66 extern const struct crypto_type crypto_ablkcipher_type;
67 extern const struct crypto_type crypto_blkcipher_type;
68 struct crypto_aes_ctx {
71 struct thread_struct thread;
73 static __attribute__ ((always_inline))
74 __attribute__ ((pure))
79 ((__builtin_constant_p((4 * 32 + 26))
81 (((((4 * 32 + 26)) >> 5) == 0
82 && (1UL << (((4 * 32 + 26)) & 31) &
83 ((1 << ((0 * 32 + 0) & 31)) | 0 | 0 |
84 (1 << ((0 * 32 + 6) & 31)) | (1 << ((0 * 32 + 8) & 31))
85 | 0 | 0 | (1 << ((0 * 32 + 15) & 31)) | 0 | 0)))
86 || ((((4 * 32 + 26)) >> 5) == 1
87 && (1UL << (((4 * 32 + 26)) & 31) & (0 | 0)))
88 || ((((4 * 32 + 26)) >> 5) == 2
89 && (1UL << (((4 * 32 + 26)) & 31) & 0))
90 || ((((4 * 32 + 26)) >> 5) == 3
91 && (1UL << (((4 * 32 + 26)) & 31) & (0)))
92 || ((((4 * 32 + 26)) >> 5) == 4
93 && (1UL << (((4 * 32 + 26)) & 31) & 0))
94 || ((((4 * 32 + 26)) >> 5) == 5
95 && (1UL << (((4 * 32 + 26)) & 31) & 0))
96 || ((((4 * 32 + 26)) >> 5) == 6
97 && (1UL << (((4 * 32 + 26)) & 31) & 0))
98 || ((((4 * 32 + 26)) >> 5) == 7
99 && (1UL << (((4 * 32 + 26)) & 31) & 0))
100 || ((((4 * 32 + 26)) >> 5) == 8
101 && (1UL << (((4 * 32 + 26)) & 31) & 0))
102 || ((((4 * 32 + 26)) >> 5) == 9
103 && (1UL << (((4 * 32 + 26)) & 31) & 0))) ? 1
105 (__builtin_constant_p(4 * 32 + 26) ?
106 constant_test_bit(4 * 32 + 26,
107 ((unsigned long *)((&boot_cpu_data)->
109 variable_test_bit(((4 * 32 + 26))
111 ((unsigned long *)((&boot_cpu_data)->
113 ? (__builtin_constant_p((4 * 32 + 26))
115 (((((4 * 32 + 26)) >> 5) == 0
116 && (1UL << (((4 * 32 + 26)) & 31) &
117 ((1 << ((0 * 32 + 0) & 31)) | 0 | 0 |
118 (1 << ((0 * 32 + 6) & 31)) | (1 <<
120 8) & 31)) | 0 | 0 | (1
122 ((0 * 32 + 15) & 31)) | 0 | 0))) || ((((4 * 32 + 26)) >> 5) == 1 && (1UL << (((4 * 32 + 26)) & 31) & (0 | 0))) || ((((4 * 32 + 26)) >> 5) == 2 && (1UL << (((4 * 32 + 26)) & 31) & 0)) || ((((4 * 32 + 26)) >> 5) == 3 && (1UL << (((4 * 32 + 26)) & 31) & (0))) || ((((4 * 32 + 26)) >> 5) == 4 && (1UL << (((4 * 32 + 26)) & 31) & 0)) || ((((4 * 32 + 26)) >> 5) == 5 && (1UL << (((4 * 32 + 26)) & 31) & 0)) || ((((4 * 32 + 26)) >> 5) == 6 && (1UL << (((4 * 32 + 26)) & 31) & 0)) || ((((4 * 32 + 26)) >> 5) == 7 && (1UL << (((4 * 32 + 26)) & 31) & 0)) || ((((4 * 32 + 26)) >> 5) == 8 && (1UL << (((4 * 32 + 26)) & 31) & 0)) || ((((4 * 32 + 26)) >> 5) == 9 && (1UL << (((4 * 32 + 26)) & 31) & 0))) ? 1 : (__builtin_constant_p(((4 * 32 + 26))) ? constant_test_bit(((4 * 32 + 26)), ((unsigned long *)((&boot_cpu_data)->x86_capability))) : variable_test_bit(((4 * 32 + 26)), ((unsigned long *)((&boot_cpu_data)->x86_capability))))) : __builtin_constant_p((4 * 32 + 26)) ? __static_cpu_has((4 * 32 + 26)) : (__builtin_constant_p((4 * 32 + 26)) && (((((4 * 32 + 26)) >> 5) == 0 && (1UL << (((4 * 32 + 26)) & 31) & ((1 << ((0 * 32 + 0) & 31)) | 0 | 0 | (1 << ((0 * 32 + 6) & 31)) | (1 << ((0 * 32 + 8) & 31)) | 0 | 0 | (1 << ((0 * 32 + 15) & 31)) | 0 | 0))) || ((((4 * 32 + 26)) >> 5) == 1 && (1UL << (((4 * 32 + 26)) & 31) & (0 | 0))) || ((((4 * 32 + 26)) >> 5) == 2 && (1UL << (((4 * 32 + 26)) & 31) & 0)) || ((((4 * 32 + 26)) >> 5) == 3 && (1UL << (((4 * 32 + 26)) & 31) & (0))) || ((((4 * 32 + 26)) >> 5) == 4 && (1UL << (((4 * 32 + 26)) & 31) & 0)) || ((((4 * 32 + 26)) >> 5) == 5 && (1UL << (((4 * 32 + 26)) & 31) & 0)) || ((((4 * 32 + 26)) >> 5) == 6 && (1UL << (((4 * 32 + 26)) & 31) & 0)) || ((((4 * 32 + 26)) >> 5) == 7 && (1UL << (((4 * 32 + 26)) & 31) & 0)) || ((((4 * 32 + 26)) >> 5) == 8 && (1UL << (((4 * 32 + 26)) & 31) & 0)) || ((((4 * 32 + 26)) >> 5) == 9 && (1UL << (((4 * 32 + 26)) & 31) & 0))) ? 1 : (__builtin_constant_p(((4 * 32 + 26))) ? constant_test_bit(((4 * 32 + 26)), ((unsigned long *)((&boot_cpu_data)->x86_capability))) : variable_test_bit(((4 * 32 + 26)), ((unsigned long *)((&boot_cpu_data)->x86_capability))))));
125 static inline __attribute__ ((always_inline)) __attribute__ ((always_inline))
126 __attribute__ ((pure))
129 return (__builtin_constant_p
130 ((__builtin_constant_p((0 * 32 + 24))
132 (((((0 * 32 + 24)) >> 5) == 0
133 && (1UL << (((0 * 32 + 24)) & 31) &
134 ((1 << ((0 * 32 + 0) & 31)) | 0 | 0 |
135 (1 << ((0 * 32 + 6) & 31)) | (1 << ((0 * 32 + 8) & 31))
136 | 0 | 0 | (1 << ((0 * 32 + 15) & 31)) | 0 | 0)))
137 || ((((0 * 32 + 24)) >> 5) == 1
138 && (1UL << (((0 * 32 + 24)) & 31) & (0 | 0)))
139 || ((((0 * 32 + 24)) >> 5) == 2
140 && (1UL << (((0 * 32 + 24)) & 31) & 0))
141 || ((((0 * 32 + 24)) >> 5) == 3
142 && (1UL << (((0 * 32 + 24)) & 31) & (0)))
143 || ((((0 * 32 + 24)) >> 5) == 4
144 && (1UL << (((0 * 32 + 24)) & 31) & 0))
145 || ((((0 * 32 + 24)) >> 5) == 5
146 && (1UL << (((0 * 32 + 24)) & 31) & 0))
147 || ((((0 * 32 + 24)) >> 5) == 6
148 && (1UL << (((0 * 32 + 24)) & 31) & 0))
149 || ((((0 * 32 + 24)) >> 5) == 7
150 && (1UL << (((0 * 32 + 24)) & 31) & 0))
151 || ((((0 * 32 + 24)) >> 5) == 8
152 && (1UL << (((0 * 32 + 24)) & 31) & 0))
153 || ((((0 * 32 + 24)) >> 5) == 9
154 && (1UL << (((0 * 32 + 24)) & 31) & 0))) ? 1
155 : (__builtin_constant_p(((0 * 32 + 24))) ?
156 constant_test_bit(((0 * 32 + 24)),
157 ((unsigned long *)((&boot_cpu_data)->
159 variable_test_bit(((0 * 32 + 24)),
160 ((unsigned long *)((&boot_cpu_data)->
162 ? (__builtin_constant_p((0 * 32 + 24))
164 (((((0 * 32 + 24)) >> 5) == 0
165 && (1UL << (((0 * 32 + 24)) & 31) &
166 ((1 << ((0 * 32 + 0) & 31)) | 0 | 0 |
167 (1 << ((0 * 32 + 6) & 31)) | (1 <<
169 8) & 31)) | 0 | 0 | (1
171 ((0 * 32 + 15) & 31)) | 0 | 0))) || ((((0 * 32 + 24)) >> 5) == 1 && (1UL << (((0 * 32 + 24)) & 31) & (0 | 0))) || ((((0 * 32 + 24)) >> 5) == 2 && (1UL << (((0 * 32 + 24)) & 31) & 0)) || ((((0 * 32 + 24)) >> 5) == 3 && (1UL << (((0 * 32 + 24)) & 31) & (0))) || ((((0 * 32 + 24)) >> 5) == 4 && (1UL << (((0 * 32 + 24)) & 31) & 0)) || ((((0 * 32 + 24)) >> 5) == 5 && (1UL << (((0 * 32 + 24)) & 31) & 0)) || ((((0 * 32 + 24)) >> 5) == 6 && (1UL << (((0 * 32 + 24)) & 31) & 0)) || ((((0 * 32 + 24)) >> 5) == 7 && (1UL << (((0 * 32 + 24)) & 31) & 0)) || ((((0 * 32 + 24)) >> 5) == 8 && (1UL << (((0 * 32 + 24)) & 31) & 0)) || ((((0 * 32 + 24)) >> 5) == 9 && (1UL << (((0 * 32 + 24)) & 31) & 0))) ? 1 : (__builtin_constant_p(((0 * 32 + 24))) ? constant_test_bit(((0 * 32 + 24)), ((unsigned long *)((&boot_cpu_data)->x86_capability))) : variable_test_bit(((0 * 32 + 24)), ((unsigned long *)((&boot_cpu_data)->x86_capability))))) : __builtin_constant_p((0 * 32 + 24)) ? __static_cpu_has((0 * 32 + 24)) : (__builtin_constant_p((0 * 32 + 24)) && (((((0 * 32 + 24)) >> 5) == 0 && (1UL << (((0 * 32 + 24)) & 31) & ((1 << ((0 * 32 + 0) & 31)) | 0 | 0 | (1 << ((0 * 32 + 6) & 31)) | (1 << ((0 * 32 + 8) & 31)) | 0 | 0 | (1 << ((0 * 32 + 15) & 31)) | 0 | 0))) || ((((0 * 32 + 24)) >> 5) == 1 && (1UL << (((0 * 32 + 24)) & 31) & (0 | 0))) || ((((0 * 32 + 24)) >> 5) == 2 && (1UL << (((0 * 32 + 24)) & 31) & 0)) || ((((0 * 32 + 24)) >> 5) == 3 && (1UL << (((0 * 32 + 24)) & 31) & (0))) || ((((0 * 32 + 24)) >> 5) == 4 && (1UL << (((0 * 32 + 24)) & 31) & 0)) || ((((0 * 32 + 24)) >> 5) == 5 && (1UL << (((0 * 32 + 24)) & 31) & 0)) || ((((0 * 32 + 24)) >> 5) == 6 && (1UL << (((0 * 32 + 24)) & 31) & 0)) || ((((0 * 32 + 24)) >> 5) == 7 && (1UL << (((0 * 32 + 24)) & 31) & 0)) || ((((0 * 32 + 24)) >> 5) == 8 && (1UL << (((0 * 32 + 24)) & 31) & 0)) || ((((0 * 32 + 24)) >> 5) == 9 && (1UL << (((0 * 32 + 24)) & 31) & 0))) ? 1 : (__builtin_constant_p(((0 * 32 + 24))) ? constant_test_bit(((0 * 32 + 24)), ((unsigned long *)((&boot_cpu_data)->x86_capability))) : variable_test_bit(((0 * 32 + 24)), ((unsigned long *)((&boot_cpu_data)->x86_capability))))));
174 static inline __attribute__ ((always_inline))
175 void fpu_save_init(struct fpu *fpu)
177 if (__builtin_constant_p(use_xsave())? !!use_xsave() : !!use_xsave()) {
178 if (__builtin_constant_p
179 (((!(fpu->state->xsave.xsave_hdr.
180 xstate_bv & 0x1)))) ? ! !((!(fpu->state->xsave.
182 xstate_bv & 0x1))) : ( {
183 ! !((!(fpu->state->xsave.xsave_hdr.xstate_bv & 0x1)));}
186 } else if (!!use_fxsr()) {
188 if (__builtin_constant_p
189 ((((__builtin_constant_p(fpu->state->fxsave.swd & (1 << 7)) ?
190 ! !(fpu->state->fxsave.swd & (1 << 7)) : ( {
201 ! !(((__builtin_constant_p(fpu->state->fxsave.swd & (1 << 7)) ?
202 ! !(fpu->state->fxsave.swd & (1 << 7)) : ( {
216 ! !(((__builtin_constant_p(fpu->state->fxsave.swd & (1 << 7))
217 ? ! !(fpu->state->fxsave.swd & (1 << 7)) : ( {
230 asm volatile ("fnclex");
234 __attribute__ ((always_inline))
235 void __save_init_fpu(void)
240 static __attribute__ ((always_inline))
241 void kernel_fpu_begin(void)
246 static void aes_decrypt(struct crypto_tfm *tfm)
248 struct crypto_aes_ctx *ctx = aes_ctx(crypto_tfm_ctx(tfm));
249 if (!!!irq_fpu_usable())
250 crypto_aes_decrypt_x86(ctx);
255 static struct crypto_alg aesni_alg = {
261 .cia_decrypt = aes_decrypt}
265 static struct crypto_alg blk_ecb_alg = {
267 &blk_ecb_alg.cra_list,
268 &blk_ecb_alg.cra_list}
271 static struct crypto_alg ablk_ecb_alg = {
281 static struct crypto_alg ablk_cbc_alg = {
291 static struct crypto_alg ablk_pcbc_alg = {
304 if (!!crypto_register_alg(&aesni_alg))
305 crypto_unregister_alg(&ablk_ecb_alg);