]> git.karo-electronics.de Git - linux-beck.git/commitdiff
x86/fpu/xstate: Fix XSTATE component offset print out
authorYu-cheng Yu <yu-cheng.yu@intel.com>
Fri, 17 Jun 2016 20:07:18 +0000 (13:07 -0700)
committerIngo Molnar <mingo@kernel.org>
Sun, 10 Jul 2016 15:12:10 +0000 (17:12 +0200)
Component offset print out was incorrect for XSAVES. Correct it and move
to a separate function.

Signed-off-by: Yu-cheng Yu <yu-cheng.yu@intel.com>
Reviewed-by: Dave Hansen <dave.hansen@intel.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Quentin Casasnovas <quentin.casasnovas@oracle.com>
Cc: Ravi V. Shankar <ravi.v.shankar@intel.com>
Cc: Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/86602a8ac400626c6eca7125c3e15934866fc38e.1466179491.git.yu-cheng.yu@intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/kernel/fpu/xstate.c

index 56c0e707af214b24e72d3da90390e68aeed65116..09bac979b8a2ae59fd91a8536db8d8719f4b3deb 100644 (file)
@@ -269,8 +269,6 @@ static void __init setup_xstate_features(void)
                WARN_ONCE(last_good_offset > xstate_offsets[i],
                        "x86/fpu: misordered xstate at %d\n", last_good_offset);
                last_good_offset = xstate_offsets[i];
-
-               printk(KERN_INFO "x86/fpu: xstate_offset[%d]: %4d, xstate_sizes[%d]: %4d\n", i, ebx, i, eax);
        }
 }
 
@@ -373,6 +371,21 @@ static void __init setup_xstate_comp(void)
        }
 }
 
+/*
+ * Print out xstate component offsets and sizes
+ */
+static void __init print_xstate_offset_size(void)
+{
+       int i;
+
+       for (i = FIRST_EXTENDED_XFEATURE; i < XFEATURE_MAX; i++) {
+               if (!xfeature_enabled(i))
+                       continue;
+               pr_info("x86/fpu: xstate_offset[%d]: %4d, xstate_sizes[%d]: %4d\n",
+                        i, xstate_comp_offsets[i], i, xstate_sizes[i]);
+       }
+}
+
 /*
  * setup the xstate image representing the init state
  */
@@ -707,6 +720,7 @@ void __init fpu__init_system_xstate(void)
        fpu__init_prepare_fx_sw_frame();
        setup_init_fpu_buf();
        setup_xstate_comp();
+       print_xstate_offset_size();
 
        pr_info("x86/fpu: Enabled xstate features 0x%llx, context size is %d bytes, using '%s' format.\n",
                xfeatures_mask,