]> git.itanic.dy.fi Git - linux-stable/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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 11 May 2013 20:53:50 +0000 (13:53 -0700)
commit6c4aedfd654c665080f9e3df38725c65b14be042
tree78799dc9834a1b39bbb61e43f8dfd7dda002f560
parentb6a35381c7142ad8dc0f0f76b7c2bd6d6dd64477
powerpc: Emulate non privileged DSCR read and write

commit 73d2fb758e678c93bc76d40876c2359f0729b0ef upstream.

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>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/powerpc/include/asm/ppc-opcode.h
arch/powerpc/kernel/traps.c