Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1303110

[PATCH 2/4] x86/fpu: Disable XGETBV1 when no XSAVE

From yu-cheng yu <yu-cheng.yu@intel.com>
Newsgroups linux.kernel
Subject [PATCH 2/4] x86/fpu: Disable XGETBV1 when no XSAVE
Date 2016-01-06 23:40 +0100
Message-ID <qO4Ui-7jF-23@gated-at.bofh.it> (permalink)
References <qO4Ui-7jF-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


When "noxsave" is given as a command-line input, the kernel should disable
XGETBV1. This issue currently does not cause any actual problems. XGETBV1
is only useful if we have something using the 'init optimization' (i.e.
xsaveopt, xsaves). We already clear both of those in
fpu__xstate_clear_all_cpu_caps(). But this is good for completeness.

Signed-off-by: Yu-cheng Yu <yu-cheng.yu@intel.com>
Reviewed-by: Dave Hansen <dave.hansen@intel.com>
Cc: x86@kernel.org
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>
Cc: Ravi V. Shankar <ravi.v.shankar@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
---
 arch/x86/kernel/fpu/xstate.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/kernel/fpu/xstate.c b/arch/x86/kernel/fpu/xstate.c
index 70fc312..b27d3b6 100644
--- a/arch/x86/kernel/fpu/xstate.c
+++ b/arch/x86/kernel/fpu/xstate.c
@@ -52,6 +52,7 @@ void fpu__xstate_clear_all_cpu_caps(void)
 	setup_clear_cpu_cap(X86_FEATURE_AVX512ER);
 	setup_clear_cpu_cap(X86_FEATURE_AVX512CD);
 	setup_clear_cpu_cap(X86_FEATURE_MPX);
+	setup_clear_cpu_cap(X86_FEATURE_XGETBV1);
 }
 
 /*
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/4] x86/fpu: FPU init code bugfixes yu-cheng yu <yu-cheng.yu@intel.com> - 2016-01-06 23:40 +0100
  [PATCH 2/4] x86/fpu: Disable XGETBV1 when no XSAVE yu-cheng yu <yu-cheng.yu@intel.com> - 2016-01-06 23:40 +0100
    [tip:x86/asm] x86/fpu: Disable XGETBV1 when no XSAVE tip-bot for yu-cheng yu <tipbot@zytor.com> - 2016-01-12 13:10 +0100
  [PATCH 3/4] x86/fpu: Disable MPX when eagerfpu is off yu-cheng yu <yu-cheng.yu@intel.com> - 2016-01-06 23:40 +0100
    [tip:x86/asm] x86/fpu: Disable MPX when eagerfpu is off tip-bot for yu-cheng yu <tipbot@zytor.com> - 2016-01-12 13:10 +0100
  [PATCH 4/4] x86/fpu: Disable AVX when eagerfpu is off yu-cheng yu <yu-cheng.yu@intel.com> - 2016-01-06 23:40 +0100
    [tip:x86/asm] x86/fpu: Disable AVX when eagerfpu is off tip-bot for yu-cheng yu <tipbot@zytor.com> - 2016-01-12 13:10 +0100
  [PATCH 1/4] x86/fpu: Fix early fpu command-line parsing yu-cheng yu <yu-cheng.yu@intel.com> - 2016-01-06 23:40 +0100
    [tip:x86/asm] x86/fpu: Fix early FPU command-line parsing tip-bot for yu-cheng yu <tipbot@zytor.com> - 2016-01-12 13:10 +0100

csiph-web