OSDN Git Service

KVM: arm64: Always zero invalid PTEs
authorQuentin Perret <qperret@google.com>
Fri, 19 Mar 2021 10:01:36 +0000 (10:01 +0000)
committerMarc Zyngier <maz@kernel.org>
Fri, 19 Mar 2021 12:01:22 +0000 (12:01 +0000)
commitf60ca2f9321a71ee3d2a7bd620c1827b82ce05f2
tree9c952b4ee0c020d4dd7f3c484abd27d3e8df168f
parenta14307f5310c737744641ff8da7a8d491c3c85cd
KVM: arm64: Always zero invalid PTEs

kvm_set_invalid_pte() currently only clears bit 0 from a PTE because
stage2_map_walk_table_post() needs to be able to follow the anchor. In
preparation for re-using bits 63-01 from invalid PTEs, make sure to zero
it entirely by ensuring to cache the anchor's child upfront.

Acked-by: Will Deacon <will@kernel.org>
Suggested-by: Will Deacon <will@kernel.org>
Signed-off-by: Quentin Perret <qperret@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20210319100146.1149909-29-qperret@google.com
arch/arm64/kvm/hyp/pgtable.c