[PATCH] powerpc/perf: Fix crash with 'is_sier_available' when pmu is not set

Sachin Sant sachinp at linux.vnet.ibm.com
Mon Nov 23 21:55:36 AEDT 2020


> When perf record session started with "-I" option, capture registers
> via intr-regs, on each sample ‘is_sier_available()'i is called to check
> for the SIER ( Sample Instruction Event Register) availability in the
> platform. This function in core-book3s access 'ppmu->flags'. If platform
> specific pmu driver is not registered, ppmu is set to null and accessing
> its members results in crash. Patch fixes this by returning false in
> 'is_sier_available()' if 'ppmu' is not set.
> 
> Fixes: 333804dc3b7a ("powerpc/perf: Update perf_regs structure to include SIER")
> Reported-by: Sachin Sant <sachinp at linux.vnet.ibm.com>
> Signed-off-by: Athira Rajeev <atrajeev at linux.vnet.ibm.com>

Tested-by: Sachin Sant <sachinp at linux.vnet.ibm.com>

Thanks
-Sachin


More information about the Linuxppc-dev mailing list