Commit f10933cb authored by Thomas Richter's avatar Thomas Richter Committed by Alexander Gordeev
Browse files

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: default avatarThomas Richter <tmricht@linux.ibm.com>
Acked-by: default avatarSumanth Korikkar <sumanthk@linux.ibm.com>
Signed-off-by: default avatarAlexander Gordeev <agordeev@linux.ibm.com>
parent 4f00d4ef
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -428,7 +428,7 @@ static void cpum_cf_make_setsize(enum cpumf_ctr_set ctrset)
	case CPUMF_CTR_SET_CRYPTO:
		if (cpumf_ctr_info.csvn >= 1 && cpumf_ctr_info.csvn <= 5)
			ctrset_size = 16;
		else if (cpumf_ctr_info.csvn == 6 || cpumf_ctr_info.csvn == 7)
		else if (cpumf_ctr_info.csvn >= 6)
			ctrset_size = 20;
		break;
	case CPUMF_CTR_SET_EXT:
+3 −8
Original line number Diff line number Diff line
@@ -855,16 +855,11 @@ __init const struct attribute_group **cpumf_cf_event_group(void)
	}

	/* Determine version specific crypto set */
	switch (ci.csvn) {
	case 1 ... 5:
	csvn = none;
	if (ci.csvn >= 1 && ci.csvn <= 5)
		csvn = cpumcf_svn_12345_pmu_event_attr;
		break;
	case 6 ... 7:
	else if (ci.csvn >= 6)
		csvn = cpumcf_svn_67_pmu_event_attr;
		break;
	default:
		csvn = none;
	}

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