[PATCH v2 3/6] KVM: arm64: Return EAGAIN for invalid PTE in attr walker

From: Oliver Upton
Date: Fri Dec 02 2022 - 13:52:30 EST


Return EAGAIN for invalid PTEs in the attr walker, signaling to the
caller that any serialization and/or invalidation can be elided.

Signed-off-by: Oliver Upton <oliver.upton@xxxxxxxxx>
---
arch/arm64/kvm/hyp/pgtable.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/kvm/hyp/pgtable.c b/arch/arm64/kvm/hyp/pgtable.c
index 98818214a479..204e59e05674 100644
--- a/arch/arm64/kvm/hyp/pgtable.c
+++ b/arch/arm64/kvm/hyp/pgtable.c
@@ -1048,7 +1048,7 @@ static int stage2_attr_walker(const struct kvm_pgtable_visit_ctx *ctx,
struct kvm_pgtable_mm_ops *mm_ops = ctx->mm_ops;

if (!kvm_pte_valid(ctx->old))
- return 0;
+ return -EAGAIN;

data->level = ctx->level;
data->pte = pte;
--
2.39.0.rc0.267.gcb52ba06e7-goog