Skip to content

Commit

Permalink
x86_64: initialize this_cpu_off to __per_cpu_load
Browse files Browse the repository at this point in the history
On x86_64, if get_per_cpu_var() is used before per cpu area is setup
(if lockdep is turned on, it happens), it needs this_cpu_off to point
to __per_cpu_load.  Initialize accordingly.

Signed-off-by: Tejun Heo <tj@kernel.org>
  • Loading branch information
Tejun Heo authored and Ingo Molnar committed Jan 16, 2009
1 parent a338af2 commit cd3adf5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions arch/x86/kernel/smpcommon.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@
*/
#include <linux/module.h>
#include <asm/smp.h>
#include <asm/sections.h>

#ifdef CONFIG_X86_64
DEFINE_PER_CPU(unsigned long, this_cpu_off) = (unsigned long)__per_cpu_load;
#else
DEFINE_PER_CPU(unsigned long, this_cpu_off);
#endif
EXPORT_PER_CPU_SYMBOL(this_cpu_off);

#ifdef CONFIG_X86_32
Expand Down

0 comments on commit cd3adf5

Please sign in to comment.