mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/3] KVM: arm64: Fix PMU handling in pKVM
@ 2026-10-27  8:11 Fuad Tabba
  2026-10-27  8:11 ` [PATCH 1/3] KVM: arm64: Synchronise kvm_host_data before host deprivileging Fuad Tabba
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Fuad Tabba @ 2026-10-27  8:11 UTC (permalink / raw)
  To: Marc Zyngier, Oliver Upton, kvmarm, linux-arm-kernel
  Cc: Joey Gouly, Steffen Eiden, Suzuki K Poulose, Zenghui Yu,
	Catalin Marinas, Will Deacon, Mark Rutland, Vincent Donnefort,
	kernel-team, linux-kernel, Oculytic, Fuad Tabba

Hi folks,

Two fixes and a hardening patch for PMU handling in pKVM, as one series
[1].

The first is Vincent's rework of his HPMN fix. It supersedes his earlier
posting [2]. Rather than read nr_event_counters through a different
accessor, the host now copies the hypervisor's kvm_host_data before it's
deprivileged, so host_data_ptr() returns what was set up at init.
Otherwise, HPMN is 0 and a non-protected guest's event counters don't
count.

The second is the non-protected half of Oliver's patch from 2024 [3]. It
passes the host's PMU events to the hyp vCPU of a non-protected guest,
whose counters otherwise all read 0.

The third covers the protected half. It stops the host's counters while
a protected guest runs, so the host can't count the guest's cycles and
events. Side channels are outside pKVM's threat model, so it carries no
Fixes: tag.

Based on kvmarm/next (dd0bc00e3e920).

Cheers,
/fuad

[1] https://lore.kernel.org/all/86bj8kzix4.wl-maz@kernel.org/
[2] https://lore.kernel.org/all/20261023092007.3918848-1-vdonnefort@google.com/
[3] https://lore.kernel.org/all/20240305184840.636212-2-oliver.upton@linux.dev/

Fuad Tabba (1):
  KVM: arm64: Disable host PMU counters for protected guests

Oliver Upton (1):
  KVM: arm64: Pass the PMU events to the hyp vCPU of non-protected
    guests

Vincent Donnefort (1):
  KVM: arm64: Synchronise kvm_host_data before host deprivileging

 arch/arm64/include/asm/kvm_host.h  |  1 +
 arch/arm64/kvm/debug.c             |  4 +++-
 arch/arm64/kvm/hyp/nvhe/hyp-main.c | 11 +++++++++++
 arch/arm64/kvm/hyp/nvhe/switch.c   | 24 ++++++++++++++++++++++++
 arch/arm64/kvm/pkvm.c              |  6 ++++++
 5 files changed, 45 insertions(+), 1 deletion(-)


base-commit: dd0bc00e3e9201fd49b62ff9cc07890c89003afe
-- 
2.47.3


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

end of thread, other threads:[~2026-10-27 11:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-27  8:11 [PATCH 0/3] KVM: arm64: Fix PMU handling in pKVM Fuad Tabba
2026-10-27  8:11 ` [PATCH 1/3] KVM: arm64: Synchronise kvm_host_data before host deprivileging Fuad Tabba
2026-10-27  8:11 ` [PATCH 2/3] KVM: arm64: Pass the PMU events to the hyp vCPU of non-protected guests Fuad Tabba
2026-10-27 11:05   ` Vincent Donnefort
2026-10-27  8:11 ` [PATCH 3/3] KVM: arm64: Disable host PMU counters for protected guests Fuad Tabba
2026-10-27  9:32   ` Marc Zyngier
2026-10-27  9:41     ` Fuad Tabba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®