linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] arm64: alternative patching rework
@ 2015-06-01  9:47 Marc Zyngier
  2015-06-01  9:47 ` [PATCH v2 1/4] arm64: insn: Add aarch64_{get,set}_branch_offset Marc Zyngier
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Marc Zyngier @ 2015-06-01  9:47 UTC (permalink / raw)
  To: linux-arm-kernel

The current alternative instruction framework is not kind to branches,
potentially leading to all kind of hacks in the code that uses
alternatives. This series expands it to deal with immediate and
conditional branches.

This is a rewrite of fef7f2b20103, which got reverted in b9a95e85bbc
as it was breaking unsuspecting branches inside an alternate
sequence. It now also deals with conditional branches (instead of just
asserting a BUG).

Another nit is addressed by the last patch, where GAS gets confused by
the combinaison of a .inst directive (as used by the msr_s/mrs_s
pseudo-instruction), a label, and a .if directive evaluating said
label. As this is exactly what the alternative framework uses to
detect length mismatch, this patch reverts to using a pair of .org
directives in a creative way. To make this a bit easier,
alternative-asm.h is folded into alternative.h.

This has been tested on v4.1-rc5.

Marc Zyngier (4):
  arm64: insn: Add aarch64_{get,set}_branch_offset
  arm64: alternative: Allow immediate branch as alternative instruction
  arm64: alternative: Merge alternative-asm.h into alternative.h
  arm64: alternative: Work around .inst assembler bugs

 arch/arm64/include/asm/alternative-asm.h | 29 -------------
 arch/arm64/include/asm/alternative.h     | 46 +++++++++++++++++++--
 arch/arm64/include/asm/insn.h            |  3 ++
 arch/arm64/kernel/alternative.c          | 71 +++++++++++++++++++++++++++++---
 arch/arm64/kernel/entry.S                |  2 +-
 arch/arm64/kernel/insn.c                 | 60 +++++++++++++++++++++++++++
 arch/arm64/mm/cache.S                    |  2 +-
 7 files changed, 173 insertions(+), 40 deletions(-)
 delete mode 100644 arch/arm64/include/asm/alternative-asm.h

-- 
2.1.4

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-06-03 13:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-01  9:47 [PATCH v2 0/4] arm64: alternative patching rework Marc Zyngier
2015-06-01  9:47 ` [PATCH v2 1/4] arm64: insn: Add aarch64_{get,set}_branch_offset Marc Zyngier
2015-06-01  9:47 ` [PATCH v2 2/4] arm64: alternative: Allow immediate branch as alternative instruction Marc Zyngier
2015-06-01  9:47 ` [PATCH v2 3/4] arm64: alternative: Merge alternative-asm.h into alternative.h Marc Zyngier
2015-06-01  9:47 ` [PATCH v2 4/4] arm64: alternative: Work around .inst assembler bugs Marc Zyngier
2015-06-02 17:47 ` [PATCH v2 0/4] arm64: alternative patching rework Catalin Marinas
2015-06-02 17:59   ` Catalin Marinas
2015-06-03 13:36     ` Marc Zyngier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).