mbox series

[v4,0/4] KVM: arm64: Do not communicate host pmu event changes by accessing hyp data

Message ID 20220510095710.148178-1-tabba@google.com (mailing list archive)
Headers show
Series KVM: arm64: Do not communicate host pmu event changes by accessing hyp data | expand

Message

Fuad Tabba May 10, 2022, 9:57 a.m. UTC
Hi,

This series changes the way KVM communicates host pmu event changes to the
hypervisor in nvhe and protected mode. Instead of accessing hyp data directly
from the host, the data is passed to hyp via the loaded vcpu. This provides
more isolation between the host and the hypervisor, and allows us to use pmu in
protected mode.

This series is based on kvmarm/next (8c22fd2d4cfa).

Changes since V3 [1]:
- Fix/clarify commit messages (Oliver)
- Reduce scope of kvm_pmu_events (Oliver/Marc)

Changes since V2 [2]:
- Update the guest view of the pmu events after interrupts have been disabled
  (Marc)

Changes since V1 [3]:
- Repack struct kvm_pmu to remove all (two) holes (Marc)
- Updating the guest's view of the pmu events before every vcpu run rather than
  vcpu load to avoid missing updates (Marc)

Thanks,
/fuad

[1] https://lore.kernel.org/all/20220509120330.3043773-1-tabba@google.com/
[2] https://lore.kernel.org/all/20220509095500.2408785-1-tabba@google.com/
[3] https://lore.kernel.org/linux-arm-kernel/20220408084052.3310931-1-tabba@google.com/

Fuad Tabba (4):
  KVM: arm64: Wrapper for getting pmu_events
  KVM: arm64: Repack struct kvm_pmu to reduce size
  KVM: arm64: Pass pmu events to hyp via vcpu
  KVM: arm64: Reenable pmu in Protected Mode

 arch/arm64/include/asm/kvm_host.h |  7 +-----
 arch/arm64/kvm/arm.c              | 15 ++++++++++++
 arch/arm64/kvm/hyp/nvhe/switch.c  | 20 +++++-----------
 arch/arm64/kvm/pmu-emul.c         |  3 +--
 arch/arm64/kvm/pmu.c              | 40 ++++++++++++++++++-------------
 include/kvm/arm_pmu.h             | 10 ++++++--
 6 files changed, 54 insertions(+), 41 deletions(-)


base-commit: 8c22fd2d4cfaab2ae3c5859496c894df58ab014b

Comments

Marc Zyngier May 15, 2022, 10:29 a.m. UTC | #1
Hi Fuad,

On 2022-05-10 10:57, Fuad Tabba wrote:
> Hi,
> 
> This series changes the way KVM communicates host pmu event changes to 
> the
> hypervisor in nvhe and protected mode. Instead of accessing hyp data 
> directly
> from the host, the data is passed to hyp via the loaded vcpu. This 
> provides
> more isolation between the host and the hypervisor, and allows us to 
> use pmu in
> protected mode.
> 
> This series is based on kvmarm/next (8c22fd2d4cfa).

In the future, please don't do that. *Always* base your patches
on something stable (preferably an early -rc, as I usually start
pulling stuff in around -rc3).

kvmarm/next is a moving target, and basing things on top of it
results in an uncontrolled dependency chain. If your series depends
on something and makes it impossible to base your patches on an rc,
please state so (this isn't the case here).

Thanks,

         M.
Marc Zyngier May 15, 2022, 10:57 a.m. UTC | #2
On Tue, 10 May 2022 09:57:06 +0000, Fuad Tabba wrote:
> This series changes the way KVM communicates host pmu event changes to the
> hypervisor in nvhe and protected mode. Instead of accessing hyp data directly
> from the host, the data is passed to hyp via the loaded vcpu. This provides
> more isolation between the host and the hypervisor, and allows us to use pmu in
> protected mode.
> 
> This series is based on kvmarm/next (8c22fd2d4cfa).
> 
> [...]

Applied to next, thanks!

[1/4] KVM: arm64: Wrapper for getting pmu_events
      commit: 3cb8a091a7016be0ee5420ff6c1928972e3ce23e
[2/4] KVM: arm64: Repack struct kvm_pmu to reduce size
      commit: e987a4c60f9755b2f7a19bf1b5ef2eb74c90579b
[3/4] KVM: arm64: Pass pmu events to hyp via vcpu
      commit: 84d751a019a9792f5b4884e1d598b603c360ec22
[4/4] KVM: arm64: Reenable pmu in Protected Mode
      commit: 722625c6f4c5b6a9953d6af04c7bb1a6e12830b3

Cheers,

	M.