]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] variable overflow after hundreds round of hotplug CPU
authorShaohua Li <shaohua.li@intel.com>
Sat, 25 Jun 2005 21:54:49 +0000 (14:54 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Sat, 25 Jun 2005 23:24:28 +0000 (16:24 -0700)
I'm doing the cpu hotplug stress test and found a variable ('ready') is
overflow after several hundreds rounds of cpu hotplug.  Here is a fix.

Signed-off-by: Shaohua Li<shaohua.li@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/i386/kernel/head.S

index e966fc8c44c49711f0fecbbc03cc183656aa6b40..4477bb107098c2863ee85a0ef8a27374147ca494 100644 (file)
@@ -299,7 +299,6 @@ is386:      movl $2,%ecx            # set MP
        movl %eax,%cr0
 
        call check_x87
-       incb ready
        lgdt cpu_gdt_descr
        lidt idt_descr
        ljmp $(__KERNEL_CS),$1f
@@ -316,8 +315,9 @@ is386:      movl $2,%ecx            # set MP
        lldt %ax
        cld                     # gcc2 wants the direction flag cleared at all times
 #ifdef CONFIG_SMP
-       movb ready, %cl 
-       cmpb $1,%cl
+       movb ready, %cl
+       movb $1, ready
+       cmpb $0,%cl
        je 1f                   # the first CPU calls start_kernel
                                # all other CPUs call initialize_secondary
        call initialize_secondary