kvmarm.lists.cs.columbia.edu archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] KVM: arm64: PMU: Preserve vPMC registers properly on migration
@ 2023-03-13  3:29 Reiji Watanabe
  2023-03-13 18:04 ` Oliver Upton
  0 siblings, 1 reply; 2+ messages in thread
From: Reiji Watanabe @ 2023-03-13  3:29 UTC (permalink / raw)
  To: Marc Zyngier, Oliver Upton, kvmarm
  Cc: kvm, linux-arm-kernel, James Morse, Alexandru Elisei, Zenghui Yu,
	Suzuki K Poulose, Paolo Bonzini, Ricardo Koller, Jing Zhang,
	Raghavendra Rao Anata, Will Deacon, Reiji Watanabe

The series fixes two problems in preserving vPMU counter (vPMC)
registers (PMCCNTR_EL0/PMEVCNTR<n>_EL0) during migration.

One of the problems is that KVM may not return the current values
of the vPMC registers for KVM_GET_ONE_REG.

The other one might cause KVM to reset the vPMC registers on the
first KVM_RUN on the destination. This is because userspace might
save PMCR_EL0 with PMCR_EL0.{C,P} bits set on the source, and
restore it on the destination.

See patch-1 and patch-2 for details on these issues respectively.

The series is based on v6.3-rc2.

v2:
 - Collect Marc's r-b tags (Thank you!)
 - Added "Fixes:" tags
 - Added Cc: to stable
 - Cosmetics change (remove one line break in kvm_pmu_handle_pmcr())

v1: https://lore.kernel.org/all/20230302055033.3081456-1-reijiw@google.com/

Reiji Watanabe (2):
  KVM: arm64: PMU: Fix GET_ONE_REG for vPMC regs to return the current
    value
  KVM: arm64: PMU: Don't save PMCR_EL0.{C,P} for the vCPU

 arch/arm64/kvm/pmu-emul.c |  3 ++-
 arch/arm64/kvm/sys_regs.c | 21 +++++++++++++++++++--
 2 files changed, 21 insertions(+), 3 deletions(-)


base-commit: eeac8ede17557680855031c6f305ece2378af326
-- 
2.40.0.rc1.284.g88254d51c5-goog


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

* Re: [PATCH v2 0/2] KVM: arm64: PMU: Preserve vPMC registers properly on migration
  2023-03-13  3:29 [PATCH v2 0/2] KVM: arm64: PMU: Preserve vPMC registers properly on migration Reiji Watanabe
@ 2023-03-13 18:04 ` Oliver Upton
  0 siblings, 0 replies; 2+ messages in thread
From: Oliver Upton @ 2023-03-13 18:04 UTC (permalink / raw)
  To: Reiji Watanabe
  Cc: Marc Zyngier, kvmarm, kvm, linux-arm-kernel, James Morse,
	Alexandru Elisei, Zenghui Yu, Suzuki K Poulose, Paolo Bonzini,
	Ricardo Koller, Jing Zhang, Raghavendra Rao Anata, Will Deacon

Hi Reiji,

On Sun, Mar 12, 2023 at 08:29:03PM -0700, Reiji Watanabe wrote:
> The series fixes two problems in preserving vPMU counter (vPMC)
> registers (PMCCNTR_EL0/PMEVCNTR<n>_EL0) during migration.
> 
> One of the problems is that KVM may not return the current values
> of the vPMC registers for KVM_GET_ONE_REG.
> 
> The other one might cause KVM to reset the vPMC registers on the
> first KVM_RUN on the destination. This is because userspace might
> save PMCR_EL0 with PMCR_EL0.{C,P} bits set on the source, and
> restore it on the destination.
> 
> See patch-1 and patch-2 for details on these issues respectively.
> 
> The series is based on v6.3-rc2.
> 
> v2:
>  - Collect Marc's r-b tags (Thank you!)
>  - Added "Fixes:" tags
>  - Added Cc: to stable
>  - Cosmetics change (remove one line break in kvm_pmu_handle_pmcr())
> 
> v1: https://lore.kernel.org/all/20230302055033.3081456-1-reijiw@google.com/
> 
> Reiji Watanabe (2):
>   KVM: arm64: PMU: Fix GET_ONE_REG for vPMC regs to return the current
>     value
>   KVM: arm64: PMU: Don't save PMCR_EL0.{C,P} for the vCPU

I received both of these patches as indepentent emails instead of replies to
the cover letter (i.e. In-Reply-To header is missing). I was able to find
both patches but just wanted to let you know so you can debug your tooling.

-- 
Thanks,
Oliver

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

end of thread, other threads:[~2023-03-13 18:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-13  3:29 [PATCH v2 0/2] KVM: arm64: PMU: Preserve vPMC registers properly on migration Reiji Watanabe
2023-03-13 18:04 ` Oliver Upton

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).