mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] x86: xsave.h needs user.h
@ 2014-11-11 22:01 Dave Hansen
  2014-11-11 22:01 ` [PATCH 2/2] x86: require exact match for "noxsave" command line option Dave Hansen
  2014-11-16 12:34 ` [tip:x86/fpu] x86: Add #include user.h to xsave.h tip-bot for Dave Hansen
  0 siblings, 2 replies; 5+ messages in thread
From: Dave Hansen @ 2014-11-11 22:01 UTC (permalink / raw)
  To: linux-kernel; +Cc: Dave Hansen, dave.hansen, fenghua.yu, x86


From: Dave Hansen <dave.hansen@linux.intel.com>

xsave.h uses USER_XSTATE_FX_SW_WORDS, but does not include user.h.

Add the include.

Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: x86@kernel.org

---

 b/arch/x86/include/asm/xsave.h |    1 +
 1 file changed, 1 insertion(+)

diff -puN arch/x86/include/asm/xsave.h~x86-xsave.h-needs-user.h arch/x86/include/asm/xsave.h
--- a/arch/x86/include/asm/xsave.h~x86-xsave.h-needs-user.h	2014-11-11 14:00:18.844366889 -0800
+++ b/arch/x86/include/asm/xsave.h	2014-11-11 14:00:18.846366979 -0800
@@ -3,6 +3,7 @@
 
 #include <linux/types.h>
 #include <asm/processor.h>
+#include <asm/user.h>
 
 #define XSTATE_CPUID		0x0000000d
 
_

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 2/2] x86: require exact match for "noxsave" command line option
  2014-11-11 22:01 [PATCH 1/2] x86: xsave.h needs user.h Dave Hansen
@ 2014-11-11 22:01 ` Dave Hansen
  2014-11-16 11:15   ` [tip:x86/urgent] x86: Require exact match for 'noxsave' " tip-bot for Dave Hansen
  2014-11-16 12:34   ` [tip:x86/fpu] x86: Require exact match for "noxsave" " tip-bot for Dave Hansen
  2014-11-16 12:34 ` [tip:x86/fpu] x86: Add #include user.h to xsave.h tip-bot for Dave Hansen
  1 sibling, 2 replies; 5+ messages in thread
From: Dave Hansen @ 2014-11-11 22:01 UTC (permalink / raw)
  To: linux-kernel; +Cc: Dave Hansen, dave.hansen, fenghua.yu, x86


From: Dave Hansen <dave.hansen@linux.intel.com>

We have some very similarly named command-line options:

arch/x86/kernel/cpu/common.c:__setup("noxsave", x86_xsave_setup);
arch/x86/kernel/cpu/common.c:__setup("noxsaveopt", x86_xsaveopt_setup);
arch/x86/kernel/cpu/common.c:__setup("noxsaves", x86_xsaves_setup);

__setup() is designed to match options that take arguments, like
"foo=bar" where you would have:

	__setup("foo", x86_foo_func...);

The problem is that "noxsave" actually _matches_ "noxsaves" in
the same way that "foo" matches "foo=bar".  If you boot an old
kernel that does not know about "noxsaves" with "noxsaves" on the
command line, it will interpret the argument as "noxsave", which
is not what you want at all.

This makes the "noxsave" handler only return success when it finds
an *exact* match.

We should try and get this patch in to as many old kernels as
possible.

Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: x86@kernel.org

---

 b/arch/x86/kernel/cpu/common.c |    2 ++
 1 file changed, 2 insertions(+)

