Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

i386: fix early usage of atomic_add_return and local_add_return on real i386

The check (boot_cpu_data.x86 == 3) in atomic_add_return() and
local_add_return() fails, when those operations are used before
boot_cpu_data is filled in.

Change the check to (boot_cpu_data.x86 <= 3) to fix this.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Thomas Gleixner and committed by
Linus Torvalds
03491c92 98d82567

+2 -2
+1 -1
include/asm-i386/atomic.h
··· 182 182 int __i; 183 183 #ifdef CONFIG_M386 184 184 unsigned long flags; 185 - if(unlikely(boot_cpu_data.x86==3)) 185 + if(unlikely(boot_cpu_data.x86 <= 3)) 186 186 goto no_xadd; 187 187 #endif 188 188 /* Modern 486+ processor */
+1 -1
include/asm-i386/local.h
··· 135 135 long __i; 136 136 #ifdef CONFIG_M386 137 137 unsigned long flags; 138 - if(unlikely(boot_cpu_data.x86==3)) 138 + if(unlikely(boot_cpu_data.x86 <= 3)) 139 139 goto no_xadd; 140 140 #endif 141 141 /* Modern 486+ processor */