Name: Make PPC64 Use r14 For Per-Cpu Data Status: Untested Version: ppc64 Signed-off-by: Rusty Russell (authored) To quote Anton Blanchard : I just had a look at what a percpu data access looks like on ppc64: lhz 0,18(13) /* smp_processor_id() */ ld 8,.LC92@toc(2) /* __per_cpu_offset */ ld 9,.LC108@toc(2) /* per_cpu__total_mmio_ffs */ sldi 0,0,3 /* smp_processor_id() * 8 */ mr 10,9 /* gcc sucks */ ldx 11,8,0 /* __per_cpu_offset[smp_processor_id()] */ ldx 9,10,11 /* finally, load our per cpu variable */ Reserve r14 for the per-cpu pointer, and try to convince the linker to do the right thing. diff -urNp --exclude TAGS -X /home/rusty/current-dontdiff --minimal ppc64-2.5-paca-r14/arch/ppc64/Makefile linux-ppc64-2.5/arch/ppc64/Makefile --- ppc64-2.5-paca-r14/arch/ppc64/Makefile 2004-06-07 12:05:50.000000000 +1000 +++ linux-ppc64-2.5/arch/ppc64/Makefile 2004-07-08 15:10:21.236833494 +1000 @@ -27,7 +27,7 @@ CHECK := $(CHECK) -m64 -D__powerpc__=1 LDFLAGS := -m elf64ppc LDFLAGS_vmlinux := -Bstatic -e $(KERNELLOAD) -Ttext $(KERNELLOAD) CFLAGS += -msoft-float -pipe -Wno-uninitialized -mminimal-toc \ - -mtraceback=none + -mtraceback=none -ffixed-r14 ifeq ($(CONFIG_POWER4_ONLY),y) CFLAGS += $(call check_gcc,-mcpu=power4,)