Skip to content
Snippets Groups Projects
Commit 287840fb authored by Mamatha Inamdar's avatar Mamatha Inamdar
Browse files

arch/powerpc/perf: Update get_mem_data_src function to use saved values of sier and mmcra regs

JIRA: https://issues.redhat.com/browse/RHEL-80602



commit f848e7ee1588d66539da7315d9a99bfaeda3b970
Author: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Date:   Tue Jan 21 18:46:21 2025 +0530

    arch/powerpc/perf: Update get_mem_data_src function to use saved values of sier and mmcra regs

    During performance monitor interrupt handling, the regs are setup using
    perf_read_regs function. Here some of the pt_regs fields is overloaded.
    Samples Instruction Event Register (SIER) is loaded into pt_regs,
    overloading regs->dar. And regs->dsisr to store MMCRA (Monitor Mode
    Control Register A) so that we only need to read these once on each
    interrupt.

    Update the isa207_get_mem_data_src function to use regs->dar instead of
    reading from SPRN_SIER again. Also use regs->dsisr to read the mmcra
    value

Signed-off-by: default avatarAthira Rajeev <atrajeev@linux.vnet.ibm.com>
Signed-off-by: default avatarMadhavan Srinivasan <maddy@linux.ibm.com>
    Link: https://patch.msgid.link/20250121131621.39054-2-atrajeev@linux.vnet.ibm.com



Signed-off-by: default avatarMamatha Inamdar <minamdar@redhat.com>
parent 0cdda9f8
No related branches found
No related tags found
No related merge requests found
......@@ -319,7 +319,13 @@ void isa207_get_mem_data_src(union perf_mem_data_src *dsrc, u32 flags,
return;
}
sier = mfspr(SPRN_SIER);
/*
* Use regs-dar for SPRN_SIER which is saved
* during perf_read_regs at the beginning
* of the PMU interrupt handler to avoid multiple
* reads of SPRN_SIER
*/
sier = regs->dar;
val = (sier & ISA207_SIER_TYPE_MASK) >> ISA207_SIER_TYPE_SHIFT;
if (val != 1 && val != 2 && !(val == 7 && cpu_has_feature(CPU_FTR_ARCH_31))) {
dsrc->val = 0;
......@@ -340,8 +346,12 @@ void isa207_get_mem_data_src(union perf_mem_data_src *dsrc, u32 flags,
* to determine the exact instruction type. If the sampling
* criteria is neither load or store, set the type as default
* to NA.
*
* Use regs->dsisr for MMCRA which is saved during perf_read_regs
* at the beginning of the PMU interrupt handler to avoid
* multiple reads of SPRN_MMCRA
*/
mmcra = mfspr(SPRN_MMCRA);
mmcra = regs->dsisr;
op_type = (mmcra >> MMCRA_SAMP_ELIG_SHIFT) & MMCRA_SAMP_ELIG_MASK;
switch (op_type) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment