lkml.org 
[lkml]   [2018]   [Dec]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 3/5] arm64/alternative_cb: add support for alternative sequences
Date
Permit callback type alternatives to carry a sequence of alternative
instructions, and leave it up to the callback handler to decide how
to use them.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
arch/arm64/include/asm/alternative.h | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/include/asm/alternative.h b/arch/arm64/include/asm/alternative.h
index 987c1514183a..6b7726ee6b0a 100644
--- a/arch/arm64/include/asm/alternative.h
+++ b/arch/arm64/include/asm/alternative.h
@@ -156,7 +156,7 @@ static inline void apply_alternatives_module(void *start, size_t length) { }
.popsection
.pushsection .altinstr_replacement, "ax"
663: .word \cb - .
-664: .popsection
+ .popsection
661:
.endm

@@ -185,10 +185,21 @@ static inline void apply_alternatives_module(void *start, size_t length) { }
.org . - (662b-661b) + (664b-663b)
.endm

+.macro alternative_cb_alt
+ .set .Lasm_alt_mode, 1
+ .pushsection .altinstr_replacement, "ax"
+ .org 663b + AARCH64_INSN_SIZE
+.endm
+
/*
* Callback-based alternative epilogue
*/
.macro alternative_cb_end
+ .if .Lasm_alt_mode==0
+ .pushsection .altinstr_replacement, "ax"
+ .org 663b + AARCH64_INSN_SIZE
+ .endif
+664: .popsection
662:
.endm

--
2.19.2
\
 
 \ /
  Last update: 2018-12-06 17:00    [W:0.068 / U:2.352 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site