Skip to content

Commit

Permalink
Allow CPU Based Alignment Handling
Browse files Browse the repository at this point in the history
Conflicts:

	arch/arm/configs/cyanogenmod_i9300_defconfig
  • Loading branch information
Tk-Glitch authored and edoko committed Feb 11, 2013
1 parent f009bda commit 1b6b03f
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
10 changes: 10 additions & 0 deletions arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1684,6 +1684,16 @@ config ALIGNMENT_TRAP
correct operation of some network protocols. With an IP-only
configuration it is safe to say N, otherwise say Y.

config ALLOW_CPU_ALIGNMENT
bool "Allow CPU-based alignment handling"
default y
help
Advanced ARM processors, such as the Cortex series and ARMv7-based
CPUS are capable of performing unaligned accesses for many types of
memory accesses. Typically, using a cpu-based alignment fixup is
faster than doing such a fixup in software. For best performance
on advanced CPUs, say Y here.

config UACCESS_WITH_MEMCPY
bool "Use kernel mem{cpy,set}() for {copy_to,clear}_user() (EXPERIMENTAL)"
depends on MMU && EXPERIMENTAL
Expand Down
1 change: 1 addition & 0 deletions arch/arm/configs/air_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@ CONFIG_CLEANCACHE=y
CONFIG_FORCE_MAX_ZONEORDER=11
# CONFIG_LEDS is not set
CONFIG_ALIGNMENT_TRAP=y
CONFIG_ALLOW_CPU_ALIGNMENT=y
# CONFIG_UACCESS_WITH_MEMCPY is not set
# CONFIG_SECCOMP is not set
# CONFIG_CC_STACKPROTECTOR is not set
Expand Down
6 changes: 3 additions & 3 deletions arch/arm/kernel/head-nommu.S
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ __after_proc_init:
* CP15 system control register value returned in r0 from
* the CPU init function.
*/
#ifdef CONFIG_ALIGNMENT_TRAP
orr r0, r0, #CR_A
#else
#ifdef CONFIG_ALLOW_CPU_ALIGNMENT
bic r0, r0, #CR_A
#else
orr r0, r0, #CR_A
#endif
#ifdef CONFIG_CPU_DCACHE_DISABLE
bic r0, r0, #CR_C
Expand Down
8 changes: 4 additions & 4 deletions arch/arm/kernel/head.S
Original file line number Diff line number Diff line change
Expand Up @@ -348,13 +348,13 @@ __secondary_data:
* r13 = *virtual* address to jump to upon completion
*/
__enable_mmu:
#if defined(CONFIG_ALIGNMENT_TRAP) && __LINUX_ARM_ARCH__ < 6
orr r0, r0, #CR_A
#ifdef CONFIG_ALLOW_CPU_ALIGNMENT
bic r0, r0, #CR_A
#else
bic r0, r0, #CR_A
orr r0, r0, #CR_A
#endif
#ifdef CONFIG_CPU_DCACHE_DISABLE
bic r0, r0, #CR_C
bic r0, r0, #CR_C
#endif
#ifdef CONFIG_CPU_BPREDICT_DISABLE
bic r0, r0, #CR_Z
Expand Down

0 comments on commit 1b6b03f

Please sign in to comment.