Message ID | 20221101053811.5884-1-liubo03@inspur.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2755000wru; Mon, 31 Oct 2022 22:47:09 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5ZcHcmDXnp1VwVrqwmVJL2IspGPpBt2JXYfcUWLUd9kWIKOTkTo4a0ypP5kqZ7JuO7HIgB X-Received: by 2002:a05:6402:3408:b0:43c:2dd3:d86b with SMTP id k8-20020a056402340800b0043c2dd3d86bmr17548954edc.108.1667281628882; Mon, 31 Oct 2022 22:47:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667281628; cv=none; d=google.com; s=arc-20160816; b=FbASzYYVGBuYImdZRsi+NtcENIZgVdu3zr+yHtWYi7Ccg8B3N+zeh/AGbCcCEj6kEx bjTsCWqy0MtgQ6BJSzHpxITBJTEZFiiRStPgfg7CNoEga87p5AG+TlbH6C/MhAXixSkp YaWPCdJJgN9z+fGdrbe9caJ/27BhlqDRvy6yXx1x0OGevR9ysLeJbqO3ozvbU04gMtik Md8N8fEuXk0yIhMEzGg07bWwxSxxo+N3g9+SwbKGjGbR7sAQOconSbLuted0Kt4z8Bn/ HW3DrJoepLB4Z8bw0ZGbdZY1GcOQ0rGrIaaZki3a2On/25jxG58I0zuXtUfcB+NcyKbK notA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:abuse-reports-to:tuid:mime-version:message-id :date:subject:cc:to:from; bh=HNSAwhLN2LaEL5s2MzMcVJaAXBFrCdi2/o5yFjmyNhY=; b=P2xaU6NLfCTJLLsxlp/s8nxGX5POhSrKPoCr1YPghgzlaqCnNwHoqRUIadguQIunmw NnBeX+lhc7cktLe50SJ/wHkuHoGdBxBSJhuYlM2yT0mQplHJ31Q/TWstpckkkqiZ6b7H DH1YgfpuVobtLV1rJTvQvlIJF/6lLLfVvPUzkKj9PJZ2+8TMsCvB161enqrXhPiTFjf6 bfTsQr578KAl0GDQyn1yIM1zVcc39COiAb9tfIgOId2rAxrw9pXks5YZGJtO64xIzKKf NFg2IholprW4EpKPeI1FmRhX0iEMPWcHu1+V0+zJ5GBj+0jKkBhdjmkv8+6ULQhKhER7 f0Vw== ARC-Authentication-Results: i=1; mx.google.com; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y12-20020a056402440c00b004573107a5basi13209373eda.352.2022.10.31.22.46.44; Mon, 31 Oct 2022 22:47:08 -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; 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 S229875AbiKAFir (ORCPT <rfc822;kartikey406@gmail.com> + 99 others); Tue, 1 Nov 2022 01:38:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229471AbiKAFiq (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 1 Nov 2022 01:38:46 -0400 Received: from unicom146.biz-email.net (unicom146.biz-email.net [210.51.26.146]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1BB882BEC; Mon, 31 Oct 2022 22:38:43 -0700 (PDT) Received: from ([60.208.111.195]) by unicom146.biz-email.net ((D)) with ASMTP (SSL) id VGN00136; Tue, 01 Nov 2022 13:38:36 +0800 Received: from localhost.localdomain (10.200.104.97) by jtjnmail201603.home.langchao.com (10.100.2.3) with Microsoft SMTP Server id 15.1.2507.12; Tue, 1 Nov 2022 13:38:37 +0800 From: Bo Liu <liubo03@inspur.com> To: <anup@brainfault.org>, <atishp@atishpatra.org>, <paul.walmsley@sifive.com>, <palmer@dabbelt.com>, <aou@eecs.berkeley.edu> CC: <kvm@vger.kernel.org>, <kvm-riscv@lists.infradead.org>, <linux-riscv@lists.infradead.org>, <linux-kernel@vger.kernel.org>, Bo Liu <liubo03@inspur.com> Subject: [PATCH] RISC-V: KVM: use vma_lookup() instead of find_vma_intersection() Date: Tue, 1 Nov 2022 01:38:11 -0400 Message-ID: <20221101053811.5884-1-liubo03@inspur.com> X-Mailer: git-send-email 2.18.2 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.200.104.97] tUid: 202211011338366c5089ed1402f402bc867b8fd6cef50f X-Abuse-Reports-To: service@corp-email.com Abuse-Reports-To: service@corp-email.com X-Complaints-To: service@corp-email.com X-Report-Abuse-To: service@corp-email.com X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748271501593625587?= X-GMAIL-MSGID: =?utf-8?q?1748271501593625587?= |
Series |
RISC-V: KVM: use vma_lookup() instead of find_vma_intersection()
|
|
Commit Message
Bo Liu
Nov. 1, 2022, 5:38 a.m. UTC
vma_lookup() finds the vma of a specific address with a cleaner interface
and is more readable.
Signed-off-by: Bo Liu <liubo03@inspur.com>
---
arch/riscv/kvm/mmu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Tue, Nov 01, 2022 at 01:38:11AM -0400, 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 <liubo03@inspur.com> > --- > 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 > > Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
On Tue, Nov 1, 2022 at 11:08 AM Bo Liu <liubo03@inspur.com> wrote: > > vma_lookup() finds the vma of a specific address with a cleaner interface > and is more readable. > > Signed-off-by: Bo Liu <liubo03@inspur.com> 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 >
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);