Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2436472rwd; Fri, 2 Jun 2023 09:20:50 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5o72iRDnoRWebvCx5hthm2yJW+L12voDv9ntcp4byKURdCTDR6DUD9M+YNuOjEw9SVdiZW X-Received: by 2002:a05:6a20:8425:b0:112:2843:b546 with SMTP id c37-20020a056a20842500b001122843b546mr15424080pzd.58.1685722849651; Fri, 02 Jun 2023 09:20:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685722849; cv=none; d=google.com; s=arc-20160816; b=GWLDIUbzbfFA1anm6RlhtOCtQTczkno2q/+2FPu3kftwKAH8RnK3U2+09CK4gKMBur dUIZ0l2Wjc4GwrmpU+3DJy0cy9g9CrJ8G82Sf0HFovrVFd3WXXH2SrpfRhDzOUbUf45h VXM8ZqueSLqnZbFPvGblHIolwgegCmM2FA5vuPzG0eXOkIfjWLV8xliIh3x4xVg0EKXB o1s4ZwwlQxZpZvBmp5G85CLeFXbcZ2NxObKpx1ZyDuEE6XpkEVQ9xMNLiAwGcW5YISDS I+kMxzXqwHJhk9v9YjfLF9lXoYyrCzUUDBw9e4P2n/6T77CItVVwP6i2vkJHrRef/t19 eqrw== 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=rivHDhk0ioxMpP1XynwGaSZFsNZDBBbqgVAGbR7E/X8=; b=cWeUvcbWFGNz16UzNwlBLHypYYvFMXGXEL0CQnuFvwgHvgx9RXgOZibp9Dg18oYcLL nXDrnXZ4TBZNWsISa6FoLlXXZOlWIwoDQRmBNRk4kj319AvpBysNDZDi5uhJenLJzAM6 AMtrFR++JTLNoqDm9TJ3CboSUWbiw5QqC61ciYTPS29Ghw1qUwVVuKtomWaybYi3IR2q tgfUcCGUqnPs3boaYpj4Cx9xqeow6owwBzHnrpwbnSm/g292AwJ5tneF2jsJEkC/Tawm 5PQR6vaUGePkNpXrEDOR1Z8BOucLg90KSowR3aJC2aCfYF0z/cujX4d/gaAy1UkOU8A5 Wv8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=IxpZG4Tk; 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 205-20020a6217d6000000b0064d74234b07si973174pfx.188.2023.06.02.09.20.35; Fri, 02 Jun 2023 09:20:49 -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=IxpZG4Tk; 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 S235936AbjFBQK6 (ORCPT + 99 others); Fri, 2 Jun 2023 12:10:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236571AbjFBQKd (ORCPT ); Fri, 2 Jun 2023 12:10:33 -0400 Received: from mail-pl1-x64a.google.com (mail-pl1-x64a.google.com [IPv6:2607:f8b0:4864:20::64a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7056FE6B for ; Fri, 2 Jun 2023 09:09:58 -0700 (PDT) Received: by mail-pl1-x64a.google.com with SMTP id d9443c01a7336-1b02cd4b829so15186575ad.1 for ; Fri, 02 Jun 2023 09:09:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1685722181; x=1688314181; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=rivHDhk0ioxMpP1XynwGaSZFsNZDBBbqgVAGbR7E/X8=; b=IxpZG4TkYuPd8UtpcDQplKJDDIpAs6lGKWZe95duADLUk5Xly6SRvjrVvCEGB/Fk1a E9X3IJECzkdQ25Bkjejj4IbXek6JqPY58HRA50EOI/YFTzUpFaA/bzGSlAOm+5PEvo+T 6jKSmBS0KSmdPni70wpBlwTPrvyYGZvMtxSC3Fbri9jwwzePk7OY91lpj01vmu9g7PZn a5J+YN0h1Qu/z/w7ubpNpCMDwcQqYWttGGXgoLeySgwUxIZDyVDmv/3Bk/4OJqAcfD0+ gHcpPqAo0vTPvSXpzWrIqDWuTjrALALhGQwaLZCyItTHvmVctEjS/JfpfTvctKcX+1gM QFLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685722181; x=1688314181; 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=rivHDhk0ioxMpP1XynwGaSZFsNZDBBbqgVAGbR7E/X8=; b=j3kPOFsJnFHnC677bOueH6TgXSYQkbtFQLxoDTdA44H/el0zBqPduDvyRHujkXrik3 A36Ns7aqPc+SgnUm8NkNmdqQYPKbwPcdqMlbzNynM8YkoZjW9s7Tme4C980gcg4Ev9aa ZHkG2s5ZOm7qaWl8Po3h4INzm+ComXQMRd68HESa/ZnaeMhUh4Ym2EJMV1n0OFwjvVrK wimT8+y2Qv0VRXWK3KHVE070e1iL8wH9CZetaaUPE4/OOuK1eiw2qyvmZ6ar5G9AF2Xt rmsObzHtAT7MclHILgD+319Q7rTLWYhYRNo2mzVz+wyotMmKv/2+JD0Ym80zTD9b9Wgq Ig4g== X-Gm-Message-State: AC+VfDzHFs/kwL4Jy3BhsYI4O5+kXrNPZ+DSVrLktrRRoP09LZW5rI0p zwiPHm0X5ptgP4TgvN7pquRcZhxfaUf6 X-Received: from vipin.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:479f]) (user=vipinsh job=sendgmr) by 2002:a17:902:e3c5:b0:1b1:c90e:b7aa with SMTP id r5-20020a170902e3c500b001b1c90eb7aamr56727ple.4.1685722181662; Fri, 02 Jun 2023 09:09:41 -0700 (PDT) Date: Fri, 2 Jun 2023 09:09:09 -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-12-vipinsh@google.com> Subject: [PATCH v2 11/16] KVM: arm64: Use KVM_PGTABLE_WALK_SHARED flag instead of KVM_PGTABLE_WALK_HANDLE_FAULT 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 Check against shared page table walker flag instead of fault handler flag when determining if walk should continue or not. vCPU page fault handlers uses shared page walker and there are no other shared page walkers in Arm. This will change in future commit when clear-dirty-log will use shared page walker and continue, retry or terminate logic for a walk will change between shared page walkers. Signed-off-by: Vipin Sharma --- arch/arm64/kvm/hyp/pgtable.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/kvm/hyp/pgtable.c b/arch/arm64/kvm/hyp/pgtable.c index bc8c5c4ac1cf..7f80e953b502 100644 --- a/arch/arm64/kvm/hyp/pgtable.c +++ b/arch/arm64/kvm/hyp/pgtable.c @@ -191,7 +191,7 @@ static bool kvm_pgtable_walk_continue(const struct kvm_pgtable_walker *walker, * Callbacks can also return ENOENT when PTE which is visited is not * valid. * - * In the context of a fault handler interpret these as a signal + * In the context of a shared walker interpret these as a signal * to retry guest execution. * * Ignore these return codes altogether for walkers outside a fault @@ -199,7 +199,7 @@ static bool kvm_pgtable_walk_continue(const struct kvm_pgtable_walker *walker, * with the page table walk. */ if (r == -EAGAIN || r == -ENOENT) - return !(walker->flags & KVM_PGTABLE_WALK_HANDLE_FAULT); + return !(walker->flags & KVM_PGTABLE_WALK_SHARED); return !r; } -- 2.41.0.rc0.172.g3f132b7071-goog