Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2423704rwd; Fri, 2 Jun 2023 09:11:09 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6nvQQNQry6s2Adz8yCobPFS/6GjW3zLOBpT61ihGELNu0fbeFcqAq93NNzJhx+K73bULEf X-Received: by 2002:a17:902:8207:b0:1a6:ff51:270 with SMTP id x7-20020a170902820700b001a6ff510270mr377221pln.29.1685722269030; Fri, 02 Jun 2023 09:11:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685722269; cv=none; d=google.com; s=arc-20160816; b=b5taILfOWDcnuFpWs1GcGri9erMi6Dnj34qivE3p91wA8S/4/kM30M87h5vigQt7/M PVKga8iIHykThVQVkzyXPBkr1eWLZUBHdWcYxAwF18etm7S3FnJLlfUXPl/cxC/CSD4G 6lZjyI/XBHD9ryAXQVCpppSqn+l0f7qI7ALA4yffZxsWAU6KFXc2Pea5MRkbtxW0g9mS aEV39B4WnPqD9owknASUB7HRrxkIjmMsIchZz2f/5iQSgPJx1XwGmVNyNWeO/VOmyhIy Bpx2AKsfOXQ2xoptucvYuqgFbEFJrh10mYPptUh8yPFgqN6baOtijErz+61QMV+IJ+0D Xp6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=NyrihgmYesBmBKLp4ITVdJ3LGNh6LVDPlJHbJ3BWmKo=; b=KE7Z5/4xmC0D0DoDcs+TabN6wq2A2UxTwd8V5ApIUsLFxzPnQubuu6btAb4NmS9j+o IUCprQlherbz2E1g44iTDyki4QFVKtjPzII5iRn4Fs0YJmKUopZwBUPXMIfiC8AppD72 +G8vzBAYNxuuvY7qMjePgSXHthGD78Xzc1JIQuusxiCXtDvdvNw1WPpcSrvYPnUc/UxS FwV6fAZn1oU+d1tPMTBYHJ6Eg4C1S37C3KM3tNDZsq1SyrRenPVtJovg6KR8inCHfHC/ Q3lXhqGZZyVsDkCoN+KEjwunj7IUuxHY1l9AfiHKtYuFmmbbn2p531hQ0sCEQzUVy4ye sC7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=6JvB68lu; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e9-20020a170902b78900b001b07145bc30si1062676pls.312.2023.06.02.09.10.56; Fri, 02 Jun 2023 09:11:09 -0700 (PDT) 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=@google.com header.s=20221208 header.b=6JvB68lu; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236232AbjFBQKE (ORCPT + 99 others); Fri, 2 Jun 2023 12:10:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236809AbjFBQJw (ORCPT ); Fri, 2 Jun 2023 12:09:52 -0400 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0313A10DD for ; Fri, 2 Jun 2023 09:09:39 -0700 (PDT) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-56561689700so33440807b3.2 for ; Fri, 02 Jun 2023 09:09:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1685722178; x=1688314178; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=NyrihgmYesBmBKLp4ITVdJ3LGNh6LVDPlJHbJ3BWmKo=; b=6JvB68luEiFeoyKEfjP/g+vMwC/sRddTQaYllS5g+5bpQDmhXIgwwZiHHiYhNY6/hh +N3LQSiNtnyna/XZaiM18ivCXXQ4yuX/15A1AGZwy0Qa/f1hIAf3oKXB2h5AuHkYQgCs xj8Y82H0f8TZvkTqQ0Hx5MWBndbNiI7NCzZ3czEuYGWHs7LAUCirzskxbkVOl+noMZFx tm27fSCTKAwfbeEstcfEbI/nW6D9qAihf0lb2MdszgnmyhfNayDhGNG1boLJ+W+UNY9A PKxN0bCcFoMuNsJAFUnK+mzP9snrdOrZPjuzoVjhjXEuIkdNPWm6zU7rdhcbdNuxMxHK DaOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685722178; x=1688314178; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=NyrihgmYesBmBKLp4ITVdJ3LGNh6LVDPlJHbJ3BWmKo=; b=akK4lEPsGC7Ig52GvSeML4mb3snB34OqTrtzdhI0kplLc1wwXg82o+2IookjYV+qqK 6SDhGlZFWBHGqCCjZvReDe8K+1p2cSCaTfScJI2OO0uoW49+zo4Sax2Lk4XOjYQKApt/ RmyWhb6VetHZFYNH0dc4mc/m2GaPJnmN6maRCnyYq6mwdLDsTPMiusJmTfYTdyuUVu8Z 125pnHOi1jxt+9911vMiewkfYUVePoeIjXCJ04fpaH7KBQe0bwk/8FT2T3OVy/iyVzG6 mqP6hYBvamcn1teY73kaSBaD7ROIg/Eeq0r8WTlZ/Eag1Ym3ZRHFKDYlXMxZzdUGXJ+2 qVdA== X-Gm-Message-State: AC+VfDyKgCM0mh9QpgJDURPZ0HgxfhaBhFZ5B+j1ea37gsiSinP0zfh0 BlvA5qCwufB/Y2TzSdBQr+Q9qfC1gIck X-Received: from vipin.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:479f]) (user=vipinsh job=sendgmr) by 2002:a81:b620:0:b0:561:b8d1:743b with SMTP id u32-20020a81b620000000b00561b8d1743bmr170869ywh.10.1685722178126; Fri, 02 Jun 2023 09:09:38 -0700 (PDT) Date: Fri, 2 Jun 2023 09:09:07 -0700 In-Reply-To: <20230602160914.4011728-1-vipinsh@google.com> Mime-Version: 1.0 References: <20230602160914.4011728-1-vipinsh@google.com> X-Mailer: git-send-email 2.41.0.rc0.172.g3f132b7071-goog Message-ID: <20230602160914.4011728-10-vipinsh@google.com> Subject: [PATCH v2 09/16] KVM: arm64: Document the page table walker actions based on the callback's return value From: Vipin Sharma To: maz@kernel.org, oliver.upton@linux.dev, james.morse@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, catalin.marinas@arm.com, will@kernel.org, chenhuacai@kernel.org, aleksandar.qemu.devel@gmail.com, tsbogend@alpha.franken.de, anup@brainfault.org, atishp@atishpatra.org, paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, seanjc@google.com, pbonzini@redhat.com, dmatlack@google.com, ricarkol@google.com Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-mips@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kselftest@vger.kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Vipin Sharma Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL autolearn=unavailable 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 Document what the page table walker do when walker callback function returns a value. Current documentation is not correct as negative error of -EAGAIN on a non-shared page table walker doesn't terminate the walker and continues to the next step. There might be a better place to keep this information, for now this documentation will work as a reference guide until a better way is found. Signed-off-by: Vipin Sharma --- arch/arm64/include/asm/kvm_pgtable.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/arch/arm64/include/asm/kvm_pgtable.h b/arch/arm64/include/asm/kvm_pgtable.h index 8ef7e8f3f054..957bc20dab00 100644 --- a/arch/arm64/include/asm/kvm_pgtable.h +++ b/arch/arm64/include/asm/kvm_pgtable.h @@ -711,8 +711,19 @@ int kvm_pgtable_stage2_split(struct kvm_pgtable *pgt, u64 addr, u64 size, * after invoking the walker callback, allowing the walker to descend into * a newly installed table. * - * Returning a negative error code from the walker callback function will - * terminate the walk immediately with the same error code. + * Depending on the return value from the walker callback function, the page + * table walk will continue or exit the walk. This is also dependent on the + * type of the walker, i.e. shared walker (vCPU fault handlers) or non-shared + * walker. + * + * Walker Type | Callback | Walker action + * -------------|------------------|-------------- + * Non-Shared | 0 | Continue + * Non-Shared | -EAGAIN | Continue + * Non-Shared | Any other | Exit + * -------------|------------------|-------------- + * Shared | 0 | Continue + * Shared | Any other | Exit * * Return: 0 on success, negative error code on failure. */ -- 2.41.0.rc0.172.g3f132b7071-goog