diff options
author | Oliver Upton <oliver.upton@linux.dev> | 2022-11-18 18:22:22 +0000 |
---|---|---|
committer | Marc Zyngier <maz@kernel.org> | 2022-11-22 13:05:53 +0000 |
commit | 5e806c5812e8012a83496cf96bdba266b3aec428 (patch) | |
tree | 5809e114c7d67e6e534fbf9c64c90a17474b4e63 /arch/arm64/kvm/hyp/pgtable.c | |
parent | b7833bf202e3068abb77c642a0843f696e9c8d38 (diff) | |
download | linux-next-5e806c5812e8012a83496cf96bdba266b3aec428.tar.gz |
KVM: arm64: Reject shared table walks in the hyp code
Exclusive table walks are the only supported table walk in the hyp, as
there is no construct like RCU available in the hypervisor code. Reject
any attempt to do a shared table walk by returning an error and allowing
the caller to clean up the mess.
Suggested-by: Will Deacon <will@kernel.org>
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
Acked-by: Will Deacon <will@kernel.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20221118182222.3932898-4-oliver.upton@linux.dev
Diffstat (limited to 'arch/arm64/kvm/hyp/pgtable.c')
-rw-r--r-- | arch/arm64/kvm/hyp/pgtable.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/arm64/kvm/hyp/pgtable.c b/arch/arm64/kvm/hyp/pgtable.c index d6f3753cb87e..58dbe0ab567f 100644 --- a/arch/arm64/kvm/hyp/pgtable.c +++ b/arch/arm64/kvm/hyp/pgtable.c @@ -289,7 +289,10 @@ int kvm_pgtable_walk(struct kvm_pgtable *pgt, u64 addr, u64 size, }; int r; - kvm_pgtable_walk_begin(walker); + r = kvm_pgtable_walk_begin(walker); + if (r) + return r; + r = _kvm_pgtable_walk(pgt, &walk_data); kvm_pgtable_walk_end(walker); |