Subject: Kernel alignment trap stuff seems to be broken

From: Timothy Baldwin <[email-masked]>
Date: Wed, 07 Apr 1999 22:06:42 +0100

If I am reading 2.2.3-rmk2 right, the alignment trap handler disables
alignment traps if one occurs in user mode and alignment traps are
enabled on every entry to the kernel except via SWIs. This would make
the alignment trap handler unreliable.

This patch fixes that :

--- linux/arch/arm/kernel/entry-armv.S.old	Wed Apr  7 09:14:40 1999
+++ linux/arch/arm/kernel/entry-armv.S		Wed Apr  7 09:18:39 1999
@@ -505,6 +505,9 @@
 .LCabt:		.word	__temp_abt
 .LCprocfns:	.word	SYMBOL_NAME(processor)
 .LCfp:		.word	SYMBOL_NAME(fp_enter)
+#ifdef CONFIG_ALIGNMENT_TRAP
+.LCswi:	.word	SYMBOL_NAME(cr_alignment)
+#endif
 
 		irq_prio_table
 
--- linux/arch/arm/kernel/entry-common.S.old	Wed Apr  7 08:47:48 1999
+++ linux/arch/arm/kernel/entry-common.S	Wed Apr  7 09:18:33 1999
@@ -64,8 +64,13 @@
 vector_swi:	save_user_regs
 		mask_pc	lr, lr
 		mov	fp, #0
-		ldr	r6, [lr, #-4]		@ get SWI instruction
-		arm700_bug_check r6, r7
+#ifdef CONFIG_ALIGNMENT_TRAP
+		ldr	r7, .LCswi
+		ldr	r7, [r7]
+		mcr	p15, 0, r7, c1, c0
+#endif
+		ldr	r6, [lr, #-4]		@ get SWI instruction
+		arm700_bug_check r6, r7
 		enable_irqs r7
 
 		str	r4, [sp, #-4]!		@ new style: (r0 = arg1, r4 = arg5)

I may have broken some optimisations.

-- 
http://www.reinhouse.freeserve.co.uk/
  Please don't CC replies to me!!!
unsubscribe: body of `unsubscribe linux-arm' to [email-masked]