Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b60d5db6 authored by Mark Rutland's avatar Mark Rutland Committed by Russell King
Browse files

ARM: 7786/1: hyp: fix macro parameterisation



Currently, compare_cpu_mode_with_primary uses a mixture of macro
arguments and hardcoded registers, and does so incorrectly, as it
stores (__boot_cpu_mode_offset | BOOT_CPU_MODE_MISMATCH) to
(__boot_cpu_mode + &__boot_cpu_mode_offset), which could corrupt an
arbitrary portion of memory.

This patch fixes up compare_cpu_mode_with_primary to use the macro
arguments, correctly updating __boot_cpu_mode.

Signed-off-by: default avatarMark Rutland <mark.rutland@arm.com>
Acked-by: default avatarDave Martin <Dave.Martin@arm.com>
Acked-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
Cc: Christoffer Dall <cdall@cs.columbia.edu>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent c65b7e98
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -56,8 +56,8 @@ ENTRY(__boot_cpu_mode)
	ldr	\reg3, [\reg2]
	ldr	\reg3, [\reg2]
	ldr	\reg1, [\reg2, \reg3]
	ldr	\reg1, [\reg2, \reg3]
	cmp	\mode, \reg1		@ matches primary CPU boot mode?
	cmp	\mode, \reg1		@ matches primary CPU boot mode?
	orrne	r7, r7, #BOOT_CPU_MODE_MISMATCH
	orrne	\reg1, \reg1, #BOOT_CPU_MODE_MISMATCH
	strne	r7, [r5, r6]		@ record what happened and give up
	strne	\reg1, [\reg2, \reg3]	@ record what happened and give up
	.endm
	.endm


#else	/* ZIMAGE */
#else	/* ZIMAGE */