1 typedef unsigned int __u32;
2 typedef unsigned char u8;
3 typedef unsigned short u16;
4 typedef unsigned int u32;
5 typedef unsigned long long u64;
6 struct ftrace_branch_data {
14 static inline __attribute__ ((always_inline)) __attribute__ ((always_inline))
15 __attribute__ ((pure))
16 bool __static_cpu_has(u16 bit)
18 asm goto ("1: jmp %l[t_no]\n" "2:\n" ".section .altinstructions,\"a\"\n"
19 " " ".balign 4" " " "\n" " " ".long" " " "1b\n" " " ".long"
20 " " "0\n" " .word %P0\n" " .byte 2b - 1b\n" " .byte 0\n"
21 ".previous\n"::"i" (bit)::t_no);
27 __u32 x86_capability[10];
28 } __attribute__ ((__aligned__((1 << (6)))));
29 extern struct cpuinfo_x86 boot_cpu_data;
30 struct i387_fxsave_struct {
32 } __attribute__ ((aligned(16)));
33 struct xsave_hdr_struct {
35 } __attribute__ ((packed));
37 struct xsave_hdr_struct xsave_hdr;
38 } __attribute__ ((packed, aligned(64)));
40 struct i387_fxsave_struct fxsave;
41 struct xsave_struct xsave;
44 union thread_xstate *state;
46 struct thread_struct {
50 struct task_struct *task;
53 extern struct module __this_module;
55 unsigned int cia_min_keysize;
56 unsigned int cia_max_keysize;
57 int (*cia_setkey) (struct crypto_tfm * tfm, const u8 * key,
59 void (*cia_encrypt) (struct crypto_tfm * tfm, u8 * dst, const u8 * src);
60 void (*cia_decrypt) (struct crypto_tfm * tfm, u8 * dst, const u8 * src);
63 struct list_head cra_list;
65 unsigned int cra_blocksize;
66 unsigned int cra_ctxsize;
67 unsigned int cra_alignmask;
70 char cra_driver_name[64];
71 const struct crypto_type *cra_type;
73 struct cipher_alg cipher;
75 struct module *cra_module;
77 extern const struct crypto_type crypto_ablkcipher_type;
78 extern const struct crypto_type crypto_blkcipher_type;
79 struct crypto_aes_ctx {
82 struct thread_struct thread;
84 static inline __attribute__ ((always_inline)) __attribute__ ((always_inline))
85 __attribute__ ((pure))
88 return (__builtin_constant_p
89 ((__builtin_constant_p((4 * 32 + 26))
91 (((((4 * 32 + 26)) >> 5) == 0
92 && (1UL << (((4 * 32 + 26)) & 31) &
93 ((1 << ((0 * 32 + 0) & 31)) | 0 | 0 |
94 (1 << ((0 * 32 + 6) & 31)) | (1 << ((0 * 32 + 8) & 31))
95 | 0 | 0 | (1 << ((0 * 32 + 15) & 31)) | 0 | 0)))
96 || ((((4 * 32 + 26)) >> 5) == 1
97 && (1UL << (((4 * 32 + 26)) & 31) & (0 | 0)))
98 || ((((4 * 32 + 26)) >> 5) == 2
99 && (1UL << (((4 * 32 + 26)) & 31) & 0))
100 || ((((4 * 32 + 26)) >> 5) == 3
101 && (1UL << (((4 * 32 + 26)) & 31) & (0)))
102 || ((((4 * 32 + 26)) >> 5) == 4
103 && (1UL << (((4 * 32 + 26)) & 31) & 0))
104 || ((((4 * 32 + 26)) >> 5) == 5
105 && (1UL << (((4 * 32 + 26)) & 31) & 0))
106 || ((((4 * 32 + 26)) >> 5) == 6
107 && (1UL << (((4 * 32 + 26)) & 31) & 0))
108 || ((((4 * 32 + 26)) >> 5) == 7
109 && (1UL << (((4 * 32 + 26)) & 31) & 0))
110 || ((((4 * 32 + 26)) >> 5) == 8
111 && (1UL << (((4 * 32 + 26)) & 31) & 0))
112 || ((((4 * 32 + 26)) >> 5) == 9
113 && (1UL << (((4 * 32 + 26)) & 31) & 0))) ? 1
114 : (__builtin_constant_p(((4 * 32 + 26))) ?
115 constant_test_bit(((4 * 32 + 26)),
116 ((unsigned long *)((&boot_cpu_data)->
118 variable_test_bit(((4 * 32 + 26)),
119 ((unsigned long *)((&boot_cpu_data)->
121 ? (__builtin_constant_p((4 * 32 + 26))
123 (((((4 * 32 + 26)) >> 5) == 0
124 && (1UL << (((4 * 32 + 26)) & 31) &
125 ((1 << ((0 * 32 + 0) & 31)) | 0 | 0 |
126 (1 << ((0 * 32 + 6) & 31)) | (1 <<
128 8) & 31)) | 0 | 0 | (1
130 ((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))))));
133 static inline __attribute__ ((always_inline)) __attribute__ ((always_inline))
134 __attribute__ ((pure))
137 return (__builtin_constant_p
138 ((__builtin_constant_p((0 * 32 + 24))
140 (((((0 * 32 + 24)) >> 5) == 0
141 && (1UL << (((0 * 32 + 24)) & 31) &
142 ((1 << ((0 * 32 + 0) & 31)) | 0 | 0 |
143 (1 << ((0 * 32 + 6) & 31)) | (1 << ((0 * 32 + 8) & 31))
144 | 0 | 0 | (1 << ((0 * 32 + 15) & 31)) | 0 | 0)))
145 || ((((0 * 32 + 24)) >> 5) == 1
146 && (1UL << (((0 * 32 + 24)) & 31) & (0 | 0)))
147 || ((((0 * 32 + 24)) >> 5) == 2
148 && (1UL << (((0 * 32 + 24)) & 31) & 0))
149 || ((((0 * 32 + 24)) >> 5) == 3
150 && (1UL << (((0 * 32 + 24)) & 31) & (0)))
151 || ((((0 * 32 + 24)) >> 5) == 4
152 && (1UL << (((0 * 32 + 24)) & 31) & 0))
153 || ((((0 * 32 + 24)) >> 5) == 5
154 && (1UL << (((0 * 32 + 24)) & 31) & 0))
155 || ((((0 * 32 + 24)) >> 5) == 6
156 && (1UL << (((0 * 32 + 24)) & 31) & 0))
157 || ((((0 * 32 + 24)) >> 5) == 7
158 && (1UL << (((0 * 32 + 24)) & 31) & 0))
159 || ((((0 * 32 + 24)) >> 5) == 8
160 && (1UL << (((0 * 32 + 24)) & 31) & 0))
161 || ((((0 * 32 + 24)) >> 5) == 9
162 && (1UL << (((0 * 32 + 24)) & 31) & 0))) ? 1
163 : (__builtin_constant_p(((0 * 32 + 24))) ?
164 constant_test_bit(((0 * 32 + 24)),
165 ((unsigned long *)((&boot_cpu_data)->
167 variable_test_bit(((0 * 32 + 24)),
168 ((unsigned long *)((&boot_cpu_data)->
170 ? (__builtin_constant_p((0 * 32 + 24))
172 (((((0 * 32 + 24)) >> 5) == 0
173 && (1UL << (((0 * 32 + 24)) & 31) &
174 ((1 << ((0 * 32 + 0) & 31)) | 0 | 0 |
175 (1 << ((0 * 32 + 6) & 31)) | (1 <<
177 8) & 31)) | 0 | 0 | (1
179 ((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))))));
182 static inline __attribute__ ((always_inline))
183 void fpu_save_init(struct fpu *fpu)
185 if (__builtin_constant_p(((use_xsave())))? ! !((use_xsave())) : ( {
192 if (__builtin_constant_p
193 (((!(fpu->state->xsave.xsave_hdr.
194 xstate_bv & 0x1)))) ? ! !((!(fpu->state->xsave.
196 xstate_bv & 0x1))) : ( {
201 ! !((!(fpu->state->xsave.xsave_hdr.xstate_bv & 0x1)));}
204 } else if (__builtin_constant_p(((use_fxsr())))? ! !((use_fxsr())) : ( {
213 if (__builtin_constant_p
214 ((((__builtin_constant_p(fpu->state->fxsave.swd & (1 << 7)) ?
215 ! !(fpu->state->fxsave.swd & (1 << 7)) : ( {
228 ! !(((__builtin_constant_p(fpu->state->fxsave.swd & (1 << 7)) ?
229 ! !(fpu->state->fxsave.swd & (1 << 7)) : ( {
245 ! !(((__builtin_constant_p(fpu->state->fxsave.swd & (1 << 7))
246 ? ! !(fpu->state->fxsave.swd & (1 << 7)) : ( {
259 asm volatile ("fnclex");
262 static inline __attribute__ ((always_inline))
263 void __save_init_fpu(struct task_struct *tsk)
265 fpu_save_init(&tsk->thread.fpu);
268 static inline __attribute__ ((always_inline))
269 void kernel_fpu_begin(void)
271 struct thread_info *me = current_thread_info();
272 if (__builtin_constant_p(((me->status & 0x0001))) ?
273 ! !((me->status & 0x0001)) : ( {
275 ______r = ! !((me->status & 0x0001));}
277 __save_init_fpu(me->task);
280 struct async_aes_ctx {
282 static int aes_set_key(struct crypto_tfm *tfm, const u8 * in_key,
283 unsigned int key_len)
287 static void aes_encrypt(struct crypto_tfm *tfm, u8 * dst, const u8 * src)
291 static void aes_decrypt(struct crypto_tfm *tfm, u8 * dst, const u8 * src)
293 struct crypto_aes_ctx *ctx = aes_ctx(crypto_tfm_ctx(tfm));
294 if (__builtin_constant_p(((!irq_fpu_usable())))?
295 ! !((!irq_fpu_usable())) : ( {
297 ______r = ! !((!irq_fpu_usable()));}
299 crypto_aes_decrypt_x86(ctx, dst, src);
305 static struct crypto_alg aesni_alg = {
306 .cra_name = "aes",.cra_driver_name = "aes-aesni",.cra_priority =
307 300,.cra_flags = 0x00000001,.cra_blocksize = 16,.cra_ctxsize =
308 sizeof(struct crypto_aes_ctx) + (16) - 1,.cra_alignmask =
309 0,.cra_module = (&__this_module),.cra_list = {
310 &(aesni_alg.cra_list),
311 &(aesni_alg.cra_list)}
314 .cia_min_keysize = 16,.cia_max_keysize =
315 32,.cia_setkey = aes_set_key,.cia_encrypt =
316 aes_encrypt,.cia_decrypt = aes_decrypt}
320 static struct crypto_alg blk_ecb_alg = {
321 .cra_name = "__ecb-aes-aesni",.cra_driver_name =
322 "__driver-ecb-aes-aesni",.cra_priority = 0,.cra_flags =
323 0x00000004,.cra_blocksize = 16,.cra_ctxsize =
324 sizeof(struct crypto_aes_ctx) + (16) - 1,.cra_alignmask =
325 0,.cra_type = &crypto_blkcipher_type,.cra_module =
326 (&__this_module),.cra_list = {
327 &(blk_ecb_alg.cra_list),
328 &(blk_ecb_alg.cra_list)}
332 static struct crypto_alg ablk_ecb_alg = {
333 .cra_name = "ecb(aes)",.cra_driver_name =
334 "ecb-aes-aesni",.cra_priority = 400,.cra_flags =
335 0x00000005 | 0x00000080,.cra_blocksize = 16,.cra_ctxsize =
336 sizeof(struct async_aes_ctx),.cra_alignmask = 0,.cra_type =
337 &crypto_ablkcipher_type,.cra_module = (&__this_module),.cra_list = {
347 static struct crypto_alg ablk_cbc_alg = {
348 .cra_name = "cbc(aes)",.cra_driver_name =
349 "cbc-aes-aesni",.cra_priority = 400,.cra_flags =
350 0x00000005 | 0x00000080,.cra_blocksize = 16,.cra_ctxsize =
351 sizeof(struct async_aes_ctx),.cra_alignmask = 0,.cra_type =
352 &crypto_ablkcipher_type,.cra_module = (&__this_module),.cra_list = {
362 static struct crypto_alg ablk_pcbc_alg = {
363 .cra_name = "pcbc(aes)",.cra_driver_name =
364 "pcbc-aes-aesni",.cra_priority = 400,.cra_flags =
365 0x00000005 | 0x00000080,.cra_blocksize = 16,.cra_ctxsize =
366 sizeof(struct async_aes_ctx),.cra_alignmask = 0,.cra_type =
367 &crypto_ablkcipher_type,.cra_module = (&__this_module),.cra_list = {
377 static int __attribute__ ((__section__(".init.text")))
378 __attribute__ ((__cold__))
379 __attribute__ ((no_instrument_function)) aesni_init(void)
382 if (__builtin_constant_p((((err = crypto_register_alg(&aesni_alg))))) ?
383 ! !(((err = crypto_register_alg(&aesni_alg)))) : ( {
391 ablk_cbc_err:crypto_unregister_alg(&ablk_ecb_alg);
394 int init_module(void) __attribute__ ((alias("aesni_init")));