aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/cpu/common.c
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@citrix.com>2012-08-24 15:58:47 -0400
committerIngo Molnar <mingo@kernel.org>2012-09-13 11:32:47 -0400
commit6eebdda35e6b18d0dddb2a44e34211bd94f0cad6 (patch)
tree16bde5b8ac1386699c4f9d5aef6b3fc68c834551 /arch/x86/kernel/cpu/common.c
parent816afe4ff98ee10b1d30fd66361be132a0a5cee6 (diff)
x86: Drop unnecessary kernel_eflags variable on 64-bit
On 64 bit x86 we save the current eflags in cpu_init for use in ret_from_fork. Strictly speaking reserved bits in EFLAGS should be read as written but in practise it is unlikely that EFLAGS could ever be extended in this way and the kernel alread clears any undefined flags early on. The equivalent 32 bit code simply hard codes 0x0202 as the new EFLAGS. This change makes 64 bit use the same mechanism to setup the initial EFLAGS on fork. Note that 64 bit resets EFLAGS before calling schedule_tail() as opposed to 32 bit which calls schedule_tail() first. Therefore the correct value for EFLAGS has opposite IF bit. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> Acked-by: Andi Kleen <ak@linux.intel.com> Acked-by: "H. Peter Anvin" <hpa@zytor.com> Cc: Brian Gerst <brgerst@gmail.com> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Pekka Enberg <penberg@kernel.org> Cc: Andi Kleen <ak@linux.intel.com> Link: http://lkml.kernel.org/r/20120824195847.GA31628@moon Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/kernel/cpu/common.c')
-rw-r--r--arch/x86/kernel/cpu/common.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index a5fbc3c5fccc..9961e2e23709 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -1116,8 +1116,6 @@ void syscall_init(void)
1116 X86_EFLAGS_TF|X86_EFLAGS_DF|X86_EFLAGS_IF|X86_EFLAGS_IOPL); 1116 X86_EFLAGS_TF|X86_EFLAGS_DF|X86_EFLAGS_IF|X86_EFLAGS_IOPL);
1117} 1117}
1118 1118
1119unsigned long kernel_eflags;
1120
1121/* 1119/*
1122 * Copies of the original ist values from the tss are only accessed during 1120 * Copies of the original ist values from the tss are only accessed during
1123 * debugging, no special alignment required. 1121 * debugging, no special alignment required.
@@ -1299,8 +1297,6 @@ void __cpuinit cpu_init(void)
1299 fpu_init(); 1297 fpu_init();
1300 xsave_init(); 1298 xsave_init();
1301 1299
1302 raw_local_save_flags(kernel_eflags);
1303
1304 if (is_uv_system()) 1300 if (is_uv_system())
1305 uv_cpu_init(); 1301 uv_cpu_init();
1306} 1302}