diff -puN arch/x86/kernel/cpu/common.c~mpx-xsave-setup-exact arch/x86/kernel/cpu/common.c
--- a/arch/x86/kernel/cpu/common.c~mpx-xsave-setup-exact	2014-11-11 14:00:19.061376676 -0800
+++ b/arch/x86/kernel/cpu/common.c	2014-11-11 14:00:19.063376767 -0800
@@ -146,6 +146,8 @@ EXPORT_PER_CPU_SYMBOL_GPL(gdt_page);
 
 static int __init x86_xsave_setup(char *s)
 {
+	if (strlen(s))
+		return 0;
 	setup_clear_cpu_cap(X86_FEATURE_XSAVE);
 	setup_clear_cpu_cap(X86_FEATURE_XSAVEOPT);
 	setup_clear_cpu_cap(X86_FEATURE_XSAVES);
_

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [tip:x86/urgent] x86: Require exact match for 'noxsave' command line option
  2014-11-11 22:01 ` [PATCH 2/2] x86: require exact match for "noxsave" command line option Dave Hansen
@ 2014-11-16 11:15   ` tip-bot for Dave Hansen
  2014-11-16 12:34   ` [tip:x86/fpu] x86: Require exact match for "noxsave" " tip-bot for Dave Hansen
  1 sibling, 0 replies; 5+ messages in thread
From: tip-bot for Dave Hansen @ 2014-11-16 11:15 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, tglx, dave.hansen, mingo, fenghua.yu, dave, hpa

Commit-ID:  2cd3949f702692cf4c5d05b463f19cd706a92dd3
Gitweb:     http://git.kernel.org/tip/2cd3949f702692cf4c5d05b463f19cd706a92dd3
Author:     Dave Hansen <dave.hansen@linux.intel.com>
AuthorDate: Tue, 11 Nov 2014 14:01:33 -0800
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Sun, 16 Nov 2014 12:13:16 +0100

x86: Require exact match for 'noxsave' command line option

We have some very similarly named command-line options:

arch/x86/kernel/cpu/common.c:__setup("noxsave", x86_xsave_setup);
arch/x86/kernel/cpu/common.c:__setup("noxsaveopt", x86_xsaveopt_setup);
arch/x86/kernel/cpu/common.c:__setup("noxsaves", x86_xsaves_setup);

__setup() is designed to match options that take arguments, like
"foo=bar" where you would have:

	__setup("foo", x86_foo_func...);

The problem is that "noxsave" actually _matches_ "noxsaves" in
the same way that "foo" matches "foo=bar".  If you boot an old
kernel that does not know about "noxsaves" with "noxsaves" on the
command line, it will interpret the argument as "noxsave", which
is not what you want at all.

This makes the "noxsave" handler only return success when it finds
an *exact* match.

[ tglx: We really need to make __setup() more robust. ]

Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Dave Hansen <dave@sr71.net>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: x86@kernel.org
Cc: stable@vger.kernel.org
Link: http://lkml.kernel.org/r/20141111220133.FE053984@viggo.jf.intel.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

---
 arch/x86/kernel/cpu/common.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 4b4f78c..cfa9b5b 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -146,6 +146,8 @@ EXPORT_PER_CPU_SYMBOL_GPL(gdt_page);
 
 static int __init x86_xsave_setup(char *s)
 {
+	if (strlen(s))
+		return 0;
 	setup_clear_cpu_cap(X86_FEATURE_XSAVE);
 	setup_clear_cpu_cap(X86_FEATURE_XSAVEOPT);
 	setup_clear_cpu_cap(X86_FEATURE_XSAVES);

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [tip:x86/fpu] x86: Add #include user.h to xsave.h
  2014-11-11 22:01 [PATCH 1/2] x86: xsave.h needs user.h Dave Hansen
  2014-11-11 22:01 ` [PATCH 2/2] x86: require exact match for "noxsave" command line option Dave Hansen
@ 2014-11-16 12:34 ` tip-bot for Dave Hansen
  1 sibling, 0 replies; 5+ messages in thread
From: tip-bot for Dave Hansen @ 2014-11-16 12:34 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: fenghua.yu, mingo, tglx, dave.hansen, hpa, linux-kernel

Commit-ID:  b48cbd27b38ed3aef56a02dca2a4853fa5dabb1f
Gitweb:     http://git.kernel.org/tip/b48cbd27b38ed3aef56a02dca2a4853fa5dabb1f
Author:     Dave Hansen <dave.hansen@linux.intel.com>
AuthorDate: Tue, 11 Nov 2014 14:01:31 -0800
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Sun, 16 Nov 2014 11:30:39 +0100

x86: Add #include user.h to xsave.h

xsave.h uses USER_XSTATE_FX_SW_WORDS, but does not include
user.h.

Add the include.

Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Link: http://lkml.kernel.org/r/20141111220131.D86EE670@viggo.jf.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/include/asm/xsave.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/include/asm/xsave.h b/arch/x86/include/asm/xsave.h
index 7e7a79a..047797a 100644
--- a/arch/x86/include/asm/xsave.h
+++ b/arch/x86/include/asm/xsave.h
@@ -3,6 +3,7 @@
 
 #include <linux/types.h>
 #include <asm/processor.h>
+#include <asm/user.h>
 
 #define XSTATE_CPUID		0x0000000d
 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [tip:x86/fpu] x86: Require exact match for "noxsave" command line option
  2014-11-11 22:01 ` [PATCH 2/2] x86: require exact match for "noxsave" command line option Dave Hansen
  2014-11-16 11:15   ` [tip:x86/urgent] x86: Require exact match for 'noxsave' " tip-bot for Dave Hansen
@ 2014-11-16 12:34   ` tip-bot for Dave Hansen
  1 sibling, 0 replies; 5+ messages in thread
From: tip-bot for Dave Hansen @ 2014-11-16 12:34 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: fenghua.yu, torvalds, dave.hansen, mingo, tglx, hpa, linux-kernel

Commit-ID:  f9017963878933fc1d8fff85a9365a0d29104565
Gitweb:     http://git.kernel.org/tip/f9017963878933fc1d8fff85a9365a0d29104565
Author:     Dave Hansen <dave.hansen@linux.intel.com>
AuthorDate: Tue, 11 Nov 2014 14:01:33 -0800
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Sun, 16 Nov 2014 11:30:40 +0100

x86: Require exact match for "noxsave" command line option

We have some very similarly named command-line options:

  arch/x86/kernel/cpu/common.c:__setup("noxsave", x86_xsave_setup);
  arch/x86/kernel/cpu/common.c:__setup("noxsaveopt", x86_xsaveopt_setup);
  arch/x86/kernel/cpu/common.c:__setup("noxsaves", x86_xsaves_setup);

__setup() is designed to match options that take arguments, like
"foo=bar" where you would have:

	__setup("foo", x86_foo_func...);

The problem is that "noxsave" actually _matches_ "noxsaves" in
the same way that "foo" matches "foo=bar".  If you boot an old
kernel that does not know about "noxsaves" with "noxsaves" on
the command line, it will interpret the argument as "noxsave",
which is not what you want at all.

This makes the "noxsave" handler only return success when it
finds an *exact* match.

We should try and get this patch in to as many old kernels as
possible.

Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: http://lkml.kernel.org/r/20141111220133.FE053984@viggo.jf.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/kernel/cpu/common.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 4b4f78c..cfa9b5b 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -146,6 +146,8 @@ EXPORT_PER_CPU_SYMBOL_GPL(gdt_page);
 
 static int __init x86_xsave_setup(char *s)
 {
+	if (strlen(s))
+		return 0;
 	setup_clear_cpu_cap(X86_FEATURE_XSAVE);
 	setup_clear_cpu_cap(X86_FEATURE_XSAVEOPT);
 	setup_clear_cpu_cap(X86_FEATURE_XSAVES);

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-11-16 12:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-11 22:01 [PATCH 1/2] x86: xsave.h needs user.h Dave Hansen
2014-11-11 22:01 ` [PATCH 2/2] x86: require exact match for "noxsave" command line option Dave Hansen
2014-11-16 11:15   ` [tip:x86/urgent] x86: Require exact match for 'noxsave' " tip-bot for Dave Hansen
2014-11-16 12:34   ` [tip:x86/fpu] x86: Require exact match for "noxsave" " tip-bot for Dave Hansen
2014-11-16 12:34 ` [tip:x86/fpu] x86: Add #include user.h to xsave.h tip-bot for Dave Hansen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome