Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2533427rwb; Fri, 2 Dec 2022 11:04:22 -0800 (PST) X-Google-Smtp-Source: AA0mqf7tufZuHCCbQvaqSDPmpdSvQP4lt9L2SYUO6jBHScELdfR5lXBXyeSJqx0D6EZDqq0kTtX3 X-Received: by 2002:a05:6402:5021:b0:460:5340:d522 with SMTP id p33-20020a056402502100b004605340d522mr53428047eda.87.1670007862111; Fri, 02 Dec 2022 11:04:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670007862; cv=none; d=google.com; s=arc-20160816; b=b2GswKfPkQtAQYGO5Tai3nT7UVBaLpuHEKLeWfVGrWAI9/tZenut8RCADysifgfJgU MCNaFu2g5qCcleDUByzLIlxWH5N1KFBENp/WyfUWjgiHWMqCcfOrMa/2dFnXU5FtJHBE mSDjj30rUvWAL7FIcwTpBc9uxGk3hj6DWBAqKXFXclhTqMgDO8l4HKW7lbZk5udyiSnN XzwpBUdXwzuvYkB5L3cGJxXOg0hV4KmZSpV/VS8+auRhB6toUr+M22yQcjH23H/vvE7c Ijt46GGBZNM7Ul+MiUwSVI39F/Sx8Us9Nzzgh8sKHKjHqb9T6Kt6Z5mRGAougVrOPml5 L4oQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=p0G2k7kswoLiP2SpEr1E5NK57Rotg3EVnFBgR0I4F3I=; b=E4zTk21RD/PKpE01+Jn25osjnEVFc5/NNoRUCZAqil7eSqPzRCeU1tw2MTPQv2sRmt xHsihG93Osi5jv7ibIWPkkbT1EsI2tbn28dvMcg202SNUDj/DhdmtiifN/1lFNN+8hBz zEp1WC2fltE49Kv4r+MKQZormSD3Gt3/Er1PS4HP2k9++v3xtS1FUSzz7uxErq+CFcll WvogoXIoRfbmmsaqxXUfMixHolyCPm34y6cTRWiNozqqGmDnLJ0vnJl12rNBjZGLEBaX 3VjHEwXwNOjKxTV1b2oV/T9/HtzF33a4bBE6ecr26PexTi1drFG6gO2vlPGev0jBYSWM OLSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="eCd/6YTI"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u18-20020aa7d992000000b0046ab57f617bsi5766487eds.633.2022.12.02.11.04.02; Fri, 02 Dec 2022 11:04:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="eCd/6YTI"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234680AbiLBSw2 (ORCPT + 82 others); Fri, 2 Dec 2022 13:52:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234424AbiLBSwW (ORCPT ); Fri, 2 Dec 2022 13:52:22 -0500 Received: from out-32.mta0.migadu.com (out-32.mta0.migadu.com [91.218.175.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58148E2FD6 for ; Fri, 2 Dec 2022 10:52:22 -0800 (PST) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1670007140; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=p0G2k7kswoLiP2SpEr1E5NK57Rotg3EVnFBgR0I4F3I=; b=eCd/6YTIdgNLrnwSwiWJGcww3hgEmBKfKAvGafrp8UOmQ8M7RWmBMHLU7/9MoNFNay6G8S yVt6FFkHbzpvEXwXFLXVaUFyS2MFoJgmVsptp5ChP1IWoXkjs0rfzAUfwQcr+ReyjY+0v2 sdb951ZVTYiLT9uRYhjOv9fbV9xgyvo= From: Oliver Upton To: Marc Zyngier , James Morse , Alexandru Elisei , Suzuki K Poulose , Oliver Upton , Catalin Marinas , Will Deacon Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, kvmarm@lists.linux.dev, Ricardo Koller , linux-kernel@vger.kernel.org Subject: [PATCH v2 3/6] KVM: arm64: Return EAGAIN for invalid PTE in attr walker Date: Fri, 2 Dec 2022 18:51:53 +0000 Message-Id: <20221202185156.696189-4-oliver.upton@linux.dev> In-Reply-To: <20221202185156.696189-1-oliver.upton@linux.dev> References: <20221202185156.696189-1-oliver.upton@linux.dev> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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