KVM: arm64: Stash observed pte value in visitor context
authorOliver Upton <oliver.upton@linux.dev>
Mon, 7 Nov 2022 21:56:32 +0000 (21:56 +0000)
committerMarc Zyngier <maz@kernel.org>
Thu, 10 Nov 2022 14:43:46 +0000 (14:43 +0000)
commit83844a2317ecad935f6735abd854e4bf3f757040
tree82ebdf8fb6f509b8f584bf53e8b8f20a42e42cda
parentdfc7a7769ab7f2a2f629c673717ef1fa7b63aa42
KVM: arm64: Stash observed pte value in visitor context

Rather than reading the ptep all over the shop, read the ptep once from
__kvm_pgtable_visit() and stick it in the visitor context. Reread the
ptep after visiting a leaf in case the callback installed a new table
underneath.

No functional change intended.

Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
Reviewed-by: Ben Gardon <bgardon@google.com>
Reviewed-by: Gavin Shan <gshan@redhat.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20221107215644.1895162-3-oliver.upton@linux.dev
arch/arm64/include/asm/kvm_pgtable.h
arch/arm64/kvm/hyp/nvhe/mem_protect.c
arch/arm64/kvm/hyp/nvhe/setup.c
arch/arm64/kvm/hyp/pgtable.c