aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/traps.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel/traps.c')
-rw-r--r--arch/powerpc/kernel/traps.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index 5ddb801bc154..cb71cf29edea 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -909,6 +909,26 @@ static int emulate_instruction(struct pt_regs *regs)
909 return emulate_isel(regs, instword); 909 return emulate_isel(regs, instword);
910 } 910 }
911 911
912#ifdef CONFIG_PPC64
913 /* Emulate the mfspr rD, DSCR. */
914 if (((instword & PPC_INST_MFSPR_DSCR_MASK) == PPC_INST_MFSPR_DSCR) &&
915 cpu_has_feature(CPU_FTR_DSCR)) {
916 PPC_WARN_EMULATED(mfdscr, regs);
917 rd = (instword >> 21) & 0x1f;
918 regs->gpr[rd] = mfspr(SPRN_DSCR);
919 return 0;
920 }
921 /* Emulate the mtspr DSCR, rD. */
922 if (((instword & PPC_INST_MTSPR_DSCR_MASK) == PPC_INST_MTSPR_DSCR) &&
923 cpu_has_feature(CPU_FTR_DSCR)) {
924 PPC_WARN_EMULATED(mtdscr, regs);
925 rd = (instword >> 21) & 0x1f;
926 mtspr(SPRN_DSCR, regs->gpr[rd]);
927 current->thread.dscr_inherit = 1;
928 return 0;
929 }
930#endif
931
912 return -EINVAL; 932 return -EINVAL;
913} 933}
914 934
@@ -1506,6 +1526,10 @@ struct ppc_emulated ppc_emulated = {
1506#ifdef CONFIG_VSX 1526#ifdef CONFIG_VSX
1507 WARN_EMULATED_SETUP(vsx), 1527 WARN_EMULATED_SETUP(vsx),
1508#endif 1528#endif
1529#ifdef CONFIG_PPC64
1530 WARN_EMULATED_SETUP(mfdscr),
1531 WARN_EMULATED_SETUP(mtdscr),
1532#endif
1509}; 1533};
1510 1534
1511u32 ppc_warn_emulated; 1535u32 ppc_warn_emulated;