summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Gortmaker <paul.gortmaker@windriver.com>2018-08-24 15:55:51 -0400
committerPaul Gortmaker <paul.gortmaker@windriver.com>2018-08-24 15:55:51 -0400
commit2c654ef8a3f9808af2cd70734a5b7819382817a9 (patch)
tree3d8a29d2aa90e837a2c44ec7d9e6ecda0d6fbcd2
parent28d33c1820b1854883a7921aebf51963799d1564 (diff)
downloadlongterm-queue-4.12-2c654ef8a3f9808af2cd70734a5b7819382817a9.tar.gz
arm: refresh
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-rw-r--r--queue/arm64-alternatives-Add-dynamic-patching-feature.patch27
1 files changed, 14 insertions, 13 deletions
diff --git a/queue/arm64-alternatives-Add-dynamic-patching-feature.patch b/queue/arm64-alternatives-Add-dynamic-patching-feature.patch
index 8abedea..7214ab7 100644
--- a/queue/arm64-alternatives-Add-dynamic-patching-feature.patch
+++ b/queue/arm64-alternatives-Add-dynamic-patching-feature.patch
@@ -1,4 +1,4 @@
-From dea5e2a4c5bcf196f879a66cebdcca07793e8ba4 Mon Sep 17 00:00:00 2001
+From 7b95e0653e404bf2cccbf75651f0edc1c65a9342 Mon Sep 17 00:00:00 2001
From: Marc Zyngier <marc.zyngier@arm.com>
Date: Sun, 3 Dec 2017 12:02:14 +0000
Subject: [PATCH] arm64: alternatives: Add dynamic patching feature
@@ -34,12 +34,13 @@ where callback is the C function computing the alternative.
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
+Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
diff --git a/arch/arm64/include/asm/alternative.h b/arch/arm64/include/asm/alternative.h
-index 669028172fd6..a91933b1e2e6 100644
+index f9e2f69f296e..7e842dcae450 100644
--- a/arch/arm64/include/asm/alternative.h
+++ b/arch/arm64/include/asm/alternative.h
-@@ -5,6 +5,8 @@
+@@ -4,6 +4,8 @@
#include <asm/cpucaps.h>
#include <asm/insn.h>
@@ -48,7 +49,7 @@ index 669028172fd6..a91933b1e2e6 100644
#ifndef __ASSEMBLY__
#include <linux/init.h>
-@@ -22,12 +24,19 @@ struct alt_instr {
+@@ -21,12 +23,19 @@ struct alt_instr {
u8 alt_len; /* size of new instruction(s), <= orig_len */
};
@@ -69,7 +70,7 @@ index 669028172fd6..a91933b1e2e6 100644
" .hword " __stringify(feature) "\n" /* feature bit */ \
" .byte 662b-661b\n" /* source len */ \
" .byte 664f-663f\n" /* replacement len */
-@@ -45,15 +54,18 @@ void apply_alternatives(void *start, size_t length);
+@@ -44,15 +53,18 @@ void apply_alternatives(void *start, size_t length);
* but most assemblers die if insn1 or insn2 have a .inst. This should
* be fixed in a binutils release posterior to 2.25.51.0.2 (anything
* containing commit 4e4d08cf7399b606 or c1baaddf8861).
@@ -90,7 +91,7 @@ index 669028172fd6..a91933b1e2e6 100644
".pushsection .altinstr_replacement, \"a\"\n" \
"663:\n\t" \
newinstr "\n" \
-@@ -61,11 +73,17 @@ void apply_alternatives(void *start, size_t length);
+@@ -60,11 +72,17 @@ void apply_alternatives(void *start, size_t length);
".popsection\n\t" \
".org . - (664b-663b) + (662b-661b)\n\t" \
".org . - (662b-661b) + (664b-663b)\n" \
@@ -109,7 +110,7 @@ index 669028172fd6..a91933b1e2e6 100644
#else
#include <asm/assembler.h>
-@@ -132,6 +150,14 @@ void apply_alternatives(void *start, size_t length);
+@@ -131,6 +149,14 @@ void apply_alternatives(void *start, size_t length);
661:
.endm
@@ -124,7 +125,7 @@ index 669028172fd6..a91933b1e2e6 100644
/*
* Provide the other half of the alternative code sequence.
*/
-@@ -157,6 +183,13 @@ void apply_alternatives(void *start, size_t length);
+@@ -156,6 +182,13 @@ void apply_alternatives(void *start, size_t length);
.org . - (662b-661b) + (664b-663b)
.endm
@@ -139,10 +140,10 @@ index 669028172fd6..a91933b1e2e6 100644
* Provides a trivial alternative or default sequence consisting solely
* of NOPs. The number of NOPs is chosen automatically to match the
diff --git a/arch/arm64/kernel/alternative.c b/arch/arm64/kernel/alternative.c
-index 414288a558c8..5c4bce4ac381 100644
+index 7293839a4e2b..9b35f98d0152 100644
--- a/arch/arm64/kernel/alternative.c
+++ b/arch/arm64/kernel/alternative.c
-@@ -107,32 +107,53 @@ static u32 get_alt_insn(struct alt_instr *alt, __le32 *insnptr, __le32 *altinsnp
+@@ -107,32 +107,53 @@ static u32 get_alt_insn(struct alt_instr *alt, u32 *insnptr, u32 *altinsnptr)
return insn;
}
@@ -165,8 +166,8 @@ index 414288a558c8..5c4bce4ac381 100644
{
struct alt_instr *alt;
struct alt_region *region = alt_region;
-- __le32 *origptr, *replptr, *updptr;
-+ __le32 *origptr, *updptr;
+- u32 *origptr, *replptr, *updptr;
++ u32 *origptr, *updptr;
+ alternative_cb_t alt_cb;
for (alt = region->begin; alt < region->end; alt++) {
@@ -190,7 +191,7 @@ index 414288a558c8..5c4bce4ac381 100644
origptr = ALT_ORIG_PTR(alt);
- replptr = ALT_REPL_PTR(alt);
- updptr = use_linear_alias ? lm_alias(origptr) : origptr;
+ updptr = use_linear_alias ? (u32 *)lm_alias(origptr) : origptr;
- nr_inst = alt->alt_len / sizeof(insn);
+ nr_inst = alt->orig_len / AARCH64_INSN_SIZE;