linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: marc.zyngier@arm.com (Marc Zyngier)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 0/4] arm64: alternative patching rework
Date: Mon,  1 Jun 2015 10:47:38 +0100	[thread overview]
Message-ID: <1433152062-21907-1-git-send-email-marc.zyngier@arm.com> (raw)

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

             reply	other threads:[~2015-06-01  9:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-01  9:47 Marc Zyngier [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1433152062-21907-1-git-send-email-marc.zyngier@arm.com \
    --to=marc.zyngier@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).