RFC: ESR_I/DLK processing
From: Jimi Xenidis <hidden>
Date: 2011-10-28 20:43:57
arch/powerpc/kernel/head_fsl_booke.S has the following code:
/* Data Storage Interrupt */ START_EXCEPTION(DataStorage) NORMAL_EXCEPTION_PROLOG mfspr r5,SPRN_ESR /* Grab the ESR, save it, pass =
arg3 */
stw r5,_ESR(r11) mfspr r4,SPRN_DEAR /* Grab the DEAR, save it, pass =
arg2 */
andis. r10,r5,(ESR_ILK|ESR_DLK)@h bne 1f EXC_XFER_EE_LITE(0x0300, handle_page_fault) 1: addi r3,r1,STACK_FRAME_OVERHEAD EXC_XFER_EE_LITE(0x0300, CacheLockingException)
I need something similar for A2 (and all book3e) and was wondering, why = this isn't just:
quoted hunk
diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c index 88abe70..8451822 100644 --- a/arch/powerpc/mm/fault.c +++ b/arch/powerpc/mm/fault.c@@ -159,6 +159,14 @@ int __kprobes do_page_fault(struct pt_regs *regs, =
unsigned long address,
}
#endif
=20
+#ifdef CONFIG_PPC_BOOK3E
+ if (error_code & (ESR_DLK|ESR_ILK)) {
+ /* detect that this is a privileged op and SIGILL */
+ _exception(SIGILL, regs, ILL_PRVOPC, regs->nip);
+ return 0;
+ }
+#endif
+
if (notify_page_fault(regs))
return 0;Its not like this need to be fast or anything. I'd be happy to submit a patch that adds to fault.c and removed the = I/DLK processing from head_fsl_booke.S Thoughts? -jx