linux/arch/arm
Russell King 6ebbf2ce43 ARM: convert all "mov.* pc, reg" to "bx reg" for ARMv6+
ARMv6 and greater introduced a new instruction ("bx") which can be used
to return from function calls.  Recent CPUs perform better when the
"bx lr" instruction is used rather than the "mov pc, lr" instruction,
and this sequence is strongly recommended to be used by the ARM
architecture manual (section A.4.1.1).

We provide a new macro "ret" with all its variants for the condition
code which will resolve to the appropriate instruction.

Rather than doing this piecemeal, and miss some instances, change all
the "mov pc" instances to use the new macro, with the exception of
the "movs" instruction and the kprobes code.  This allows us to detect
the "mov pc, lr" case and fix it up - and also gives us the possibility
of deploying this for other registers depending on the CPU selection.

Reported-by: Will Deacon <will.deacon@arm.com>
Tested-by: Stephen Warren <swarren@nvidia.com> # Tegra Jetson TK1
Tested-by: Robert Jarzmik <robert.jarzmik@free.fr> # mioa701_bootresume.S
Tested-by: Andrew Lunn <andrew@lunn.ch> # Kirkwood
Tested-by: Shawn Guo <shawn.guo@freescale.com>
Tested-by: Tony Lindgren <tony@atomide.com> # OMAPs
Tested-by: Gregory CLEMENT <gregory.clement@free-electrons.com> # Armada XP, 375, 385
Acked-by: Sekhar Nori <nsekhar@ti.com> # DaVinci
Acked-by: Christoffer Dall <christoffer.dall@linaro.org> # kvm/hyp
Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com> # PXA3xx
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> # Xen
Tested-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> # ARMv7M
Tested-by: Simon Horman <horms+renesas@verge.net.au> # Shmobile
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-07-18 12:29:04 +01:00
..
boot ARM: simplify generation of compressed vmlinux.lds file 2014-07-01 15:01:51 +01:00
common ARM: 8081/1: MCPM: provide infrastructure to allow for MCPM loopback 2014-07-18 11:58:00 +01:00
configs The i.MX fixes for 3.16: 2014-06-23 14:12:48 +02:00
crypto ARM: convert all "mov.* pc, reg" to "bx reg" for ARMv6+ 2014-07-18 12:29:04 +01:00
firmware
include ARM: convert all "mov.* pc, reg" to "bx reg" for ARMv6+ 2014-07-18 12:29:04 +01:00
kernel ARM: convert all "mov.* pc, reg" to "bx reg" for ARMv6+ 2014-07-18 12:29:04 +01:00
kvm ARM: convert all "mov.* pc, reg" to "bx reg" for ARMv6+ 2014-07-18 12:29:04 +01:00
lib ARM: convert all "mov.* pc, reg" to "bx reg" for ARMv6+ 2014-07-18 12:29:04 +01:00
mach-at91 ARM: at91: fix at91_sysirq_mask_rtc for sam9x5 SoCs 2014-06-06 16:08:08 -07:00
mach-axxia
mach-bcm ARM: use menuconfig for sub-arch menus 2014-06-17 17:09:48 +02:00
mach-berlin ARM: use menuconfig for sub-arch menus 2014-06-17 17:09:48 +02:00
mach-clps711x
mach-cns3xxx ARM: use menuconfig for sub-arch menus 2014-06-17 17:09:48 +02:00
mach-davinci ARM: convert all "mov.* pc, reg" to "bx reg" for ARMv6+ 2014-07-18 12:29:04 +01:00
mach-dove
mach-ebsa110
mach-efm32
mach-ep93xx ARM: convert all "mov.* pc, reg" to "bx reg" for ARMv6+ 2014-07-18 12:29:04 +01:00
mach-exynos ARM: make it easier to check the CPU part number correctly 2014-07-18 12:29:02 +01:00
mach-footbridge
mach-gemini
mach-highbank ARM: Remove ARCH_HAS_CPUFREQ config option 2014-06-17 17:09:39 +02:00
mach-hisi
mach-imx ARM: convert all "mov.* pc, reg" to "bx reg" for ARMv6+ 2014-07-18 12:29:04 +01:00
mach-integrator ARM: integrator: fix OF-related regression 2014-06-24 14:27:03 +02:00
mach-iop13xx ARM: 8101/1: mach-iop13xx: fix possible build failure 2014-07-18 11:57:59 +01:00
mach-iop32x
mach-iop33x
mach-ixp4xx
mach-keystone ARM: keystone requires ARM_PATCH_PHYS_VIRT 2014-06-17 17:09:22 +02:00
mach-kirkwood
mach-ks8695
mach-lpc32xx
mach-mmp
mach-moxart ARM: use menuconfig for sub-arch menus 2014-06-17 17:09:48 +02:00
mach-msm Merge branch 'for-linus' of git://ftp.arm.linux.org.uk/~rmk/linux-arm into next 2014-06-05 15:57:04 -07:00
mach-mv78xx0
mach-mvebu ARM: convert all "mov.* pc, reg" to "bx reg" for ARMv6+ 2014-07-18 12:29:04 +01:00
mach-mxs
mach-netx
mach-nomadik ARM: use menuconfig for sub-arch menus 2014-06-17 17:09:48 +02:00
mach-nspire
mach-omap1
mach-omap2 ARM: convert all "mov.* pc, reg" to "bx reg" for ARMv6+ 2014-07-18 12:29:04 +01:00
mach-orion5x ARM: SoC updates for 3.16 (part 2) 2014-06-11 11:03:24 -07:00
mach-picoxcell
mach-prima2 ARM: use menuconfig for sub-arch menus 2014-06-17 17:09:48 +02:00
mach-pxa ARM: convert all "mov.* pc, reg" to "bx reg" for ARMv6+ 2014-07-18 12:29:04 +01:00
mach-qcom ARM: use menuconfig for sub-arch menus 2014-06-17 17:09:48 +02:00
mach-realview Merge branch 'for-linus' of git://ftp.arm.linux.org.uk/~rmk/linux-arm into next 2014-06-05 15:57:04 -07:00
mach-rockchip Merge branch 'for-linus' of git://ftp.arm.linux.org.uk/~rmk/linux-arm into next 2014-06-05 15:57:04 -07:00
mach-rpc
mach-s3c24xx ARM: convert all "mov.* pc, reg" to "bx reg" for ARMv6+ 2014-07-18 12:29:04 +01:00
mach-s3c64xx ARM: samsung: make SAMSUNG_DMADEV optional 2014-06-17 17:09:37 +02:00
mach-s5p64x0 ARM: samsung: make SAMSUNG_DMADEV optional 2014-06-17 17:09:37 +02:00
mach-s5pc100 ARM: samsung: make SAMSUNG_DMADEV optional 2014-06-17 17:09:37 +02:00
mach-s5pv210 ARM: samsung: make SAMSUNG_DMADEV optional 2014-06-17 17:09:37 +02:00
mach-sa1100 ARM: 8085/1: sa1100: collie: add top boot mtd partition 2014-06-29 10:29:34 +01:00
mach-shmobile ARM: convert all "mov.* pc, reg" to "bx reg" for ARMv6+ 2014-07-18 12:29:04 +01:00
mach-socfpga
mach-spear ARM: Remove ARCH_HAS_CPUFREQ config option 2014-06-17 17:09:39 +02:00
mach-sti Merge branch 'fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm 2014-06-24 13:59:00 -07:00
mach-sunxi
mach-tegra ARM: convert all "mov.* pc, reg" to "bx reg" for ARMv6+ 2014-07-18 12:29:04 +01:00
mach-u300 ARM: use menuconfig for sub-arch menus 2014-06-17 17:09:48 +02:00
mach-ux500 Merge branch 'fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm 2014-06-24 13:59:00 -07:00
mach-versatile
mach-vexpress ARM: make it easier to check the CPU part number correctly 2014-07-18 12:29:02 +01:00
mach-vt8500 ARM: Remove ARCH_HAS_CPUFREQ config option 2014-06-17 17:09:39 +02:00
mach-w90x900
mach-zynq ARM: Remove ARCH_HAS_CPUFREQ config option 2014-06-17 17:09:39 +02:00
mm ARM: convert all "mov.* pc, reg" to "bx reg" for ARMv6+ 2014-07-18 12:29:04 +01:00
net
nwfpe ARM: convert all "mov.* pc, reg" to "bx reg" for ARMv6+ 2014-07-18 12:29:04 +01:00
oprofile
plat-iop
plat-omap ARM: OMAP: add deprecation message for legacy OMAP DMA API 2014-07-01 15:00:26 +01:00
plat-orion
plat-pxa
plat-samsung Couple of DT fixes for STi platform issues discovered on V3.16-rc1. 2014-06-20 10:59:05 +02:00
plat-versatile
tools
vfp ARM: convert all "mov.* pc, reg" to "bx reg" for ARMv6+ 2014-07-18 12:29:04 +01:00
xen ARM: convert all "mov.* pc, reg" to "bx reg" for ARMv6+ 2014-07-18 12:29:04 +01:00
Kconfig ARM: exynos: cleanup kconfig option display 2014-06-17 17:09:41 +02:00
Kconfig-nommu
Kconfig.debug
Makefile