Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/2] KVM: arm64: Clear VM-wide state when kvm_setup_vcpu() fails
@ 2026-11-02  7:58 Fuad Tabba
  2026-11-02  7:58 ` [PATCH v4 1/2] KVM: arm64: Clear the VM's feature bitmap " Fuad Tabba
  2026-11-02  7:58 ` [PATCH v4 2/2] KVM: arm64: Clear the default PMU " Fuad Tabba
  0 siblings, 2 replies; 7+ messages in thread
From: Fuad Tabba @ 2026-11-02  7:58 UTC (permalink / raw)
  To: Marc Zyngier, Oliver Upton
  Cc: Joey Gouly, Steffen Eiden, Suzuki K Poulose, Zenghui Yu,
	Will Deacon, Lorenzo Stoakes, Jack Thomson, Congkai Tan, kvmarm,
	linux-arm-kernel, linux-kernel, Fuad Tabba

Hi folks,

Changes since v3 [1]:
  - New patch 2, clearing the default PMU left set by a failed INIT.
  - Reworded patch 1's commit message.
  - Rebased on 7.4-rc1.

A KVM_ARM_VCPU_INIT whose kvm_setup_vcpu() fails doesn't undo its
changes to VM-wide state. Patch 1 clears the feature bitmap, which the
PMU attributes read before the vCPU is initialized. Patch 2 clears the
default PMU, which a retry with KVM_ARM_VCPU_PMU_V3_STRICT would
otherwise inherit.

Tested under QEMU on a host without FEAT_NV1 (an Apple M2 MIDR,
for which has_nv1() returns false), with a reproducer that fails an
INIT and then initializes the PMU, directly for patch 1 and after a
STRICT retry for patch 2.

Based on Linux 7.4-rc1.

Cheers,
/fuad

[1] https://lore.kernel.org/all/20260921190843.107881-1-fuad.tabba@linux.dev/

Fuad Tabba (2):
  KVM: arm64: Clear the VM's feature bitmap when kvm_setup_vcpu() fails
  KVM: arm64: Clear the default PMU when kvm_setup_vcpu() fails

 arch/arm64/kvm/arm.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)


base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
-- 
2.47.3



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

end of thread, other threads:[~2026-11-02  9:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-02  7:58 [PATCH v4 0/2] KVM: arm64: Clear VM-wide state when kvm_setup_vcpu() fails Fuad Tabba
2026-11-02  7:58 ` [PATCH v4 1/2] KVM: arm64: Clear the VM's feature bitmap " Fuad Tabba
2026-11-02  9:24   ` Suzuki K Poulose
2026-11-02  9:42     ` Fuad Tabba
2026-11-02  9:48       ` Suzuki K Poulose
2026-11-02  7:58 ` [PATCH v4 2/2] KVM: arm64: Clear the default PMU " Fuad Tabba
2026-11-02  9:56   ` Suzuki K Poulose

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