Skip to contentSkip to conversation

i386: allow disabling X86_FEATURE_SEP at boot

PATCH In review Chuck Ebbert 2 participants 2 messages Jan 26, 2006 – Jan 27, 2006 Documentation

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i386: allow disabling X86_FEATURE_SEP at boot

Allow the x86 "sep" feature to be disabled at bootup. This forces use of the int80 vsyscall.

 Documentation/kernel-parameters.txt |    6 +++++-
 arch/i386/kernel/cpu/common.c       |   13 +++++++++++++
 2 files changed, 18 insertions(+), 1 deletion(-)
arch/i386/kernel/cpu/common.c +13 -0
@@ -27,6 +27,7 @@ EXPORT_PER_CPU_SYMBOL(cpu_16bit_stack);
 static int cachesize_override __devinitdata = -1;
 static int disable_x86_fxsr __devinitdata = 0;
 static int disable_x86_serial_nr __devinitdata = 1;
+static int disable_x86_sep __devinitdata = 0;
 
 struct cpu_dev * cpu_devs[X86_VENDOR_NUM] = {};
 
@@ -177,6 +178,14 @@ static int __init x86_fxsr_setup(char * 
 __setup("nofxsr", x86_fxsr_setup);
 
 
+static int __init x86_sep_setup(char * s)
+{
+	disable_x86_sep = 1;
+	return 1;
+}
+__setup("nosep", x86_sep_setup);
+
+
 /* Standard macro to see if a specific flag is changeable */
 static inline int flag_is_changeable_p(u32 flag)
 {
@@ -392,6 +401,10 @@ void __devinit identify_cpu(struct cpuin
 		clear_bit(X86_FEATURE_XMM, c->x86_capability);
 	}
 
+	/* SEP disabled? */
+	if (disable_x86_sep)
+		clear_bit(X86_FEATURE_SEP, c->x86_capability);
+
 	if (disable_pse)
 		clear_bit(X86_FEATURE_PSE, c->x86_capability);
 
Documentation/kernel-parameters.txt +5 -1
@@ -929,7 +929,9 @@ running once the system is up.
 			noexec=on: enable non-executable mappings (default)
 			noexec=off: disable nn-executable mappings
 
-	nofxsr		[BUGS=IA-32]
+	nofxsr		[BUGS=IA-32] Disables x86 floating point extended
+			register save and restore. The kernel will only save
+			legacy floating-point registers on task switch.
 
 	nohlt		[BUGS=ARM]
 
@@ -972,6 +974,8 @@ running once the system is up.
 
 	nosbagart	[IA-64]
 
+	nosep		[BUGS=IA-32] Disables x86 SYSENTER/SYSEXIT support.
+
 	nosmp		[SMP] Tells an SMP kernel to act as a UP kernel.
 
 	nosync		[HW,M68K] Disables sync negotiation for all devices.
Signature · 2 lines
Chuck
Currently reading: _The Atrocity Archives_ by Charles Stross
#1 lore raw
Quoted 4 lines · Chuck Ebbert

Allow the x86 "sep" feature to be disabled at bootup. This forces use of the int80 vsyscall.

Why is there a need to do this?

arch/i386/kernel/cpu/common.c EXPORT_PER_CPU_SYMBOL(cpu_16bit_stack); · line 31

Quoted 13 lines
 Documentation/kernel-parameters.txt |    6 +++++-
 arch/i386/kernel/cpu/common.c       |   13 +++++++++++++
 2 files changed, 18 insertions(+), 1 deletion(-)
arch/i386/kernel/cpu/common.c +1 -0
@@ -27,6 +27,7 @@ EXPORT_PER_CPU_SYMBOL(cpu_16bit_stack);
 static int cachesize_override __devinitdata = -1;
 static int disable_x86_fxsr __devinitdata = 0;
 static int disable_x86_serial_nr __devinitdata = 1;
+static int disable_x86_sep __devinitdata = 0;
 

hm, I guess lots of things in there should be __cpuinit/__cpuinitdata. __devinit is a superset of that, but we're being a little wasteful in the case of CONFIG_HOTPLUG&&!CONFIG_HOTPLUG_CPU.