Commit 46c4d945 authored by Thomas Richter's avatar Thomas Richter Committed by Vasily Gorbik

s390/cpum_cf: introduce static CPU counter facility information

The CPU measurement facility counter information instruction qctri()
retrieves information about the available counter sets.
The information varies between machine generations, but is constant
when running on a particular machine.
For example the CPU measurement facility counter first and second
version numbers determine the amount of counters in a counter
set. This information never changes.

The counter sets are identical for all CPUs in the system. It does
not matter which CPU performs the instruction.

Authorization control of the CPU Measurement facility can only
be changed in the activation profile while the LPAR is not running.

Retrieve the CPU measurement counter information at device driver
initialization time and use its constant values.

Function validate_ctr_version() verifies if a user provided
CPU Measurement counter facility counter is valid and defined.
It now uses the newly introduced static CPU counter facility
information.

To avoid repeated recalculation of the counter set sizes (numbers of
counters per set), which never changes on a running machine,
calculate the counter set size once at device driver initialization
and store the result in an array. Functions cpum_cf_make_setsize()
and cpum_cf_read_setsize() are introduced.

Finally remove cpu_cf_events::info member and use the static CPU
counter facility information instead.
Signed-off-by: default avatarThomas Richter <tmricht@linux.ibm.com>
Acked-by: default avatarHeiko Carstens <hca@linux.ibm.com>
Acked-by: default avatarSumanth Korikkar <sumanthk@linux.ibm.com>
Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
parent 3b42877c
This diff is collapsed.
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