diff options
author | Anton Blanchard <anton@samba.org> | 2012-07-04 16:37:11 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-07-11 00:18:40 -0400 |
commit | 18ad51dd342a7eb09dbcd059d0b451b616d4dafc (patch) | |
tree | 94809605669eb3b5e4e049501958a2fa93ae2de7 /arch/powerpc/kernel/vdso32/Makefile | |
parent | e6a74c6ea331b79c86e1898c504790b3dadc591d (diff) |
powerpc: Add VDSO version of getcpu
We have a request for a fast method of getting CPU and NUMA node IDs
from userspace. This patch implements a getcpu VDSO function,
similar to x86.
Ben suggested we use SPRG3 which is userspace readable. SPRG3 can be
modified by a KVM guest, so we save the SPRG3 value in the paca and
restore it when transitioning from the guest to the host.
I have a glibc patch that implements sched_getcpu on top of this.
Testing on a POWER7:
baseline: 538 cycles
vdso: 30 cycles
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel/vdso32/Makefile')
-rw-r--r-- | arch/powerpc/kernel/vdso32/Makefile | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/vdso32/Makefile b/arch/powerpc/kernel/vdso32/Makefile index 9a7946c41738..53e6c9b979ec 100644 --- a/arch/powerpc/kernel/vdso32/Makefile +++ b/arch/powerpc/kernel/vdso32/Makefile | |||
@@ -1,7 +1,9 @@ | |||
1 | 1 | ||
2 | # List of files in the vdso, has to be asm only for now | 2 | # List of files in the vdso, has to be asm only for now |
3 | 3 | ||
4 | obj-vdso32 = sigtramp.o gettimeofday.o datapage.o cacheflush.o note.o | 4 | obj-vdso32-$(CONFIG_PPC64) = getcpu.o |
5 | obj-vdso32 = sigtramp.o gettimeofday.o datapage.o cacheflush.o note.o \ | ||
6 | $(obj-vdso32-y) | ||
5 | 7 | ||
6 | # Build rules | 8 | # Build rules |
7 | 9 | ||