Skip to content

Commit d9a790d

Browse files
Victor KamenskyRussell King
Victor Kamensky
authored and
Russell King
committed
ARM: 7883/1: fix mov to mvn conversion in case of 64 bit phys_addr_t and BE
Fix patching code to convert mov instruction into mvn instruction in case of CONFIG_ARCH_PHYS_ADDR_T_64BIT and CONFIG_ARM_PATCH_PHYS_VIRT. In BE case store into r0 proper bits so byte swapped instruction could be modified correctly. Signed-off-by: Victor Kamensky <victor.kamensky@linaro.org> Reviewed-by: R Sricharan <r.sricharan@ti.com> Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
1 parent 139cc2b commit d9a790d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

arch/arm/kernel/head.S

+5-1
Original file line numberDiff line numberDiff line change
@@ -644,8 +644,12 @@ ARM_BE8(rev16 ip, ip)
644644
ldrcc r7, [r4], #4 @ use branch for delay slot
645645
bcc 1b
646646
bx lr
647+
#else
648+
#ifdef CONFIG_CPU_ENDIAN_BE8
649+
moveq r0, #0x00004000 @ set bit 22, mov to mvn instruction
647650
#else
648651
moveq r0, #0x400000 @ set bit 22, mov to mvn instruction
652+
#endif
649653
b 2f
650654
1: ldr ip, [r7, r3]
651655
#ifdef CONFIG_CPU_ENDIAN_BE8
@@ -654,7 +658,7 @@ ARM_BE8(rev16 ip, ip)
654658
tst ip, #0x000f0000 @ check the rotation field
655659
orrne ip, ip, r6, lsl #24 @ mask in offset bits 31-24
656660
biceq ip, ip, #0x00004000 @ clear bit 22
657-
orreq ip, ip, r0, lsl #24 @ mask in offset bits 7-0
661+
orreq ip, ip, r0 @ mask in offset bits 7-0
658662
#else
659663
bic ip, ip, #0x000000ff
660664
tst ip, #0xf00 @ check the rotation field

0 commit comments

Comments
 (0)