linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86_32: Remove unnecessary use of %ebx as the boot cpu flag
@ 2008-01-21 22:15 Ian Campbell
  2008-01-22 13:47 ` Ingo Molnar
  0 siblings, 1 reply; 2+ messages in thread
From: Ian Campbell @ 2008-01-21 22:15 UTC (permalink / raw)
  To: linux-kernel
  Cc: Ian Campbell, Eric W. Biederman, Thomas Gleixner, Ingo Molnar,
	H. Peter Anvin, Andi Kleen, Mika Penttilä

Currently in head_32.S there are two ways we test to see if we
are the boot cpu.  By looking at %ebx and by looking at the
static variable ready.  When changing things around I have
found that it gets tricky to preserve %ebx.  So this
patch just switches head.S over to the more reliable
test of always using ready.

Hopefully later we can kill these tests entirely.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Ian Campbell <ijc@hellion.org.uk>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Mika Penttilä <mika.penttila@kolumbus.fi>
---
 arch/x86/kernel/head_32.S |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)

diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S
index f409fe2..7b9b256 100644
--- a/arch/x86/kernel/head_32.S
+++ b/arch/x86/kernel/head_32.S
@@ -199,7 +199,6 @@ default_entry:
 	addl $0x67, %eax			/* 0x67 == _PAGE_TABLE */
 	movl %eax, 4092(%edx)
 
-	xorl %ebx,%ebx				/* This is the boot CPU (BSP) */
 	jmp 3f
 /*
  * Non-boot CPU entry point; entered from trampoline.S
@@ -268,10 +267,6 @@ ENTRY(startup_32_smp)
 	wrmsr
 
 6:
-	/* This is a secondary processor (AP) */
-	xorl %ebx,%ebx
-	incl %ebx
-
 #endif /* CONFIG_SMP */
 3:
 
@@ -297,7 +292,7 @@ ENTRY(startup_32_smp)
 	popfl
 
 #ifdef CONFIG_SMP
-	andl %ebx,%ebx
+	cmpb $0, ready
 	jz  1f				/* Initial CPU cleans BSS */
 	jmp checkCPUtype
 1:
-- 
1.5.3.8


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

* Re: [PATCH] x86_32: Remove unnecessary use of %ebx as the boot cpu flag
  2008-01-21 22:15 [PATCH] x86_32: Remove unnecessary use of %ebx as the boot cpu flag Ian Campbell
@ 2008-01-22 13:47 ` Ingo Molnar
  0 siblings, 0 replies; 2+ messages in thread
From: Ingo Molnar @ 2008-01-22 13:47 UTC (permalink / raw)
  To: Ian Campbell
  Cc: linux-kernel, Eric W. Biederman, Thomas Gleixner, Ingo Molnar,
	H. Peter Anvin, Andi Kleen, Mika Penttilä


* Ian Campbell <ijc@hellion.org.uk> wrote:

> Currently in head_32.S there are two ways we test to see if we are the 
> boot cpu.  By looking at %ebx and by looking at the static variable 
> ready.  When changing things around I have found that it gets tricky 
> to preserve %ebx.  So this patch just switches head.S over to the more 
> reliable test of always using ready.
> 
> Hopefully later we can kill these tests entirely.

FYI, i've applied this patch and your next patch to x86.git. (still 
waiting with the third patch, until your discussion of this topic with 
Peter settles down.) Thanks,

	Ingo

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

end of thread, other threads:[~2008-01-22 13:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-21 22:15 [PATCH] x86_32: Remove unnecessary use of %ebx as the boot cpu flag Ian Campbell
2008-01-22 13:47 ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).