]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: alternative: Allow immediate branch as alternative instruction
authorMarc Zyngier <marc.zyngier@arm.com>
Mon, 1 Jun 2015 09:47:40 +0000 (10:47 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Fri, 5 Jun 2015 09:38:53 +0000 (10:38 +0100)
commitd98460c0329b9ae2d31f0751a28a1d5af41b825b
treee68b756ae0e477bbdc8ea64daedaa5f11ca7cee4
parent0a5e4940551199b69e8a9ddd5b929b1984d3bd9e
arm64: alternative: Allow immediate branch as alternative instruction

Since all branches are PC-relative on AArch64, these instructions
cannot be used as an alternative with the simplistic approach
we currently have (the immediate has been computed from
the .altinstr_replacement section, and end-up being completely off
if the target is outside of the replacement sequence).

This patch handles the branch instructions in a different way,
using the insn framework to recompute the immediate, and generate
the right displacement in the above case.

Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/kernel/alternative.c