Message ID | 1585658626-17896-1-git-send-email-atrajeev@linux.vnet.ibm.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | [v2] powerpc/perf: Add documentation around use of "ppc_set_pmu_inuse" in PMU core-book3s | expand |
Context | Check | Description |
---|---|---|
snowpatch_ozlabs/apply_patch | success | Successfully applied on branch powerpc/merge (c6624071c338732402e8c726df6a4074473eaa0e) |
snowpatch_ozlabs/build-ppc64le | success | Build succeeded |
snowpatch_ozlabs/build-ppc64be | success | Build succeeded |
snowpatch_ozlabs/build-ppc64e | success | Build succeeded |
snowpatch_ozlabs/build-pmac32 | success | Build succeeded |
snowpatch_ozlabs/checkpatch | success | total: 0 errors, 0 warnings, 0 checks, 22 lines checked |
snowpatch_ozlabs/needsstable | success | Patch has no Fixes tags |
diff --git a/arch/powerpc/perf/core-book3s.c b/arch/powerpc/perf/core-book3s.c index 3086055..48bfdc9 100644 --- a/arch/powerpc/perf/core-book3s.c +++ b/arch/powerpc/perf/core-book3s.c @@ -1285,6 +1285,11 @@ static void power_pmu_enable(struct pmu *pmu) goto out; if (cpuhw->n_events == 0) { + /* + * Indicate PMU not in-use to Hypervisor. + * We end-up here via "ctx_sched_out()" from common code and + * "power_pmu_del()". + */ ppc_set_pmu_inuse(0); goto out; } @@ -1341,6 +1346,11 @@ static void power_pmu_enable(struct pmu *pmu) * Write the new configuration to MMCR* with the freeze * bit set and set the hardware events to their initial values. * Then unfreeze the events. + * ppc_set_pmu_inuse(1): "power_pmu_enable" will unset the + * "pmcregs_in_use" flag when a previous profiling/sampling session + * is completed and un-setting of flag will notify the Hypervisor to + * drop save/restore of PMU sprs. Now that PMU need to be enabled, first + * set the "pmcregs_in_use" flag in VPA. */ ppc_set_pmu_inuse(1); mtspr(SPRN_MMCRA, cpuhw->mmcr[2] & ~MMCRA_SAMPLE_ENABLE);