Skip to content

Commit f10933c

Browse files
Thomas RichterAlexander Gordeev
authored andcommitted
s390/cpum_cf: make crypto counters upward compatible across machine types
The CPU Measurement facility crypto counter set functionality is defined by the Second Counter Version Number. This number varies between machine types, but is upward compatible. Lessen the checks to reflect this behavior. Signed-off-by: Thomas Richter <tmricht@linux.ibm.com> Acked-by: Sumanth Korikkar <sumanthk@linux.ibm.com> Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
1 parent 4f00d4e commit f10933c

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

arch/s390/kernel/perf_cpum_cf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ static void cpum_cf_make_setsize(enum cpumf_ctr_set ctrset)
428428
case CPUMF_CTR_SET_CRYPTO:
429429
if (cpumf_ctr_info.csvn >= 1 && cpumf_ctr_info.csvn <= 5)
430430
ctrset_size = 16;
431-
else if (cpumf_ctr_info.csvn == 6 || cpumf_ctr_info.csvn == 7)
431+
else if (cpumf_ctr_info.csvn >= 6)
432432
ctrset_size = 20;
433433
break;
434434
case CPUMF_CTR_SET_EXT:

arch/s390/kernel/perf_cpum_cf_events.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -855,16 +855,11 @@ __init const struct attribute_group **cpumf_cf_event_group(void)
855855
}
856856

857857
/* Determine version specific crypto set */
858-
switch (ci.csvn) {
859-
case 1 ... 5:
858+
csvn = none;
859+
if (ci.csvn >= 1 && ci.csvn <= 5)
860860
csvn = cpumcf_svn_12345_pmu_event_attr;
861-
break;
862-
case 6 ... 7:
861+
else if (ci.csvn >= 6)
863862
csvn = cpumcf_svn_67_pmu_event_attr;
864-
break;
865-
default:
866-
csvn = none;
867-
}
868863

869864
/* Determine model-specific counter set(s) */
870865
get_cpu_id(&cpu_id);

0 commit comments

Comments
 (0)