i386: fix early usage of atomic_add_return and local_add_return on real i386
PATCH 1/1 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.
include/asm-i386/atomic.h +1 -1
@@ -182,7 +182,7 @@ static __inline__ int atomic_add_return(int __i;#ifdef CONFIG_M386 unsigned long flags; -if (unlikely (boot_cpu_data.x86==3 )) +if (unlikely (boot_cpu_data.x86 <=3 )) goto no_xadd;#endif /* Modern 486+ processor */
include/asm-i386/local.h +1 -1
@@ -135,7 +135,7 @@ static __inline__ long local_add_return(long __i;#ifdef CONFIG_M386 unsigned long flags; -if (unlikely (boot_cpu_data.x86==3 )) +if (unlikely (boot_cpu_data.x86 <=3 )) goto no_xadd;#endif /* Modern 486+ processor */
Quoted 5 lines · Thomas Gleixner
The check (boot_cpu_data.x86 == 3) in
atomic_add_return()andlocal_add_return()fails, when those operations are used beforeboot_cpu_datais filled in.Change the check to (boot_cpu_data.x86 <= 3) to fix this.
That's a critical boot fix for 386, right?
-Andi
Quoted 8 lines · Andi Kleen
Quoted 5 lines · Thomas Gleixner
The check (boot_cpu_data.x86 == 3) in
atomic_add_return()andlocal_add_return()fails, when those operations are used beforeboot_cpu_datais filled in.Change the check to (boot_cpu_data.x86 <= 3) to fix this.
That's a critical boot fix for 386, right?
Yup. Hit me with some debug option enabled, but might happen anywhere else too.
tglx