]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc: Emulate non privileged DSCR read and write
authorAnton Blanchard <anton@samba.org>
Wed, 1 May 2013 20:06:33 +0000 (20:06 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Sun, 5 May 2013 23:25:35 +0000 (09:25 +1000)
commit8c702016fb59674a10085d9131e5161fe5bc847f
treed4831170cd6c5373f0daab7589e70a4821c9099d
parent5d6d12dc7d02bfbfa6b2575e16efd3200b2c63c6
powerpc: Emulate non privileged DSCR read and write

POWER8 allows read and write of the DSCR in userspace. We added
kernel emulation so applications could always use the instructions
regardless of the CPU type.

Unfortunately there are two SPRs for the DSCR and we only added
emulation for the privileged one. Add code to match the non
privileged one.

A simple test was created to verify the fix:

http://ozlabs.org/~anton/junkcode/user_dscr_test.c

Without the patch we get a SIGILL and it passes with the patch.

Signed-off-by: Anton Blanchard <anton@samba.org>
Cc: <stable@kernel.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/include/asm/ppc-opcode.h
arch/powerpc/kernel/traps.c