Skip to content

KVM: arm64: Clear VM-wide state when kvm_setup_vcpu() fails

Fuad Tabba kvmarm linux-arm-kernel lkml 4 versions – Applied

Status from this message: Applied to fixes, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest2 patches 5 repliesApplied
  2. v31 patch 1 replySuperseded
  3. v21 patch 6 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v11 patch2 repliesSuperseded

Patches in v4 Applied

#Subject and filesSizeRepliesApplied
1/2KVM: arm64: Clear the VM's feature bitmap when kvm_setup_vcpu() failsarch/arm64/kvm/arm.c+6 -13 replies
2/2KVM: arm64: Clear the default PMU when kvm_setup_vcpu() failsarch/arm64/kvm/arm.c+5 -21 reply

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchLorenzo Stoakes (ARM)Suzuki K Poulose
1/2R-b R-b R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 0/2] KVM: arm64: Clear VM-wide state when kvm_setup_vcpu() fails

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/[email protected]/

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

Signature · 1 line
2.47.3