alistair23-linux/arch/arm
Victor Kamensky 139cc2ba74 ARM: 7882/1: mm: fix __phys_to_virt to work with 64 bit phys_addr_t in BE case
Make sure that inline assembler that expects 'r' operand
receives 32 bit value.

Before this fix in case of CONFIG_ARCH_PHYS_ADDR_T_64BIT and
CONFIG_ARM_PATCH_PHYS_VIRT __phys_to_virt function passed 64 bit
value to __pv_stub inline assembler where 'r' operand is
expected. Compiler behavior in such case is not well specified.
It worked in little endian case, but in big endian case
incorrect code was generated, where compiler confused which
part of 64 bit value it needed to modify. For example BE
snippet looked like this:

N:0x80904E08 : MOV      r2,#0
N:0x80904E0C : SUB      r2,r2,#0x81000000

when LE similar code looked like this

N:0x808FCE2C : MOV      r2,r0
N:0x808FCE30 : SUB      r2,r2,#0xc0, 8 ; #0xc0000000

Note 'r0' register is va that have to be translated into phys

To avoid this situation use explicit cast to 'unsigned long',
which explicitly discard upper part of phys address and convert
value to 32 bit. Also add comment so such cast will not be
removed in the future.

Signed-off-by: Victor Kamensky <victor.kamensky@linaro.org>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2013-11-14 11:13:08 +00:00
..
boot Merge branch 'for-linus' of git://git.linaro.org/people/rmk/linux-arm 2013-11-14 08:51:29 +09:00
common Merge branch 'for-linus' of git://git.linaro.org/people/rmk/linux-arm 2013-11-14 08:51:29 +09:00
configs Merge branch 'for-linus' of git://git.linaro.org/people/rmk/linux-arm 2013-11-14 08:51:29 +09:00
crypto
include ARM: 7882/1: mm: fix __phys_to_virt to work with 64 bit phys_addr_t in BE case 2013-11-14 11:13:08 +00:00
kernel ARM: 7881/1: __fixup_smp read of SCU config should do byteswap in BE case 2013-11-14 11:03:01 +00:00
kvm ARM: 7862/1: pcpu: replace __get_cpu_var_uses 2013-10-29 11:06:27 +00:00
lib Merge branch 'for-linus' of git://git.linaro.org/people/rmk/linux-arm 2013-11-14 08:51:29 +09:00
mach-at91 ARM: SoC DT updates for 3.13 2013-11-11 17:34:56 +09:00
mach-bcm BCM changes for 3.13/soc. A number of cleanup related changes. 2013-10-30 14:03:39 -07:00
mach-bcm2835 Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-11-12 10:02:59 +09:00
mach-clps711x
mach-cns3xxx
mach-davinci arch/arm/mach-davinci/sram.c: use gen_pool_dma_alloc() to sram.c 2013-11-13 12:09:22 +09:00
mach-dove ARM: driver updates for 3.13 2013-11-11 17:05:37 +09:00
mach-ebsa110
mach-ep93xx usb: ohci: remove ep93xx bus glue platform driver 2013-10-29 16:43:37 -07:00
mach-exynos ARM: SoC cleanups for 3.13 2013-11-11 16:42:43 +09:00
mach-footbridge ARM: footbridge: fix build warnings for netwinder 2013-10-31 10:54:03 +00:00
mach-gemini GPIO bulk changes for the v3.13 development cycle 2013-11-12 15:50:46 +09:00
mach-highbank Merge branch 'for-linus' of git://git.linaro.org/people/rmk/linux-arm 2013-11-14 08:51:29 +09:00
mach-imx ARM: SoC platform changes for 3.13 2013-11-11 16:49:45 +09:00
mach-integrator DeviceTree updates for 3.13. This is a bit larger pull request than 2013-11-12 16:52:17 +09:00
mach-iop13xx
mach-iop32x
mach-iop33x
mach-ixp4xx Merge branch 'for-linus' of git://git.linaro.org/people/rmk/linux-arm 2013-11-14 08:51:29 +09:00
mach-keystone DeviceTree updates for 3.13. This is a bit larger pull request than 2013-11-12 16:52:17 +09:00
mach-kirkwood ARM: SoC DT updates for 3.13 2013-11-11 17:34:56 +09:00
mach-ks8695
mach-lpc32xx
mach-mmp
mach-msm Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-11-12 10:36:00 +09:00
mach-mv78xx0
mach-mvebu
mach-mxs ARM: SoC DT updates for 3.13 2013-11-11 17:34:56 +09:00
mach-netx
mach-nomadik
mach-nspire
mach-omap1
mach-omap2 Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds 2013-11-12 16:27:42 +09:00
mach-orion5x
mach-picoxcell
mach-prima2
mach-pxa
mach-realview
mach-rockchip ARM: SoC board updates for 3.13 2013-11-11 16:57:16 +09:00
mach-rpc
mach-s3c24xx
mach-s3c64xx regulator: Updates for v3.13 2013-11-12 14:55:17 +09:00
mach-s5p64x0
mach-s5pc100
mach-s5pv210
mach-sa1100 Merge branches 'fixes', 'mmci' and 'sa11x0' into for-next 2013-11-12 10:59:08 +00:00
mach-shmobile ARM: SoC board updates for 3.13 2013-11-11 16:57:16 +09:00
mach-socfpga
mach-spear
mach-sti
mach-sunxi ARM: sunxi: remove .init_time hooks 2013-10-28 10:19:45 -07:00
mach-tegra Merge branch 'for-linus' of git://git.linaro.org/people/rmk/linux-arm 2013-11-14 08:51:29 +09:00
mach-u300 DeviceTree updates for 3.13. This is a bit larger pull request than 2013-11-12 16:52:17 +09:00
mach-ux500 ARM: SoC DT updates for 3.13 2013-11-11 17:34:56 +09:00
mach-versatile
mach-vexpress Merge branch 'for-linus' of git://git.linaro.org/people/rmk/linux-arm 2013-11-14 08:51:29 +09:00
mach-virt
mach-vt8500
mach-w90x900
mach-zynq
mm ARM: Fix nommu.c build warning 2013-11-14 10:59:50 +00:00
net Merge branch 'devel-stable' into for-next 2013-11-12 10:58:59 +00:00
nwfpe
oprofile
plat-iop
plat-omap
plat-orion
plat-pxa
plat-samsung ARM: SoC DT updates for 3.13 2013-11-11 17:34:56 +09:00
plat-versatile
tools
vfp ARM: 7873/1: vfp: clear vfp_current_hw_state for dying cpu 2013-10-30 22:10:10 +00:00
xen
Kconfig Merge branch 'for-linus' of git://git.linaro.org/people/rmk/linux-arm 2013-11-14 08:51:29 +09:00
Kconfig-nommu
Kconfig.debug Merge branch 'for-linus' of git://git.linaro.org/people/rmk/linux-arm 2013-11-14 08:51:29 +09:00
Makefile Merge branch 'for-linus' of git://git.linaro.org/people/rmk/linux-arm 2013-11-14 08:51:29 +09:00