/* * setup the xstate image representing the init state */ static void __init setup_init_fpu_buf(void) { static int on_boot_cpu = 1; WARN_ON_FPU(!on_boot_cpu); on_boot_cpu = 0; if (!cpu_has_xsave) return; setup_xstate_features(); print_xstate_features(); if (cpu_has_xsaves) { init_fpstate.xsave.header.xcomp_bv = (u64)1 << 63 | xfeatures_mask; init_fpstate.xsave.header.xfeatures = xfeatures_mask; } /* * Init all the features state with header_bv being 0x0 */ copy_kernel_to_xregs_booting(&init_fpstate.xsave); /* * Dump the init state again. This is to identify the init state * of any feature which is not represented by all zero's. */ copy_xregs_to_kernel_booting(&init_fpstate.xsave); }
/* * setup the xstate image representing the init state */ static void __init setup_xstate_init(void) { setup_xstate_features(); /* * Setup init_xstate_buf to represent the init state of * all the features managed by the xsave */ init_xstate_buf = alloc_bootmem_align(xstate_size, __alignof__(struct xsave_struct)); init_xstate_buf->i387.mxcsr = MXCSR_DEFAULT; clts(); /* * Init all the features state with header_bv being 0x0 */ xrstor_state(init_xstate_buf, -1); /* * Dump the init state again. This is to identify the init state * of any feature which is not represented by all zero's. */ xsave_state(init_xstate_buf, -1); stts(); }
static void __init setup_xstate_init(void) { setup_xstate_features(); /* */ init_xstate_buf = alloc_bootmem_align(xstate_size, __alignof__(struct xsave_struct)); init_xstate_buf->i387.mxcsr = MXCSR_DEFAULT; clts(); /* */ xrstor_state(init_xstate_buf, -1); /* */ xsave_state(init_xstate_buf, -1); stts(); }