public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 1/2] x86: head_64.S cleanup - use predefined flags from processor-flags.h
       [not found] <20080508150756.053095824@gmail.com>
@ 2008-05-08 15:07 ` Cyrill Gorcunov
  2008-05-08 15:07 ` [patch 2/2] x86: compressed/head_64.S " Cyrill Gorcunov
  1 sibling, 0 replies; 2+ messages in thread
From: Cyrill Gorcunov @ 2008-05-08 15:07 UTC (permalink / raw)
  To: Ingo Molnar, H. Peter Anvin; +Cc: linux-kernel, Cyrill Gorcunov

[-- Attachment #1: x86-head-64-S-use-processor-flags --]
[-- Type: text/plain, Size: 1641 bytes --]

We should better use already defined flags from processor-flags.h instead
of defining own ones

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---

[>>> object code check >>>]

original
md5sum: 9cfa6dbf045a046bb5dfb85f8bcfe8c4  arch/x86/kernel/head_64.o
   text    data     bss     dec     hex filename
  37361    4432    8192   49985    c341 arch/x86/kernel/head_64.o

patched
md5sum: 9cfa6dbf045a046bb5dfb85f8bcfe8c4  arch/x86/kernel/head_64.o
   text    data     bss     dec     hex filename
  37361    4432    8192   49985    c341 arch/x86/kernel/head_64.o

[<<< object code check <<<]

Index: linux-2.6.git/arch/x86/kernel/head_64.S
===================================================================
--- linux-2.6.git.orig/arch/x86/kernel/head_64.S	2008-05-08 17:45:34.000000000 +0400
+++ linux-2.6.git/arch/x86/kernel/head_64.S	2008-05-08 17:47:29.000000000 +0400
@@ -18,6 +18,7 @@
 #include <asm/page.h>
 #include <asm/msr.h>
 #include <asm/cache.h>
+#include <asm/processor-flags.h>
 
 #ifdef CONFIG_PARAVIRT
 #include <asm/asm-offsets.h>
@@ -184,14 +185,10 @@ ENTRY(secondary_startup_64)
 1:	wrmsr				/* Make changes effective */
 
 	/* Setup cr0 */
-#define CR0_PM				1		/* protected mode */
-#define CR0_MP				(1<<1)
-#define CR0_ET				(1<<4)
-#define CR0_NE				(1<<5)
-#define CR0_WP				(1<<16)
-#define CR0_AM				(1<<18)
-#define CR0_PAGING 			(1<<31)
-	movl $CR0_PM|CR0_MP|CR0_ET|CR0_NE|CR0_WP|CR0_AM|CR0_PAGING,%eax
+#define CR0_STATE	(X86_CR0_PE | X86_CR0_MP | X86_CR0_ET | \
+			 X86_CR0_NE | X86_CR0_WP | X86_CR0_AM | \
+			 X86_CR0_PG)
+	movl	$CR0_STATE, %eax
 	/* Make changes effective */
 	movq	%rax, %cr0
 

-- 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [patch 2/2] x86: compressed/head_64.S cleanup - use predefined flags from processor-flags.h
       [not found] <20080508150756.053095824@gmail.com>
  2008-05-08 15:07 ` [patch 1/2] x86: head_64.S cleanup - use predefined flags from processor-flags.h Cyrill Gorcunov
@ 2008-05-08 15:07 ` Cyrill Gorcunov
  1 sibling, 0 replies; 2+ messages in thread
From: Cyrill Gorcunov @ 2008-05-08 15:07 UTC (permalink / raw)
  To: Ingo Molnar, H. Peter Anvin; +Cc: linux-kernel, Cyrill Gorcunov

[-- Attachment #1: x86-compressed-head-64-S-pae --]
[-- Type: text/plain, Size: 1604 bytes --]

We should better use already defined flags from processor-flags.h instead
of defining own ones

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---

[>>> object code check >>>]

original
md5sum: 129f24be6df396fb7d8bf998c01fc716  arch/x86/boot/compressed/head_64.o
   text    data     bss     dec     hex filename
    705      48   45056   45809    b2f1 arch/x86/boot/compressed/head_64.o

patched
md5sum: 129f24be6df396fb7d8bf998c01fc716  arch/x86/boot/compressed/head_64-new.o
   text    data     bss     dec     hex filename
    705      48   45056   45809    b2f1 arch/x86/boot/compressed/head_64-new.o

[<<< object code check <<<]

Index: linux-2.6.git/arch/x86/boot/compressed/head_64.S
===================================================================
--- linux-2.6.git.orig/arch/x86/boot/compressed/head_64.S	2008-04-29 21:20:57.000000000 +0400
+++ linux-2.6.git/arch/x86/boot/compressed/head_64.S	2008-05-08 18:37:32.000000000 +0400
@@ -30,6 +30,7 @@
 #include <asm/page.h>
 #include <asm/boot.h>
 #include <asm/msr.h>
+#include <asm/processor-flags.h>
 #include <asm/asm-offsets.h>
 
 .section ".text.head"
@@ -109,7 +110,7 @@ startup_32:
 
 	/* Enable PAE mode */
 	xorl	%eax, %eax
-	orl	$(1 << 5), %eax
+	orl	$(X86_CR4_PAE), %eax
 	movl	%eax, %cr4
 
  /*
@@ -170,7 +171,7 @@ startup_32:
 	pushl	%eax
 
 	/* Enter paged protected Mode, activating Long Mode */
-	movl	$0x80000001, %eax /* Enable Paging and Protected mode */
+	movl	$(X86_CR0_PG | X86_CR0_PE), %eax /* Enable Paging and Protected mode */
 	movl	%eax, %cr0
 
 	/* Jump from 32bit compatibility mode into 64bit mode. */

-- 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-05-08 15:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20080508150756.053095824@gmail.com>
2008-05-08 15:07 ` [patch 1/2] x86: head_64.S cleanup - use predefined flags from processor-flags.h Cyrill Gorcunov
2008-05-08 15:07 ` [patch 2/2] x86: compressed/head_64.S " Cyrill Gorcunov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox