Skip to content

Commit af87fc0

Browse files
ouptonMarc Zyngier
authored andcommitted
KVM: arm64: Make table->block changes parallel-aware
stage2_map_walker_try_leaf() and friends now handle stage-2 PTEs generically, and perform the correct flush when a table PTE is removed. Additionally, they've been made parallel-aware, using an atomic break to take ownership of the PTE. Stop clearing the PTE in the pre-order callback and instead let stage2_map_walker_try_leaf() deal with it. Signed-off-by: Oliver Upton <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 946fbfd commit af87fc0

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

arch/arm64/kvm/hyp/pgtable.c

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -841,21 +841,12 @@ static int stage2_map_walk_table_pre(const struct kvm_pgtable_visit_ctx *ctx,
841841
if (!stage2_leaf_mapping_allowed(ctx, data))
842842
return 0;
843843

844-
kvm_clear_pte(ctx->ptep);
845-
846-
/*
847-
* Invalidate the whole stage-2, as we may have numerous leaf
848-
* entries below us which would otherwise need invalidating
849-
* individually.
850-
*/
851-
kvm_call_hyp(__kvm_tlb_flush_vmid, data->mmu);
852-
853844
ret = stage2_map_walker_try_leaf(ctx, data);
845+
if (ret)
846+
return ret;
854847

855-
mm_ops->put_page(ctx->ptep);
856848
mm_ops->free_removed_table(childp, ctx->level);
857-
858-
return ret;
849+
return 0;
859850
}
860851

861852
static int stage2_map_walk_leaf(const struct kvm_pgtable_visit_ctx *ctx,

0 commit comments

Comments
 (0)