[PATCH v3] powerpc/papr_scm: Fix nvdimm event mappings

Vaibhav Jain vaibhav at linux.ibm.com
Fri Aug 5 11:48:39 AEST 2022


Kajol Jain <kjain at linux.ibm.com> writes:

> Commit 4c08d4bbc089 ("powerpc/papr_scm: Add perf interface support")
> added performance monitoring support for papr-scm nvdimm devices via
> perf interface. Commit also added an array in papr_scm_priv
> structure called "nvdimm_events_map", which got filled based on the
> result of H_SCM_PERFORMANCE_STATS hcall.
>
> Currently there is an assumption that the order of events in the
> stats buffer, returned by the hypervisor is same. And order also
> happens to matches with the events specified in nvdimm driver code.
> But this assumption is not documented in Power Architecture
> Platform Requirements (PAPR) document. Although the order
> of events happens to be same on current generation od system, but
> it might not be true in future generation systems. Fix the issue, by
> adding a static mapping for nvdimm events to corresponding stat-id,
> and removing the dynamic map from papr_scm_priv structure. Also
> remove the function papr_scm_pmu_check_events from papr_scm.c file,
> as we no longer need to copy stat-ids dynamically.
>
> Fixes: 4c08d4bbc089 ("powerpc/papr_scm: Add perf interface support")
> Reported-by: Aneesh Kumar K.V <aneesh.kumar at linux.ibm.com>
> Signed-off-by: Kajol Jain <kjain at linux.ibm.com>
> ---
>  arch/powerpc/platforms/pseries/papr_scm.c | 88 +++++++----------------
>  1 file changed, 27 insertions(+), 61 deletions(-)
>
> ---
> Changelog:
> v2 -> v3
> - Remove function papr_scm_pmu_check_events() and replace the
>   event checks in papr_scm_pmu_register() function with p->stat_buffer_len
>   as suggested by Vaibhav Jain
>   Link to the patch v2: https://lore.kernel.org/all/20220711034605.212683-1-kjain@linux.ibm.com/

V3 patch looks good to me.

Reviewed-by: Vaibhav Jain <vaibhav at linux.ibm.com>
-- 
Cheers
~ Vaibhav


More information about the Linuxppc-dev mailing list