aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/cpu
diff options
context:
space:
mode:
authorYinghai Lu <yhlu.kernel@gmail.com>2008-09-05 03:58:28 -0400
committerIngo Molnar <mingo@elte.hu>2008-09-05 04:23:47 -0400
commitbd220a24a9263eaa70d5e6821383085950b5a13c (patch)
treebd91a5d7c46567b807cbbd07f822a4a11a2b01bd /arch/x86/kernel/cpu
parentf5017cfa3591d8eaf5c792e40ff30f18e498b68c (diff)
x86: move nonx_setup etc from common.c to init_64.c
like 32 bit put it in init_32.c Signed-off-by: Yinghai <yhlu.kernel@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/cpu')
-rw-r--r--arch/x86/kernel/cpu/common.c54
1 files changed, 0 insertions, 54 deletions
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index eef868c97b89..286c89a991bd 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -847,51 +847,6 @@ struct desc_ptr idt_descr = { 256 * 16 - 1, (unsigned long) idt_table };
847 847
848char boot_cpu_stack[IRQSTACKSIZE] __page_aligned_bss; 848char boot_cpu_stack[IRQSTACKSIZE] __page_aligned_bss;
849 849
850unsigned long __supported_pte_mask __read_mostly = ~0UL;
851EXPORT_SYMBOL_GPL(__supported_pte_mask);
852
853static int do_not_nx __cpuinitdata;
854
855/* noexec=on|off
856Control non executable mappings for 64bit processes.
857
858on Enable(default)
859off Disable
860*/
861static int __init nonx_setup(char *str)
862{
863 if (!str)
864 return -EINVAL;
865 if (!strncmp(str, "on", 2)) {
866 __supported_pte_mask |= _PAGE_NX;
867 do_not_nx = 0;
868 } else if (!strncmp(str, "off", 3)) {
869 do_not_nx = 1;
870 __supported_pte_mask &= ~_PAGE_NX;
871 }
872 return 0;
873}
874early_param("noexec", nonx_setup);
875
876int force_personality32;
877
878/* noexec32=on|off
879Control non executable heap for 32bit processes.
880To control the stack too use noexec=off
881
882on PROT_READ does not imply PROT_EXEC for 32bit processes (default)
883off PROT_READ implies PROT_EXEC
884*/
885static int __init nonx32_setup(char *str)
886{
887 if (!strcmp(str, "on"))
888 force_personality32 &= ~READ_IMPLIES_EXEC;
889 else if (!strcmp(str, "off"))
890 force_personality32 |= READ_IMPLIES_EXEC;
891 return 1;
892}
893__setup("noexec32=", nonx32_setup);
894
895void pda_init(int cpu) 850void pda_init(int cpu)
896{ 851{
897 struct x8664_pda *pda = cpu_pda(cpu); 852 struct x8664_pda *pda = cpu_pda(cpu);
@@ -957,15 +912,6 @@ void syscall_init(void)
957 X86_EFLAGS_TF|X86_EFLAGS_DF|X86_EFLAGS_IF|X86_EFLAGS_IOPL); 912 X86_EFLAGS_TF|X86_EFLAGS_DF|X86_EFLAGS_IF|X86_EFLAGS_IOPL);
958} 913}
959 914
960void __cpuinit check_efer(void)
961{
962 unsigned long efer;
963
964 rdmsrl(MSR_EFER, efer);
965 if (!(efer & EFER_NX) || do_not_nx)
966 __supported_pte_mask &= ~_PAGE_NX;
967}
968
969unsigned long kernel_eflags; 915unsigned long kernel_eflags;
970 916
971/* 917/*