]> git.baikalelectronics.ru Git - kernel.git/commit
alpha: fix module load failures on smp (bug #10926)
authorIvan Kokshaysky <ink@jurassic.park.msu.ru>
Fri, 20 Jun 2008 23:25:39 +0000 (03:25 +0400)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 20 Jun 2008 23:46:10 +0000 (16:46 -0700)
commit435446d3d78f6e10511405e30c5e33e532f28c15
tree9823a76657f257d71aac2a5f4374c56560dd2e6e
parent4452f89795cdaa933ce04d8de61b88dfb6ce0465
alpha: fix module load failures on smp (bug #10926)

To calculate addresses of locally defined variables, GCC uses 32-bit
displacement from the GP. Which doesn't work for per cpu variables in
modules, as an offset to the kernel per cpu area is way above 4G.

The workaround is to force allocation of a GOT entry for per cpu variable
using ldq instruction with a 'literal' relocation.
I had to use custom asm/percpu.h, as a required argument magic doesn't
work with asm-generic/percpu.h macros.

Signed-off-by: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/asm-alpha/percpu.h