powerpc/perf: Disable trace_imc pmu
authorMadhavan Srinivasan <maddy@linux.vnet.ibm.com>
Mon, 18 Nov 2019 03:44:52 +0000 (09:14 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 5 Dec 2019 06:06:40 +0000 (17:06 +1100)
When a root user or a user with CAP_SYS_ADMIN privilege uses any
trace_imc performance monitoring unit events, to monitor application
or KVM threads, it may result in a checkstop (System crash).

The cause is frequent switching of the "trace/accumulation" mode of
the In-Memory Collection hardware (LDBAR).

This patch disables the trace_imc PMU unit entirely to avoid
triggering the checkstop. A future patch will reenable it at a later
stage once a workaround has been developed.

Fixes: 012ae244845f ("powerpc/perf: Trace imc PMU functions")
Cc: stable@vger.kernel.org # v5.2+
Signed-off-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
Tested-by: Hariharan T.S. <hari@linux.ibm.com>
[mpe: Add pr_info_once() so dmesg shows the PMU has been disabled]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20191118034452.9939-1-maddy@linux.vnet.ibm.com
arch/powerpc/platforms/powernv/opal-imc.c

index 3b4518f4b643d8328a9f38e3ee1da59a441cce14..000b350d4060ce424daec569df2e1a15602fc504 100644 (file)
@@ -278,7 +278,14 @@ static int opal_imc_counters_probe(struct platform_device *pdev)
                        domain = IMC_DOMAIN_THREAD;
                        break;
                case IMC_TYPE_TRACE:
-                       domain = IMC_DOMAIN_TRACE;
+                       /*
+                        * FIXME. Using trace_imc events to monitor application
+                        * or KVM thread performance can cause a checkstop
+                        * (system crash).
+                        * Disable it for now.
+                        */
+                       pr_info_once("IMC: disabling trace_imc PMU\n");
+                       domain = -1;
                        break;
                default:
                        pr_warn("IMC Unknown Device type \n");