Commit 33f806da authored by Helge Deller's avatar Helge Deller

parisc: Mark altinstructions read-only and 32-bit aligned

Signed-off-by: default avatarHelge Deller <deller@gmx.de>
Cc: stable@vger.kernel.org   # v6.0+
parent a80aeb86
...@@ -34,7 +34,8 @@ void apply_alternatives(struct alt_instr *start, struct alt_instr *end, ...@@ -34,7 +34,8 @@ void apply_alternatives(struct alt_instr *start, struct alt_instr *end,
/* Alternative SMP implementation. */ /* Alternative SMP implementation. */
#define ALTERNATIVE(cond, replacement) "!0:" \ #define ALTERNATIVE(cond, replacement) "!0:" \
".section .altinstructions, \"aw\" !" \ ".section .altinstructions, \"a\" !" \
".align 4 !" \
".word (0b-4-.) !" \ ".word (0b-4-.) !" \
".hword 1, " __stringify(cond) " !" \ ".hword 1, " __stringify(cond) " !" \
".word " __stringify(replacement) " !" \ ".word " __stringify(replacement) " !" \
...@@ -44,7 +45,8 @@ void apply_alternatives(struct alt_instr *start, struct alt_instr *end, ...@@ -44,7 +45,8 @@ void apply_alternatives(struct alt_instr *start, struct alt_instr *end,
/* to replace one single instructions by a new instruction */ /* to replace one single instructions by a new instruction */
#define ALTERNATIVE(from, to, cond, replacement)\ #define ALTERNATIVE(from, to, cond, replacement)\
.section .altinstructions, "aw" ! \ .section .altinstructions, "a" ! \
.align 4 ! \
.word (from - .) ! \ .word (from - .) ! \
.hword (to - from)/4, cond ! \ .hword (to - from)/4, cond ! \
.word replacement ! \ .word replacement ! \
...@@ -52,7 +54,8 @@ void apply_alternatives(struct alt_instr *start, struct alt_instr *end, ...@@ -52,7 +54,8 @@ void apply_alternatives(struct alt_instr *start, struct alt_instr *end,
/* to replace multiple instructions by new code */ /* to replace multiple instructions by new code */
#define ALTERNATIVE_CODE(from, num_instructions, cond, new_instr_ptr)\ #define ALTERNATIVE_CODE(from, num_instructions, cond, new_instr_ptr)\
.section .altinstructions, "aw" ! \ .section .altinstructions, "a" ! \
.align 4 ! \
.word (from - .) ! \ .word (from - .) ! \
.hword -num_instructions, cond ! \ .hword -num_instructions, cond ! \
.word (new_instr_ptr - .) ! \ .word (new_instr_ptr - .) ! \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment