diff options
author | Hendrik Brueckner <brueckner@linux.ibm.com> | 2018-08-29 12:12:17 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2019-02-22 03:19:53 -0500 |
commit | 346d034d7f13da9eb135458a2f6cf14c9b77a637 (patch) | |
tree | 376ec1379a4cbac6579ab3ad3c183f9b7cb45f72 | |
parent | 778fb10ccc18b16c022be898d8497767c20ea7b5 (diff) |
s390/cpu_mf: replace stcctm5() with the stcctm() function
Remove the stcctm5() function to extract counters from the MT-diagnostic
counter set with the stcctm() function. For readability, introduce an
enum to map the counter sets names to respective numbers for the stcctm
instruction.
Signed-off-by: Hendrik Brueckner <brueckner@linux.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
-rw-r--r-- | arch/s390/include/asm/cpu_mf.h | 25 | ||||
-rw-r--r-- | arch/s390/kernel/vtime.c | 4 |
2 files changed, 11 insertions, 18 deletions
diff --git a/arch/s390/include/asm/cpu_mf.h b/arch/s390/include/asm/cpu_mf.h index 53ba4f2ca296..ae3e3221d4b5 100644 --- a/arch/s390/include/asm/cpu_mf.h +++ b/arch/s390/include/asm/cpu_mf.h | |||
@@ -212,7 +212,15 @@ static inline int ecctr(u64 ctr, u64 *val) | |||
212 | } | 212 | } |
213 | 213 | ||
214 | /* Store CPU counter multiple for a particular counter set */ | 214 | /* Store CPU counter multiple for a particular counter set */ |
215 | static inline int stcctm(u8 set, u64 range, u64 *dest) | 215 | enum stcctm_ctr_set { |
216 | EXTENDED = 0, | ||
217 | BASIC = 1, | ||
218 | PROBLEM_STATE = 2, | ||
219 | CRYPTO_ACTIVITY = 3, | ||
220 | MT_DIAG = 5, | ||
221 | MT_DIAG_CLEARING = 9, /* clears loss-of-MT-ctr-data alert */ | ||
222 | }; | ||
223 | static inline int stcctm(enum stcctm_ctr_set set, u64 range, u64 *dest) | ||
216 | { | 224 | { |
217 | int cc; | 225 | int cc; |
218 | 226 | ||
@@ -226,21 +234,6 @@ static inline int stcctm(u8 set, u64 range, u64 *dest) | |||
226 | return cc; | 234 | return cc; |
227 | } | 235 | } |
228 | 236 | ||
229 | /* Store CPU counter multiple for the MT utilization counter set */ | ||
230 | static inline int stcctm5(u64 num, u64 *val) | ||
231 | { | ||
232 | int cc; | ||
233 | |||
234 | asm volatile ( | ||
235 | " .insn rsy,0xeb0000000017,%2,5,%1\n" | ||
236 | " ipm %0\n" | ||
237 | " srl %0,28\n" | ||
238 | : "=d" (cc) | ||
239 | : "Q" (*val), "d" (num) | ||
240 | : "cc", "memory"); | ||
241 | return cc; | ||
242 | } | ||
243 | |||
244 | /* Query sampling information */ | 237 | /* Query sampling information */ |
245 | static inline int qsi(struct hws_qsi_info_block *info) | 238 | static inline int qsi(struct hws_qsi_info_block *info) |
246 | { | 239 | { |
diff --git a/arch/s390/kernel/vtime.c b/arch/s390/kernel/vtime.c index f24395a01918..98f850e00008 100644 --- a/arch/s390/kernel/vtime.c +++ b/arch/s390/kernel/vtime.c | |||
@@ -69,7 +69,7 @@ static void update_mt_scaling(void) | |||
69 | u64 delta, fac, mult, div; | 69 | u64 delta, fac, mult, div; |
70 | int i; | 70 | int i; |
71 | 71 | ||
72 | stcctm5(smp_cpu_mtid + 1, cycles_new); | 72 | stcctm(MT_DIAG, smp_cpu_mtid + 1, cycles_new); |
73 | cycles_old = this_cpu_ptr(mt_cycles); | 73 | cycles_old = this_cpu_ptr(mt_cycles); |
74 | fac = 1; | 74 | fac = 1; |
75 | mult = div = 0; | 75 | mult = div = 0; |
@@ -432,6 +432,6 @@ void vtime_init(void) | |||
432 | __this_cpu_write(mt_scaling_jiffies, jiffies); | 432 | __this_cpu_write(mt_scaling_jiffies, jiffies); |
433 | __this_cpu_write(mt_scaling_mult, 1); | 433 | __this_cpu_write(mt_scaling_mult, 1); |
434 | __this_cpu_write(mt_scaling_div, 1); | 434 | __this_cpu_write(mt_scaling_div, 1); |
435 | stcctm5(smp_cpu_mtid + 1, this_cpu_ptr(mt_cycles)); | 435 | stcctm(MT_DIAG, smp_cpu_mtid + 1, this_cpu_ptr(mt_cycles)); |
436 | } | 436 | } |
437 | } | 437 | } |