[PATCH] ARM: armv7 no need update SCTLR for alignment

Wuqixuan wuqixuan at huawei.com
Fri Apr 18 02:53:07 PDT 2014


In Armv7, cr_alignment and cr_no_alignment are always same, in alignment_init both 
cr_alignment and cr_no_alignment will be updated by clearing A bit. So there is no 
meaning to update SCTLR if interrupt and exception disturbs the user-space. 

Signed-off-by: Wuqixuan <wuqixuan at huawei.com>
---
diff -git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S
--- a/arch/arm/kernel/entry-common.S
+++ b/arch/arm/kernel/entry-common.S
@@ -323,12 +323,6 @@
   A710( bne .Larm710bug      )
 
 #endif
-#if defined(CONFIG_ALIGNMENT_TRAP)
+#if defined(CONFIG_ALIGNMENT_TRAP) && !(__LINUX_ARM_ARCH__ >= 7)
 ldr ip, __cr_alignment
 ldr ip, [ip]
 mcr p15, 0, ip, c1, c0  @ update control register
#endif
  enable_irq
 
  get_thread_info tsk
@@ -393,11 +387,6 @@
  b ret_slow_syscall
 
  .align 5
-#ifdef CONFIG_ALIGNMENT_TRAP
+#if defined(CONFIG_ALIGNMENT_TRAP) && !(__LINUX_ARM_ARCH__ >= 7)
 .type __cr_alignment, #object
__cr_alignment:
 .word cr_alignment
#endif
  .ltorg
 
 /*
diff -git a/arch/arm/kernel/entry-header.S b/arch/arm/kernel/entry-header.S
--- a/arch/arm/kernel/entry-header.S
+++ b/arch/arm/kernel/entry-header.S
@@ -44,11 +44,6 @@
  .endm
 
  .macro alignment_trap, rtemp
-#ifdef CONFIG_ALIGNMENT_TRAP 
+#if defined(CONFIG_ALIGNMENT_TRAP) && !(__LINUX_ARM_ARCH__ >= 7)
 ldr \rtemp, .LCcralign
 ldr \rtemp, [\rtemp]
 mcr p15, 0, \rtemp, c1, c0
#endif
  .endm
 
  @


More information about the linux-arm-kernel mailing list