public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 0/3] KVM: arm64: Fix teardown of non-protected VMs with pKVM
@ 2026-03-31 15:50 Will Deacon
  2026-03-31 15:50 ` [PATCH 1/3] KVM: arm64: Prevent teardown finalisation of referenced 'hyp_vm' Will Deacon
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Will Deacon @ 2026-03-31 15:50 UTC (permalink / raw)
  To: kvmarm
  Cc: linux-arm-kernel, Will Deacon, Marc Zyngier, Oliver Upton,
	Joey Gouly, Suzuki K Poulose, Zenghui Yu, Catalin Marinas,
	Quentin Perret, Fuad Tabba, Vincent Donnefort, Mostafa Saleh,
	Alexandru Elisei

Hi folks,

Sashiko continues to throw rocks at me.

This time, it spotted that my fix (introduced in v5 [1] of the pKVM
series) to prevent taking a reference on a VM in the 'is_dying' state
also prevents unsharing of pages shared with a non-protected VM if that
VM is torn down by its VM fd being destroyed, rather than the usual path
via the MMU notifiers.

Rather than send a v6 of the whole series, here are three patches that
apply on top of v5 and fix the issue by (a) preventing teardown of a
referenced VM and (b) allowing some references to be taken on a dying
VM. As an added bonus, this simplifies the locking on the reclaim path
because now a VM reference is enough to stop the page-tables from going
away.

Cheers,

Will

[1] https://lore.kernel.org/kvmarm/20260330144841.26181-1-will@kernel.org

Cc: Marc Zyngier <maz@kernel.org>
Cc: Oliver Upton <oupton@kernel.org>
Cc: Joey Gouly <joey.gouly@arm.com>
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
Cc: Zenghui Yu <yuzenghui@huawei.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Quentin Perret <qperret@google.com>
Cc: Fuad Tabba <tabba@google.com>
Cc: Vincent Donnefort <vdonnefort@google.com>
Cc: Mostafa Saleh <smostafa@google.com>
Cc: Alexandru Elisei <alexandru.elisei@arm.com>

--->8

Will Deacon (3):
  KVM: arm64: Prevent teardown finalisation of referenced 'hyp_vm'
  KVM: arm64: Allow get_pkvm_hyp_vm() to take a reference to a dying VM
  KVM: arm64: Don't hold 'vm_table_lock' across guest page reclaim

 arch/arm64/kvm/hyp/nvhe/pkvm.c | 53 +++++++++++++++++-----------------
 1 file changed, 26 insertions(+), 27 deletions(-)

-- 
2.53.0.1118.gaef5881109-goog



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

end of thread, other threads:[~2026-04-01 15:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-31 15:50 [PATCH 0/3] KVM: arm64: Fix teardown of non-protected VMs with pKVM Will Deacon
2026-03-31 15:50 ` [PATCH 1/3] KVM: arm64: Prevent teardown finalisation of referenced 'hyp_vm' Will Deacon
2026-03-31 15:50 ` [PATCH 2/3] KVM: arm64: Allow get_pkvm_hyp_vm() to take a reference to a dying VM Will Deacon
2026-03-31 15:50 ` [PATCH 3/3] KVM: arm64: Don't hold 'vm_table_lock' across guest page reclaim Will Deacon
2026-04-01 13:33 ` [PATCH 0/3] KVM: arm64: Fix teardown of non-protected VMs with pKVM Mark Brown
2026-04-01 15:29 ` Marc Zyngier

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