Skip to content
  • Paul Mackerras's avatar
    d40a82be
    powerpc/pmu: Make the generic compat PMU use the architected events · d40a82be
    Paul Mackerras authored
    
    
    This changes generic-compat-pmu.c so that it only uses architected
    events defined in Power ISA v3.0B, rather than event encodings which,
    while common to all the IBM Power Systems implementations, are
    nevertheless implementation-specific rather than architected.  The
    intention is that any CPU implementation designed to conform to Power
    ISA v3.0B or later can use generic-compat-pmu.c.
    
    In addition to the existing events for cycles and instructions, this
    adds several other architected events, including alternative encodings
    for some events.  In order to make it possible to measure cycles and
    instructions at the same time as each other, we set the CC5-6RUN bit
    in MMCR0, which makes PMC5 and PMC6 count instructions and cycles
    regardless of the run bit, so their events are now PM_CYC and
    PM_INST_CMPL rather than PM_RUN_CYC and PM_RUN_INST_CMPL (the latter
    are still available via other event codes).
    
    Note that POWER9 has an erratum where one architected event
    (PM_FLOP_CMPL, floating-point operations completed, code 0x100f4) does
    not work correctly.  Given that there is a specific PMU driver for P9
    which will be used in preference to generic-compat-pmu.c, that is not
    a real problem.
    
    Signed-off-by: default avatarPaul Mackerras <paulus@ozlabs.org>
    Reviewed-by: default avatarMadhavan Srinivasan <maddy@linux.ibm.com>
    Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
    Link: https://lore.kernel.org/r/YJD7L9yeoxvxqeYi@thinks.paulus.ozlabs.org
    d40a82be
    powerpc/pmu: Make the generic compat PMU use the architected events
    Paul Mackerras authored
    
    
    This changes generic-compat-pmu.c so that it only uses architected
    events defined in Power ISA v3.0B, rather than event encodings which,
    while common to all the IBM Power Systems implementations, are
    nevertheless implementation-specific rather than architected.  The
    intention is that any CPU implementation designed to conform to Power
    ISA v3.0B or later can use generic-compat-pmu.c.
    
    In addition to the existing events for cycles and instructions, this
    adds several other architected events, including alternative encodings
    for some events.  In order to make it possible to measure cycles and
    instructions at the same time as each other, we set the CC5-6RUN bit
    in MMCR0, which makes PMC5 and PMC6 count instructions and cycles
    regardless of the run bit, so their events are now PM_CYC and
    PM_INST_CMPL rather than PM_RUN_CYC and PM_RUN_INST_CMPL (the latter
    are still available via other event codes).
    
    Note that POWER9 has an erratum where one architected event
    (PM_FLOP_CMPL, floating-point operations completed, code 0x100f4) does
    not work correctly.  Given that there is a specific PMU driver for P9
    which will be used in preference to generic-compat-pmu.c, that is not
    a real problem.
    
    Signed-off-by: default avatarPaul Mackerras <paulus@ozlabs.org>
    Reviewed-by: default avatarMadhavan Srinivasan <maddy@linux.ibm.com>
    Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
    Link: https://lore.kernel.org/r/YJD7L9yeoxvxqeYi@thinks.paulus.ozlabs.org
Loading