arm64: fix invalidation of wrong __early_cpu_boot_status cacheline
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Fri, 15 Apr 2016 10:11:21 +0000 (12:11 +0200)
committerCatalin Marinas <catalin.marinas@arm.com>
Mon, 18 Apr 2016 15:23:24 +0000 (16:23 +0100)
commitadb4907007445ab9d392f4ce398cd7fa5d26612b
tree71fff7c808cd046a6b11e09d1861c428fea98624
parentc3b46c73264b03000d1e18b22f5caf63332547c9
arm64: fix invalidation of wrong __early_cpu_boot_status cacheline

In head.S, the str_l macro, which takes a source register, a symbol name
and a temp register, is used to store a status value to the variable
__early_cpu_boot_status. Subsequently, the value of the temp register is
reused to invalidate any cachelines covering this variable.

However, since str_l resolves to

      adrp    \tmp, \sym
      str     \src, [\tmp, :lo12:\sym]

the temp register never actually holds the address of the variable but
only of the 4 KB window that covers it, and reusing it leads to the
wrong cacheline being invalidated. So instead, take the address
explicitly before doing the store, and reuse that value to perform
the cache invalidation.

Fixes: bb9052744f4b ("arm64: Handle early CPU boot failures")
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Suzuki K Poulose <Suzuki.Poulose@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/kernel/head.S