Skip to contentSkip to conversation

KVM: PPC: Kconfig: Enable CONFIG_VPA_PMU with KVM

PATCH In review Gautam Menghani 3 participants 5 messages May 18 – May 27

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 KVM: PPC: Kconfig: Enable CONFIG_VPA_PMU with KVM

Enable CONFIG_VPA_PMU with KVM to enable its usage. Currently, the vpa-pmu driver cannot be used since it is not enabled in distro configs.

On fedora kernel 6.13.7, the config option is disabled:

$ cat /boot/config-6.19.12-200.fc43.ppc64le  | grep VPA_PMU
 # CONFIG_VPA_PMU is not set
Fixes 176cda0619b6c ("powerpc/perf: Add perf interface to expose vpa counters")
Cc [email protected] # v6.13+

---
v1 -> v2:
1. Rebased on latest master

 arch/powerpc/kvm/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/powerpc/kvm/Kconfig +1 -0
index 9a0d1c1aca6c..56e86b46ff13 100644
@@ -82,6 +82,7 @@ config KVM_BOOK3S_64_HV
 	select KVM_BOOK3S_HV_POSSIBLE
 	select KVM_BOOK3S_HV_PMU
 	select CMA
+	select VPA_PMU if HV_PERF_CTRS
 	help
 	  Support running unmodified book3s_64 guest kernels in
 	  virtual machines on POWER7 and newer processors that have
Signature · 1 line
2.53.0
#1 lore raw
Quoted 2 lines · Gautam Menghani

Enable CONFIG_VPA_PMU with KVM to enable its usage. Currently, the vpa-pmu driver cannot be used since it is not enabled in distro configs.

That seems like a problem to take up with distros, no?

Reviewed-by on v2 1/1
#4 lore raw
In reply to Gautam Menghani
Quoted 3 lines · Gautam Menghani

Enable CONFIG_VPA_PMU with KVM to enable its usage. Currently, the vpa-pmu driver cannot be used since it is not enabled in distro configs.

I think the commit log needs a rephrase as irrespective of current state of distro configs, it makes sense to enable CONFIG_VPA_PMU for KVM guests on Power by default since this is the only use-case for VPA counters (i.e. in a KVM guest).

Quoted 19 lines

On fedora kernel 6.13.7, the config option is disabled:

$ cat /boot/config-6.19.12-200.fc43.ppc64le  | grep VPA_PMU
  # CONFIG_VPA_PMU is not set
Fixes 176cda0619b6c ("powerpc/perf: Add perf interface to expose vpa counters")
Cc [email protected] # v6.13+

---
v1 -> v2:
1. Rebased on latest master

  arch/powerpc/kvm/Kconfig | 1 +
  1 file changed, 1 insertion(+)
arch/powerpc/kvm/Kconfig +0 -0
index 9a0d1c1aca6c..56e86b46ff13 100644

arch/powerpc/kvm/Kconfig config KVM_BOOK3S_64_HV · line 85

Quoted 4 lines
arch/powerpc/kvm/Kconfig +1 -0
@@ -82,6 +82,7 @@ config KVM_BOOK3S_64_HV
  	select KVM_BOOK3S_HV_POSSIBLE
  	select KVM_BOOK3S_HV_PMU
  	select CMA
+	select VPA_PMU if HV_PERF_CTRS

Also, since we already select KVM_BOOK3S_HV_PMU, VPA_PMU is a natural extension, provided we enable only if the required dependecy is enabled.

With an update to the changelog with suggested rationale:

Quoted 3 lines
arch/powerpc/kvm/Kconfig +0 -0
  	help
  	  Support running unmodified book3s_64 guest kernels in
  	  virtual machines on POWER7 and newer processors that have
#2 lore raw
In reply to Sean Christopherson
Quoted 5 lines · Sean Christopherson
Quoted 2 lines · Gautam Menghani

Enable CONFIG_VPA_PMU with KVM to enable its usage. Currently, the vpa-pmu driver cannot be used since it is not enabled in distro configs.

That seems like a problem to take up with distros, no?

Rather than enabling individually for different distros, wouldn't it be better if it is enabled with KVM automatically? I can rephrase the commit log to emphasize that this config option is only relevant for KVM (similar to CONFIG_KVM_BOOK3S_HV_PMU).

Thanks,
Gautam

#3 lore raw
Quoted 11 lines · Gautam Menghani
Quoted 5 lines · Sean Christopherson
Quoted 2 lines · Gautam Menghani

Enable CONFIG_VPA_PMU with KVM to enable its usage. Currently, the vpa-pmu driver cannot be used since it is not enabled in distro configs.

That seems like a problem to take up with distros, no?

Rather than enabling individually for different distros, wouldn't it be better if it is enabled with KVM automatically? I can rephrase the commit log to emphasize that this config option is only relevant for KVM (similar to CONFIG_KVM_BOOK3S_HV_PMU).

Not if you can't turn it off. As proposed, CONFIG_VPA_PMU gets forced to whatever CONFIG_KVM_BOOK3S_64_HV is set to. At that point, the existence of the VPA_PMU Kconfig is pointless.

If you want it enabled by _default_, then turn it on by default, e.g.

powerpc/platforms/pseries/Kconfig +1 -0
index f7052b131a4c..74910ce3a541 100644
@@ -154,6 +154,7 @@ config HV_PERF_CTRS
 config VPA_PMU
        tristate "VPA PMU events"
        depends on KVM_BOOK3S_64_HV && HV_PERF_CTRS
+       default m
        help
          Enable access to the VPA PMU counters via perf. This enables
          code that support measurement for KVM on PowerVM(KoP) feature.