Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp13343578rwb; Sun, 27 Nov 2022 04:21:04 -0800 (PST) X-Google-Smtp-Source: AA0mqf4a7ysEEd/q8DzwSVkSUrEVSYH2K1RswVZOSb03fcETzWNmqL7QaT0Lex9sHBMlQKavJHm/ X-Received: by 2002:a05:6402:158f:b0:469:acc:1c1b with SMTP id c15-20020a056402158f00b004690acc1c1bmr39626094edv.228.1669551664036; Sun, 27 Nov 2022 04:21:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669551664; cv=none; d=google.com; s=arc-20160816; b=cV2wC6uGMlIeXMrSE4UeC6ALor/PIWBzSS9V4u0x9Hd58KuxW8dHhK3QNflbqHwmfZ nvFEmVA6aTlEfDiUHOb5QA9QyITu3U1MKlHIG81KcEX0kA25jDHeiIZk8fKlRIZaFv2w vBM3+6Jx+lSQaSeulwCkhRVGTpmxaFfVyLyCO8edcnLC/KPNva2WGGMuBfijsXHbr2ut GjWa/GJr7DSmpI5yY6jdpvCqKFkBSCwxf3/4n9ZYSlB1kFK+jZBqw/LSpvq+cmd1iYoi 6uAVumPZZhLGQKzz8RiUAqkxm4yiUiDBjWXmxgWBj0GXHnUQ27l9hsqzIxQe+O1Eb4I/ T+UA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=De+5l1xEgoXB7FNa4tg4HfrVAuuxUoNVJkryeDf0EOs=; b=n6q8U9ZxnlFrkTijjBC35QGGuGvA5Xla/79wTw/pF5TyPQuoSyLshVK6EpF2h6IftU gbl/h+roguSaynWEC3krtEdVxnkPntiVfkbkrgyVpaeZcwDqfVwS37sO5fORanyMHp5b 08iL3qvUue4xlKECIlShYVkPUiikhHYJG36vkGr2TCQTAJpLT97NqGzUoIVlitFSqWoq eQJAYUAB0H0EZ+kmpVDQblJy8bhv8Nv7fyv4uxeNUMLeg0D3xATE4UUQCY82VWZ6vfxU ri7s2ML/H7kOwS5lHe3V379meVT6ZRNR+HVn9YWwiLjcBMqOONW/f3QEW2RxsZFWp7/4 jm9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20210112.gappssmtp.com header.s=20210112 header.b=0R4ABPMd; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id wb2-20020a170907d50200b007269ef1872esi6588308ejc.897.2022.11.27.04.20.43; Sun, 27 Nov 2022 04:21:04 -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=@brainfault-org.20210112.gappssmtp.com header.s=20210112 header.b=0R4ABPMd; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229677AbiK0MEd (ORCPT + 85 others); Sun, 27 Nov 2022 07:04:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229530AbiK0MEa (ORCPT ); Sun, 27 Nov 2022 07:04:30 -0500 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65451F009 for ; Sun, 27 Nov 2022 04:04:29 -0800 (PST) Received: by mail-ed1-x534.google.com with SMTP id z20so11988059edc.13 for ; Sun, 27 Nov 2022 04:04:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brainfault-org.20210112.gappssmtp.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=De+5l1xEgoXB7FNa4tg4HfrVAuuxUoNVJkryeDf0EOs=; b=0R4ABPMda0JKrV6c2Z7FSfz2HeRwIqis3ahHt3e2bNFs04gENMcHGKm538cKYbwU2q CvScJMbfoGvowwcwjjY8XPQAXJdKgaJIcniIYt2R0ZUP1qJi6FyQdeGiEKnmxUCWm3N1 kPIUKWCeWRChnYFhm2D1ePsWkyZFCWZp2Ff1hiIwTF5iHVoyANvJqgo1QpbV83OenrXv Zz/vC48dUCuFfadbkFlX/2ypf8ZV6u7o3HPfqmyBWh4NU9EKldYRFjcwL7E+qzdGp1uM DAYdVwEvZVf2yB4bRUivUCM3thYOV40EiZsb8HZkaQu2lxBZ6YnELg/GW4LqZRMhhoeo 6zxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=De+5l1xEgoXB7FNa4tg4HfrVAuuxUoNVJkryeDf0EOs=; b=bKt6YsPl03Ij/W3j0ETMD2q0sOuHUYXT9/I+j/zza4IEUuGIiexH45ijU7Gmbt+fKs uSA51f2NkegvpJ7FNNqh7xvWHzC/M/2VV1wIqmQFY1ImSFCxbndwxLNT0UCDwaM9ed/M DrkCUYB1iG2mvEIJnqJV4FeQCG1Hcis4ZrTCSf1syrdCZ11CdNB3TB2ktRHIpfIUirhZ KjWPIQG9mCqBbl9nFBSqcFRpsMtH6AaIjKtOPbNRbZ0WA4zGH0vGT1V51bBjXn9puN/h hoPGQ1mqMevlywh2bsKqD37JbA//0dZVbgFWx0fjqvHOqE9IBnLkof4mux6HBEQKdwrc 7l6w== X-Gm-Message-State: ANoB5pmz1zuqUps6RnxD+zEVFafuKnspIHoC+ge31k1x99EAPrOyWmqa EnDzHkXiXtebLBqKU2xRt1mASKjYs9VmbJAdqdSMcQ== X-Received: by 2002:aa7:c859:0:b0:461:17e9:4ea3 with SMTP id g25-20020aa7c859000000b0046117e94ea3mr43421493edt.49.1669550667865; Sun, 27 Nov 2022 04:04:27 -0800 (PST) MIME-Version: 1.0 References: <20221101053811.5884-1-liubo03@inspur.com> In-Reply-To: <20221101053811.5884-1-liubo03@inspur.com> From: Anup Patel Date: Sun, 27 Nov 2022 17:34:15 +0530 Message-ID: Subject: Re: [PATCH] RISC-V: KVM: use vma_lookup() instead of find_vma_intersection() To: Bo Liu Cc: atishp@atishpatra.org, paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE 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 On Tue, Nov 1, 2022 at 11:08 AM Bo Liu wrote: > > vma_lookup() finds the vma of a specific address with a cleaner interface > and is more readable. > > Signed-off-by: Bo Liu Looks good to me. Queued this patch for Linux-6.2 Thanks, Anup > --- > arch/riscv/kvm/mmu.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/riscv/kvm/mmu.c b/arch/riscv/kvm/mmu.c > index 3620ecac2fa1..5942d10c9736 100644 > --- a/arch/riscv/kvm/mmu.c > +++ b/arch/riscv/kvm/mmu.c > @@ -632,7 +632,7 @@ int kvm_riscv_gstage_map(struct kvm_vcpu *vcpu, > > mmap_read_lock(current->mm); > > - vma = find_vma_intersection(current->mm, hva, hva + 1); > + vma = vma_lookup(current->mm, hva); > if (unlikely(!vma)) { > kvm_err("Failed to find VMA for hva 0x%lx\n", hva); > mmap_read_unlock(current->mm); > -- > 2.27.0 >