• Thomas Richter's avatar
    s390/cpum_cf: introduce static CPU counter facility information · 46c4d945
    Thomas Richter authored
    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>
    46c4d945
perf_cpum_cf.c 51 KB