lkml.org 
[lkml]   [2013]   [Feb]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 5/5 -v2] x86, head_32: Clear DF much earlier
Date
From: Borislav Petkov <bp@suse.de>

All GCC versions expect the direction flag to be cleared (DF=0) so move
this to the default entry point for each core.

Signed-off-by: Borislav Petkov <bp@suse.de>
---
arch/x86/kernel/head_32.S | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S
index 75e96d7e4e5f..8b2a8a824fc6 100644
--- a/arch/x86/kernel/head_32.S
+++ b/arch/x86/kernel/head_32.S
@@ -322,10 +322,11 @@ default_entry:
* debugger if this code is traced. Best to initialize before switching to
* protected mode.
*/
-
pushl $0
popfl

+ cld # GCC wants DF=0 at all times
+
/*
* New page tables may be in 4Mbyte page mode and may be using the global pages.
*
@@ -463,7 +464,6 @@ is486:
xorl %eax,%eax # Clear LDT
lldt %ax

- cld # gcc2 wants the direction flag cleared at all times
pushl $0 # fake return address for unwinder
jmp *(initial_code)

--
1.8.1.3.535.ga923c31


\
 
 \ /
  Last update: 2013-02-09 23:41    [W:0.078 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site