Message ID | 20220711034927.213192-2-kjain@linux.ibm.com (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
Series | [1/2] powerpc/kvm: Move pmu code in kvm folder to separate file for power9 and later platforms | expand |
Context | Check | Description |
---|---|---|
snowpatch_ozlabs/github-powerpc_selftests | success | Successfully ran 10 jobs. |
snowpatch_ozlabs/github-powerpc_ppctests | success | Successfully ran 10 jobs. |
snowpatch_ozlabs/github-powerpc_clang | success | Successfully ran 7 jobs. |
snowpatch_ozlabs/github-powerpc_sparse | success | Successfully ran 4 jobs. |
snowpatch_ozlabs/github-powerpc_kernel_qemu | success | Successfully ran 23 jobs. |
Excerpts from Kajol Jain's message of July 11, 2022 1:49 pm: > Commit aabcaf6ae2a0 ("KVM: PPC: Book3S HV P9: Move host OS save/restore > functions to built-in") added a comment in switch_pmu_to_guest > function, indicating possibility of moving PMU handling code > to perf subsystem. But perf subsystem code compilation depends upon > the enablement of CONFIG_PERF_EVENTS whereas, kvm code don't have > any dependency on this config. > Patch remove this comment as switch_pmu_to_guest functionality is > needed even if perf subsystem is disabled. > > Signed-off-by: Kajol Jain <kjain@linux.ibm.com> Does the host PMU state need to be saved/restored if we don't have PERF_EVENTS enabled? Guest yes, but host maybe could become a no-op? Thanks, Nick > --- > arch/powerpc/kvm/book3s_hv_p9_perf.c | 6 ------ > 1 file changed, 6 deletions(-) > > diff --git a/arch/powerpc/kvm/book3s_hv_p9_perf.c b/arch/powerpc/kvm/book3s_hv_p9_perf.c > index da3135cab9ea..44d24cca3df1 100644 > --- a/arch/powerpc/kvm/book3s_hv_p9_perf.c > +++ b/arch/powerpc/kvm/book3s_hv_p9_perf.c > @@ -44,12 +44,6 @@ void switch_pmu_to_guest(struct kvm_vcpu *vcpu, > > /* Save host */ > if (ppc_get_pmu_inuse()) { > - /* > - * It might be better to put PMU handling (at least for the > - * host) in the perf subsystem because it knows more about what > - * is being used. > - */ > - > /* POWER9, POWER10 do not implement HPMC or SPMC */ > > host_os_sprs->mmcr0 = mfspr(SPRN_MMCR0); > -- > 2.27.0 > >
diff --git a/arch/powerpc/kvm/book3s_hv_p9_perf.c b/arch/powerpc/kvm/book3s_hv_p9_perf.c index da3135cab9ea..44d24cca3df1 100644 --- a/arch/powerpc/kvm/book3s_hv_p9_perf.c +++ b/arch/powerpc/kvm/book3s_hv_p9_perf.c @@ -44,12 +44,6 @@ void switch_pmu_to_guest(struct kvm_vcpu *vcpu, /* Save host */ if (ppc_get_pmu_inuse()) { - /* - * It might be better to put PMU handling (at least for the - * host) in the perf subsystem because it knows more about what - * is being used. - */ - /* POWER9, POWER10 do not implement HPMC or SPMC */ host_os_sprs->mmcr0 = mfspr(SPRN_MMCR0);
Commit aabcaf6ae2a0 ("KVM: PPC: Book3S HV P9: Move host OS save/restore functions to built-in") added a comment in switch_pmu_to_guest function, indicating possibility of moving PMU handling code to perf subsystem. But perf subsystem code compilation depends upon the enablement of CONFIG_PERF_EVENTS whereas, kvm code don't have any dependency on this config. Patch remove this comment as switch_pmu_to_guest functionality is needed even if perf subsystem is disabled. Signed-off-by: Kajol Jain <kjain@linux.ibm.com> --- arch/powerpc/kvm/book3s_hv_p9_perf.c | 6 ------ 1 file changed, 6 deletions(-)