x86/fpu: Keep xfd_state in sync with MSR_IA32_XFD
[linux-2.6-microblaze.git] / arch / x86 / kernel / fpu / xstate.c
index 117e74c..33a214b 100644 (file)
@@ -178,10 +178,11 @@ void fpu__init_cpu_xstate(void)
         * Must happen after CR4 setup and before xsetbv() to allow KVM
         * lazy passthrough.  Write independent of the dynamic state static
         * key as that does not work on the boot CPU. This also ensures
-        * that any stale state is wiped out from XFD.
+        * that any stale state is wiped out from XFD. Reset the per CPU
+        * xfd cache too.
         */
        if (cpu_feature_enabled(X86_FEATURE_XFD))
-               wrmsrl(MSR_IA32_XFD, init_fpstate.xfd);
+               xfd_set_state(init_fpstate.xfd);
 
        /*
         * XCR_XFEATURE_ENABLED_MASK (aka. XCR0) sets user features