]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
arm64: alternative: Allow immediate branch as alternative instruction
authorMarc Zyngier <marc.zyngier@arm.com>
Fri, 27 Mar 2015 13:09:22 +0000 (13:09 +0000)
committerWill Deacon <will.deacon@arm.com>
Mon, 30 Mar 2015 10:03:43 +0000 (11:03 +0100)
commitfef7f2b2010381c795ae43743ad31931cc58f5ad
treeb8f144d8646b22385f3e5ff603749cd26eb09703
parent0978fb25f86b7595821cee6955679250d47c6438
arm64: alternative: Allow immediate branch as alternative instruction

Since all immediate 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 we insert it directly).

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

Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/kernel/alternative.c