From: daniel.thompson@linaro.org (Daniel Thompson)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 3/5] arm64: kernel: Adopt new alternative assembler macros
Date: Mon, 20 Jul 2015 16:10:02 +0100 [thread overview]
Message-ID: <1437405004-1296-4-git-send-email-daniel.thompson@linaro.org> (raw)
In-Reply-To: <1437405004-1296-1-git-send-email-daniel.thompson@linaro.org>
Convert the dynamic patching for ARM64_WORKAROUND_845719 over to
the newly added alternative assembler macros.
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
---
arch/arm64/kernel/entry.S | 29 +++++++++++++----------------
1 file changed, 13 insertions(+), 16 deletions(-)
diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S
index a7691a378668..be8a70d4028c 100644
--- a/arch/arm64/kernel/entry.S
+++ b/arch/arm64/kernel/entry.S
@@ -122,26 +122,23 @@
ct_user_enter
ldr x23, [sp, #S_SP] // load return stack pointer
msr sp_el0, x23
-
#ifdef CONFIG_ARM64_ERRATUM_845719
-
-#undef SEQUENCE_ORG
-#undef SEQUENCE_ALT
-
+alternative_if_not ARM64_WORKAROUND_845719
+ nop
+ nop
#ifdef CONFIG_PID_IN_CONTEXTIDR
-
-#define SEQUENCE_ORG "nop ; nop ; nop"
-#define SEQUENCE_ALT "tbz x22, #4, 1f ; mrs x29, contextidr_el1; msr contextidr_el1, x29; 1:"
-
+ nop
+#endif
+alternative_else
+ tbz x22, #4, 1f
+#ifdef CONFIG_PID_IN_CONTEXTIDR
+ mrs x29, contextidr_el1
+ msr contextidr_el1, x29
#else
-
-#define SEQUENCE_ORG "nop ; nop"
-#define SEQUENCE_ALT "tbz x22, #4, 1f ; msr contextidr_el1, xzr; 1:"
-
+ msr contextidr_el1, xzr
#endif
-
- alternative_insn SEQUENCE_ORG, SEQUENCE_ALT, ARM64_WORKAROUND_845719
-
+1:
+alternative_endif
#endif
.endif
msr elr_el1, x21 // set up the return data
--
2.4.3
next prev parent reply other threads:[~2015-07-20 15:10 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-10 13:48 [PATCH] arm64: alternative: Provide if/else/endif assembler macros Daniel Thompson
2015-07-16 18:19 ` Will Deacon
2015-07-17 10:42 ` Daniel Thompson
2015-07-20 15:09 ` [PATCH v2 0/5] " Daniel Thompson
2015-07-20 15:10 ` [PATCH v2 1/5] " Daniel Thompson
2015-07-20 17:12 ` Will Deacon
2015-07-22 11:08 ` Daniel Thompson
2015-07-20 15:10 ` [PATCH v2 2/5] arm64: mm: Adopt new alternative " Daniel Thompson
2015-07-20 15:10 ` Daniel Thompson [this message]
2015-07-20 15:10 ` [PATCH v2 4/5] arm64: kvm: " Daniel Thompson
2015-07-20 15:10 ` [PATCH v2 5/5] arm64: alternative: Remove alternative_insn macro Daniel Thompson
2015-07-22 11:21 ` [PATCH v3 0/5] arm64: alternative: Provide if/else/endif assembler macros Daniel Thompson
2015-07-22 11:21 ` [PATCH v3 1/5] " Daniel Thompson
2015-07-22 11:21 ` [PATCH v3 2/5] arm64: mm: Adopt new alternative " Daniel Thompson
2015-07-22 11:21 ` [PATCH v3 3/5] arm64: kernel: " Daniel Thompson
2015-07-22 11:21 ` [PATCH v3 4/5] arm64: kvm: " Daniel Thompson
2015-07-22 15:17 ` Will Deacon
2015-07-22 15:55 ` Marc Zyngier
2015-07-22 11:21 ` [PATCH v3 5/5] arm64: alternative: Remove alternative_insn macro Daniel Thompson
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=1437405004-1296-4-git-send-email-daniel.thompson@linaro.org \
--to=daniel.thompson@linaro.org \
--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).