aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel
diff options
context:
space:
mode:
authorYu-cheng Yu <yu-cheng.yu@intel.com>2016-06-17 16:07:18 -0400
committerIngo Molnar <mingo@kernel.org>2016-07-10 11:12:10 -0400
commit996952e0148026ac0e512db5cad26e14f4267e8b (patch)
tree83dbea94125160b329979744715a644b81de3f7c /arch/x86/kernel
parent91c3dba7dbc199191272f4a9863f86ea3bfd679f (diff)
x86/fpu/xstate: Fix XSTATE component offset print out
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>
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r--arch/x86/kernel/fpu/xstate.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/arch/x86/kernel/fpu/xstate.c b/arch/x86/kernel/fpu/xstate.c
index 56c0e707af21..09bac979b8a2 100644
--- a/arch/x86/kernel/fpu/xstate.c
+++ b/arch/x86/kernel/fpu/xstate.c
@@ -269,8 +269,6 @@ static void __init setup_xstate_features(void)
269 WARN_ONCE(last_good_offset > xstate_offsets[i], 269 WARN_ONCE(last_good_offset > xstate_offsets[i],
270 "x86/fpu: misordered xstate at %d\n", last_good_offset); 270 "x86/fpu: misordered xstate at %d\n", last_good_offset);
271 last_good_offset = xstate_offsets[i]; 271 last_good_offset = xstate_offsets[i];
272
273 printk(KERN_INFO "x86/fpu: xstate_offset[%d]: %4d, xstate_sizes[%d]: %4d\n", i, ebx, i, eax);
274 } 272 }
275} 273}
276 274
@@ -374,6 +372,21 @@ static void __init setup_xstate_comp(void)
374} 372}
375 373
376/* 374/*
375 * Print out xstate component offsets and sizes
376 */
377static void __init print_xstate_offset_size(void)
378{
379 int i;
380
381 for (i = FIRST_EXTENDED_XFEATURE; i < XFEATURE_MAX; i++) {
382 if (!xfeature_enabled(i))
383 continue;
384 pr_info("x86/fpu: xstate_offset[%d]: %4d, xstate_sizes[%d]: %4d\n",
385 i, xstate_comp_offsets[i], i, xstate_sizes[i]);
386 }
387}
388
389/*
377 * setup the xstate image representing the init state 390 * setup the xstate image representing the init state
378 */ 391 */
379static void __init setup_init_fpu_buf(void) 392static void __init setup_init_fpu_buf(void)
@@ -707,6 +720,7 @@ void __init fpu__init_system_xstate(void)
707 fpu__init_prepare_fx_sw_frame(); 720 fpu__init_prepare_fx_sw_frame();
708 setup_init_fpu_buf(); 721 setup_init_fpu_buf();
709 setup_xstate_comp(); 722 setup_xstate_comp();
723 print_xstate_offset_size();
710 724
711 pr_info("x86/fpu: Enabled xstate features 0x%llx, context size is %d bytes, using '%s' format.\n", 725 pr_info("x86/fpu: Enabled xstate features 0x%llx, context size is %d bytes, using '%s' format.\n",
712 xfeatures_mask, 726 xfeatures_mask,