linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/5] KVM: arm64: PMU: Fix PMUver related handling for vPMU support
@ 2023-07-28 18:19 Reiji Watanabe
  2023-07-28 18:19 ` [PATCH v2 1/5] KVM: arm64: PMU: Use of pmuv3_implemented() instead of open-coded version Reiji Watanabe
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Reiji Watanabe @ 2023-07-28 18:19 UTC (permalink / raw)
  To: Marc Zyngier, Oliver Upton, kvmarm
  Cc: kvm, linux-arm-kernel, James Morse, Alexandru Elisei, Zenghui Yu,
	Suzuki K Poulose, Jing Zhang, Raghavendra Rao Anata,
	Reiji Watanabe

This is a consolidated v2 of two separate series, [1] and [2].

On systems where the PMUVer is not uniform across all PEs,
KVM currently does not advertise PMUv3 to the guest,
even if userspace successfully runs KVM_ARM_VCPU_INIT with
KVM_ARM_VCPU_PMU_V3.
The patch-1 and patch-2 will address this inconsistent
behavior by disallowing userspace from configuring vPMU,
as such systems would be extremely uncommon and unlikely
to even use KVM (according to Marc [3]).

The patch-3 will fix improper use of the host's PMUver to
determine a valid range of PMU events for the guest (the
guest's PMUver should be used instead).

The patch-4 and patch-5 will try to hide the STALL_SLOT*
events unconditionally per Oliver's suggestion [4].

Presently, KVM hides the STALL_SLOT event depending on the
host PMU version, instead of the guest's PMU version, which
doesn't seem to be accurate, as it appears that older PMU than
PMUv3p4 could implement the event according to the Arm ARM.
Exposing the STALL_SLOT event without PMMIR_EL1 (supported
from PMUv3p4) for the guest won't be very useful though.
The patch-4 stops advertising the event for guest unconditionally,
rather than fixing or keeping the inaccurate checking to advertise
the event for the case, where it is not very useful.
The patch-5 stops advertising the STALL_SLOT_{FRONT,BACK}END
events to the guest, similar to the STALL_SLOT event, as when any
of these three events are implemented, all three of them should
be implemented, according to the Arm ARM.

This series is based on 6.5-rc3.

[1] https://lore.kernel.org/all/20230610061520.3026530-1-reijiw@google.com/
[2] https://lore.kernel.org/all/20230610194510.4146549-1-reijiw@google.com/
[3] https://lore.kernel.org/all/874jnqp73o.wl-maz@kernel.org/
[4] https://lore.kernel.org/all/ZIm1kdFBfXYMdfbV@linux.dev/

Reiji Watanabe (5):
  KVM: arm64: PMU: Use of pmuv3_implemented() instead of open-coded
    version
  KVM: arm64: PMU: Disallow vPMU on non-uniform PMUVer systems
  KVM: arm64: PMU: Avoid inappropriate use of host's PMUVer
  KVM: arm64: PMU: Don't advertise the STALL_SLOT event
  KVM: arm64: PMU: Don't advertise STALL_SLOT_{FRONTEND,BACKEND}

 arch/arm64/kvm/arm.c      |  1 +
 arch/arm64/kvm/pmu-emul.c | 44 ++++++++++++++++++++++++++-------------
 include/kvm/arm_pmu.h     |  3 +++
 3 files changed, 34 insertions(+), 14 deletions(-)


base-commit: 6eaae198076080886b9e7d57f4ae06fa782f90ef
-- 
2.41.0.585.gd2178a4bd4-goog


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-07-31 16:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-28 18:19 [PATCH v2 0/5] KVM: arm64: PMU: Fix PMUver related handling for vPMU support Reiji Watanabe
2023-07-28 18:19 ` [PATCH v2 1/5] KVM: arm64: PMU: Use of pmuv3_implemented() instead of open-coded version Reiji Watanabe
2023-07-28 18:19 ` [PATCH v2 2/5] KVM: arm64: PMU: Disallow vPMU on non-uniform PMUVer systems Reiji Watanabe
2023-07-28 19:52   ` Oliver Upton
2023-07-31 11:54     ` Reiji Watanabe
2023-07-31 16:41       ` Oliver Upton
2023-07-28 18:19 ` [PATCH v2 3/5] KVM: arm64: PMU: Avoid inappropriate use of host's PMUVer Reiji Watanabe
2023-07-28 18:19 ` [PATCH v2 4/5] KVM: arm64: PMU: Don't advertise the STALL_SLOT event Reiji Watanabe
2023-07-28 18:19 ` [PATCH v2 5/5] KVM: arm64: PMU: Don't advertise STALL_SLOT_{FRONTEND,BACKEND} Reiji Watanabe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).