aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2013-05-01 16:06:33 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-05-05 19:25:35 -0400
commit73d2fb758e678c93bc76d40876c2359f0729b0ef (patch)
treed4831170cd6c5373f0daab7589e70a4821c9099d /arch/powerpc/include
parent01227a889ed56ae53aeebb9f93be9d54dd8b2de8 (diff)
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>
Diffstat (limited to 'arch/powerpc/include')
-rw-r--r--arch/powerpc/include/asm/ppc-opcode.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/ppc-opcode.h b/arch/powerpc/include/asm/ppc-opcode.h
index 0c34e4803499..eccfc161e58e 100644
--- a/arch/powerpc/include/asm/ppc-opcode.h
+++ b/arch/powerpc/include/asm/ppc-opcode.h
@@ -115,6 +115,10 @@
115#define PPC_INST_MFSPR_DSCR_MASK 0xfc1fffff 115#define PPC_INST_MFSPR_DSCR_MASK 0xfc1fffff
116#define PPC_INST_MTSPR_DSCR 0x7c1103a6 116#define PPC_INST_MTSPR_DSCR 0x7c1103a6
117#define PPC_INST_MTSPR_DSCR_MASK 0xfc1fffff 117#define PPC_INST_MTSPR_DSCR_MASK 0xfc1fffff
118#define PPC_INST_MFSPR_DSCR_USER 0x7c0302a6
119#define PPC_INST_MFSPR_DSCR_USER_MASK 0xfc1fffff
120#define PPC_INST_MTSPR_DSCR_USER 0x7c0303a6
121#define PPC_INST_MTSPR_DSCR_USER_MASK 0xfc1fffff
118#define PPC_INST_SLBFEE 0x7c0007a7 122#define PPC_INST_SLBFEE 0x7c0007a7
119 123
120#define PPC_INST_STRING 0x7c00042a 124#define PPC_INST_STRING 0x7c00042a