3 int __static_cpu_has(unsigned short bit)
5 asm goto ("1: jmp %l[t_no]\n" "2:\n" ".section .altinstructions,\"a\"\n"
6 " " ".balign 4" " " "\n" " " ".long" " " "1b\n" " " ".long"
7 " " "0\n" " .word %P0\n" " .byte 2b - 1b\n" " .byte 0\n"
8 ".previous\n"::"i" (bit)::t_no);
14 unsigned int x86_capability[10];
15 } __attribute__ ((__aligned__((1 << (6)))));
16 extern struct cpuinfo_x86 boot_cpu_data;
17 struct i387_fxsave_struct {
19 } __attribute__ ((aligned(16)));
20 struct xsave_hdr_struct {
21 unsigned long long xstate_bv;
22 } __attribute__ ((packed));
24 struct xsave_hdr_struct xsave_hdr;
25 } __attribute__ ((packed, aligned(64)));
27 struct i387_fxsave_struct fxsave;
28 struct xsave_struct xsave;
31 union thread_xstate *state;
34 struct list_head cra_list;
35 void (*cia_decrypt) (void);
37 static __attribute__ ((always_inline)) __attribute__ ((pure))
41 __builtin_constant_p(constant_test_bit
42 (boot_cpu_data.x86_capability)) ?
44 boot_cpu_data.x86_capability
46 __static_cpu_has(154);
49 static inline __attribute__ ((always_inline)) __attribute__ ((always_inline))
50 __attribute__ ((pure))
54 __builtin_constant_p(variable_test_bit
56 (unsigned long *)((&boot_cpu_data)->
59 (unsigned long *)((&boot_cpu_data)->
64 static inline __attribute__ ((always_inline))
65 void fpu_save_init(struct fpu *fpu)
67 if (__builtin_constant_p(use_xsave())? use_xsave() : use_xsave()) {
68 if (__builtin_constant_p
69 (((!(fpu->state->xsave.xsave_hdr.
70 xstate_bv & 0x1)))) ? ! !((!(fpu->state->xsave.
72 xstate_bv & 0x1))) : ( {
73 ! !((!(fpu->state->xsave.xsave_hdr.xstate_bv & 0x1)));}
76 } else if (use_fxsr()) {
78 if (__builtin_constant_p
79 ((((__builtin_constant_p(fpu->state->fxsave.swd & (1 << 7)) ?
80 ! !(fpu->state->fxsave.swd & (1 << 7)) : ( {
91 ! !(((__builtin_constant_p(fpu->state->fxsave.swd & (1 << 7)) ?
92 ! !(fpu->state->fxsave.swd & (1 << 7)) : ( {
106 ! !(((__builtin_constant_p(fpu->state->fxsave.swd & (1 << 7))
107 ? ! !(fpu->state->fxsave.swd & (1 << 7)) : ( {
120 asm volatile ("fnclex");
123 static __attribute__ ((always_inline))
124 void __save_init_fpu(void)
129 static __attribute__ ((always_inline))
130 void kernel_fpu_begin(void)
135 static void aes_decrypt(void)
137 if (!irq_fpu_usable())
138 crypto_aes_decrypt_x86(0);
143 static struct crypto_alg aesni_alg = {
144 .cra_list = { &aesni_alg.cra_list },
145 .cia_decrypt = aes_decrypt
148 static struct crypto_alg ablk_ecb_alg = {
153 if (! !crypto_register_alg(&aesni_alg))
154 crypto_unregister_alg(&ablk_ecb_alg);