Commit 9be999a6 authored by Heiko Carstens's avatar Heiko Carstens Committed by Vasily Gorbik

s390/alternatives: Use consistent naming

The alternative code is using the words facility and feature for the
same. Rename facility to more generic feature everywhere to have
consistent naming.
Reviewed-by: default avatarAlexander Gordeev <agordeev@linux.ibm.com>
Tested-by: default avatarSven Schnelle <svens@linux.ibm.com>
Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
parent 035248a7
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
struct alt_instr { struct alt_instr {
s32 instr_offset; /* original instruction */ s32 instr_offset; /* original instruction */
s32 repl_offset; /* offset to replacement instruction */ s32 repl_offset; /* offset to replacement instruction */
u16 facility; /* facility bit set for replacement */ u16 feature; /* feature required for replacement */
u8 instrlen; /* length of original instruction */ u8 instrlen; /* length of original instruction */
} __packed; } __packed;
...@@ -48,10 +48,10 @@ void apply_alternatives(struct alt_instr *start, struct alt_instr *end); ...@@ -48,10 +48,10 @@ void apply_alternatives(struct alt_instr *start, struct alt_instr *end);
#define OLDINSTR(oldinstr) \ #define OLDINSTR(oldinstr) \
"661:\n\t" oldinstr "\n662:\n" "661:\n\t" oldinstr "\n662:\n"
#define ALTINSTR_ENTRY(facility, num) \ #define ALTINSTR_ENTRY(feature, num) \
"\t.long 661b - .\n" /* old instruction */ \ "\t.long 661b - .\n" /* old instruction */ \
"\t.long " b_altinstr(num)"b - .\n" /* alt instruction */ \ "\t.long " b_altinstr(num)"b - .\n" /* alt instruction */ \
"\t.word " __stringify(facility) "\n" /* facility bit */ \ "\t.word " __stringify(feature) "\n" /* feature */ \
"\t.byte " oldinstr_len "\n" /* instruction len */ \ "\t.byte " oldinstr_len "\n" /* instruction len */ \
"\t.org . - (" oldinstr_len ") & 1\n" \ "\t.org . - (" oldinstr_len ") & 1\n" \
"\t.org . - (" oldinstr_len ") + (" altinstr_len(num) ")\n" \ "\t.org . - (" oldinstr_len ") + (" altinstr_len(num) ")\n" \
...@@ -61,24 +61,24 @@ void apply_alternatives(struct alt_instr *start, struct alt_instr *end); ...@@ -61,24 +61,24 @@ void apply_alternatives(struct alt_instr *start, struct alt_instr *end);
b_altinstr(num)":\n\t" altinstr "\n" e_altinstr(num) ":\n" b_altinstr(num)":\n\t" altinstr "\n" e_altinstr(num) ":\n"
/* alternative assembly primitive: */ /* alternative assembly primitive: */
#define ALTERNATIVE(oldinstr, altinstr, facility) \ #define ALTERNATIVE(oldinstr, altinstr, feature) \
".pushsection .altinstr_replacement, \"ax\"\n" \ ".pushsection .altinstr_replacement, \"ax\"\n" \
ALTINSTR_REPLACEMENT(altinstr, 1) \ ALTINSTR_REPLACEMENT(altinstr, 1) \
".popsection\n" \ ".popsection\n" \
OLDINSTR(oldinstr) \ OLDINSTR(oldinstr) \
".pushsection .altinstructions,\"a\"\n" \ ".pushsection .altinstructions,\"a\"\n" \
ALTINSTR_ENTRY(facility, 1) \ ALTINSTR_ENTRY(feature, 1) \
".popsection\n" ".popsection\n"
#define ALTERNATIVE_2(oldinstr, altinstr1, facility1, altinstr2, facility2)\ #define ALTERNATIVE_2(oldinstr, altinstr1, feature1, altinstr2, feature2)\
".pushsection .altinstr_replacement, \"ax\"\n" \ ".pushsection .altinstr_replacement, \"ax\"\n" \
ALTINSTR_REPLACEMENT(altinstr1, 1) \ ALTINSTR_REPLACEMENT(altinstr1, 1) \
ALTINSTR_REPLACEMENT(altinstr2, 2) \ ALTINSTR_REPLACEMENT(altinstr2, 2) \
".popsection\n" \ ".popsection\n" \
OLDINSTR(oldinstr) \ OLDINSTR(oldinstr) \
".pushsection .altinstructions,\"a\"\n" \ ".pushsection .altinstructions,\"a\"\n" \
ALTINSTR_ENTRY(facility1, 1) \ ALTINSTR_ENTRY(feature1, 1) \
ALTINSTR_ENTRY(facility2, 2) \ ALTINSTR_ENTRY(feature2, 2) \
".popsection\n" ".popsection\n"
/* /*
...@@ -93,12 +93,12 @@ void apply_alternatives(struct alt_instr *start, struct alt_instr *end); ...@@ -93,12 +93,12 @@ void apply_alternatives(struct alt_instr *start, struct alt_instr *end);
* For non barrier like inlines please define new variants * For non barrier like inlines please define new variants
* without volatile and memory clobber. * without volatile and memory clobber.
*/ */
#define alternative(oldinstr, altinstr, facility) \ #define alternative(oldinstr, altinstr, feature) \
asm_inline volatile(ALTERNATIVE(oldinstr, altinstr, facility) : : : "memory") asm_inline volatile(ALTERNATIVE(oldinstr, altinstr, feature) : : : "memory")
#define alternative_2(oldinstr, altinstr1, facility1, altinstr2, facility2) \ #define alternative_2(oldinstr, altinstr1, feature1, altinstr2, feature2) \
asm_inline volatile(ALTERNATIVE_2(oldinstr, altinstr1, facility1, \ asm_inline volatile(ALTERNATIVE_2(oldinstr, altinstr1, feature1, \
altinstr2, facility2) ::: "memory") altinstr2, feature2) ::: "memory")
/* Alternative inline assembly with input. */ /* Alternative inline assembly with input. */
#define alternative_input(oldinstr, newinstr, feature, input...) \ #define alternative_input(oldinstr, newinstr, feature, input...) \
...@@ -106,8 +106,8 @@ void apply_alternatives(struct alt_instr *start, struct alt_instr *end); ...@@ -106,8 +106,8 @@ void apply_alternatives(struct alt_instr *start, struct alt_instr *end);
: : input) : : input)
/* Like alternative_input, but with a single output argument */ /* Like alternative_input, but with a single output argument */
#define alternative_io(oldinstr, altinstr, facility, output, input...) \ #define alternative_io(oldinstr, altinstr, feature, output, input...) \
asm_inline volatile(ALTERNATIVE(oldinstr, altinstr, facility) \ asm_inline volatile(ALTERNATIVE(oldinstr, altinstr, feature) \
: output : input) : output : input)
/* Use this macro if more than one output parameter is needed. */ /* Use this macro if more than one output parameter is needed. */
......
...@@ -21,7 +21,7 @@ void __init_or_module apply_alternatives(struct alt_instr *start, ...@@ -21,7 +21,7 @@ void __init_or_module apply_alternatives(struct alt_instr *start,
instr = (u8 *)&a->instr_offset + a->instr_offset; instr = (u8 *)&a->instr_offset + a->instr_offset;
replacement = (u8 *)&a->repl_offset + a->repl_offset; replacement = (u8 *)&a->repl_offset + a->repl_offset;
if (!__test_facility(a->facility, alt_stfle_fac_list)) if (!__test_facility(a->feature, alt_stfle_fac_list))
continue; continue;
s390_kernel_write(instr, replacement, a->instrlen); s390_kernel_write(instr, replacement, a->instrlen);
} }
......
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