]> git.baikalelectronics.ru Git - kernel.git/commit
Revert "arm64: alternative: Allow immediate branch as alternative instruction"
authorWill Deacon <will.deacon@arm.com>
Fri, 1 May 2015 12:48:17 +0000 (13:48 +0100)
committerWill Deacon <will.deacon@arm.com>
Tue, 5 May 2015 11:21:52 +0000 (12:21 +0100)
commit1cadf9b6ae6aefe0497714792c0df3a2269c9ea0
treecc6acb0ea753833355d3db50ab2b114997fb542f
parent194b7115c289879d9d371e5ad3e7d18c3489ecbf
Revert "arm64: alternative: Allow immediate branch as alternative instruction"

This reverts most of commit bf31f3ddb23bd6e68ee09f4b95f89d7ecb4026b1.

It turns out that there are a couple of problems with the way we're
fixing up branch instructions used as part of alternative instruction
sequences:

  (1) If the branch target is also in the alternative sequence, we'll
      generate a branch into the .altinstructions section which actually
      gets freed.

  (2) The calls to aarch64_insn_{read,write} bring an awful lot more
      code into the patching path (e.g. taking locks, poking the fixmap,
      invalidating the TLB) which isn't actually needed for the early
      patching run under stop_machine, but makes the use of alternative
      sequences extremely fragile (as we can't patch code that could be
      used by the patching code).

Given that no code actually requires alternative patching of immediate
branches, let's remove this support for now and revisit it when we've
got a user. We leave the updated size check, since we really do require
the sequences to be the same length.

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