[PATCH v3 09/14] KVM: arm64: Pass walk flags to kvm_pgtable_get_leaf()
Fuad Tabba
fuad.tabba at linux.dev
Wed Sep 23 04:07:32 PDT 2026
On Tue, 22 Sept 2026 at 15:19, Lorenzo Stoakes (ARM) <ljs at kernel.org> wrote:
>
> From: Jack Thomson <jackabt at amazon.com>
>
> Allow callers of kvm_pgtable_get_leaf() to specify the page-table walk
> flags, in preparation for performing walks under the MMU read lock.
>
> Reading a stage-2 leaf while only holding the read lock requires
> KVM_PGTABLE_WALK_SHARED: parallel faults (which also only hold the read
> lock) can unlink table pages and free them via RCU, so the walker must
> be inside an RCU read-side critical section, which the shared walk flag
> provides via kvm_pgtable_walk_begin().
>
> All existing callers either hold the write lock, walk with interrupts
> disabled, or run at hyp where shared walks are rejected; they keep the
> current behaviour by passing no flags.
>
> No functional change intended.
>
> Signed-off-by: Jack Thomson <jackabt at amazon.com>
> [ljs: fixup new kvm_pgtable_get_leaf() invocation]
> Signed-off-by: Lorenzo Stoakes (ARM) <ljs at kernel.org>
Reviewed-by: Fuad Tabba <fuad.tabba at linux.dev>
Cheers,
/fuad
More information about the linux-arm-kernel
mailing list