]> git.karo-electronics.de Git - linux-beck.git/commitdiff
x86: Drop unnecessary kernel_eflags variable on 64-bit
authorIan Campbell <ian.campbell@citrix.com>
Fri, 24 Aug 2012 19:58:47 +0000 (23:58 +0400)
committerIngo Molnar <mingo@kernel.org>
Thu, 13 Sep 2012 15:32:47 +0000 (17:32 +0200)
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>
arch/x86/include/asm/processor.h
arch/x86/kernel/cpu/common.c
arch/x86/kernel/entry_64.S

index d048cad9bcad4b8c48c62279d7b73eb0499305d7..9738b39e4eb99ed62e89c88e1168b8e4baf0bc4a 100644 (file)
@@ -423,7 +423,6 @@ DECLARE_INIT_PER_CPU(irq_stack_union);
 
 DECLARE_PER_CPU(char *, irq_stack_ptr);
 DECLARE_PER_CPU(unsigned int, irq_count);
-extern unsigned long kernel_eflags;
 extern asmlinkage void ignore_sysret(void);
 #else  /* X86_64 */
 #ifdef CONFIG_CC_STACKPROTECTOR
index a5fbc3c5fccc5e60d61d9ec8f1d3f9f60a2a0467..9961e2e23709c6fe4621448e9dbbf8f6406c91d8 100644 (file)
@@ -1116,8 +1116,6 @@ void syscall_init(void)
               X86_EFLAGS_TF|X86_EFLAGS_DF|X86_EFLAGS_IF|X86_EFLAGS_IOPL);
 }
 
-unsigned long kernel_eflags;
-
 /*
  * Copies of the original ist values from the tss are only accessed during
  * debugging, no special alignment required.
@@ -1299,8 +1297,6 @@ void __cpuinit cpu_init(void)
        fpu_init();
        xsave_init();
 
-       raw_local_save_flags(kernel_eflags);
-
        if (is_uv_system())
                uv_cpu_init();
 }
index 69babd8c834f920b4d54c48e1f41a08d4f7fef6f..b1dac12dc5e62b0037791345cbd685160b33cafd 100644 (file)
@@ -440,7 +440,7 @@ ENTRY(ret_from_fork)
 
        LOCK ; btr $TIF_FORK,TI_flags(%r8)
 
-       pushq_cfi kernel_eflags(%rip)
+       pushq_cfi $0x0002
        popfq_cfi                               # reset kernel eflags
 
        call schedule_tail                      # rdi: 'prev' task parameter