[PATCH 02/30] KVM: arm64: Remove redundant 'pgt' pointer checks from MMU notifiers
Quentin Perret
qperret at google.com
Tue Jan 6 06:32:12 PST 2026
Hey Will,
On Monday 05 Jan 2026 at 15:49:10 (+0000), Will Deacon wrote:
> 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?
Cheers,
Quentin
More information about the linux-arm-kernel
mailing list