Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp1782233rwi; Mon, 31 Oct 2022 22:58:53 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7csdLAxjlZvYYPQNZ34m+8nOmdKj0teB8NThqC78Fdh6kd3VWguOifNzYEdeqg/GV0FRFL X-Received: by 2002:a17:902:ce08:b0:179:ed2b:8cd8 with SMTP id k8-20020a170902ce0800b00179ed2b8cd8mr17861142plg.23.1667282333085; Mon, 31 Oct 2022 22:58:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667282333; cv=none; d=google.com; s=arc-20160816; b=MKAgPUHDpGdK7iv3DEAnaYFMmMZNFrFlOYmiQypDeDa9jcJc6PfWyhOs84ZWtKH1zQ YTGSfjPxohRFYcDVFiX55XIoUk6B9qa1joHOEDO/NEgqxnPcSm1CELtmxbuwQ0k/P6p6 ZFVEMpzIvLvwdS0qjM5+BLJdiw8e52Cr31pIBvqQM2zxfVkz/H+DsCrZzqRgRmkHQtwj VIJ43qbf+bC5M0ZJI77yJp7Kxo1ebDUb45wJwR1hkP3Kz6tWYrUtIORB3FlrS85lyNwz x3pgwjrjADEaQcv+4Gq4RqtJQ3vA7U7mKMZCdB7YSsERaNOMGso+eo64SI74Vta1GieI +efw== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ot7-20020a17090b3b4700b001fac102fdeesi12255515pjb.95.2022.10.31.22.58.40; Mon, 31 Oct 2022 22:58:53 -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 + 97 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 ); 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 To: , , , , CC: , , , , Bo Liu 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: X-Mailing-List: linux-kernel@vger.kernel.org vma_lookup() finds the vma of a specific address with a cleaner interface and is more readable. Signed-off-by: Bo Liu --- 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