Re: [PATCH 02/30] KVM: arm64: Remove redundant 'pgt' pointer checks from MMU notifiers
From: Will Deacon <will@kernel.org>
Date: 2026-01-09 14:32:05
Also in:
kvmarm
From: Will Deacon <will@kernel.org>
Date: 2026-01-09 14:32:05
Also in:
kvmarm
On Tue, Jan 06, 2026 at 02:32:12PM +0000, Quentin Perret wrote:
On Monday 05 Jan 2026 at 15:49:10 (+0000), Will Deacon wrote:quoted
The MMU notifiers are registered by kvm_init_mmu_notifier() only after kvm_arch_init_vm() has returned successfully. Since the latter function initialises the 'kvm->arch.mmu.pgt' pointer (and allocates the VM handle when pKVM is enabled), the initialisation checks in the MMU notifiers are not required.It took me a while to remember, but I think these checks are needed for the free path rather than init. In particular, the doc for mmu_notifier_ops::release() (from which we free the pgt) says that it "can run concurrently with other mmu notifier" (see mmu_notifier.h), which is fun. Had you considered that path? If so, probably worth expanding in the commit description why this is safe?
Urgh.... Let me get back to you on that :) Will