Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp5595474rwe; Tue, 18 Apr 2023 08:50:05 -0700 (PDT) X-Google-Smtp-Source: AKy350bPnhwh+21iHkph9LLAO+8ebXvxdhrN5uluIX9lmZv7ee4LAhWiSluFWuyyUEIl8yMTT4mr X-Received: by 2002:a05:6a00:a8d:b0:63b:7a55:ae89 with SMTP id b13-20020a056a000a8d00b0063b7a55ae89mr188786pfl.27.1681833005029; Tue, 18 Apr 2023 08:50:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681833005; cv=none; d=google.com; s=arc-20160816; b=q03e9W06v1rpllKIZLLn4vBwC/3xmxEYuMjrK13RVB2EAGDZVkaoQYsJjRfKMl+Yd/ GWx5TXL9+5AgvzWU0MOJIrbDaGGhzMtoCPinp8nIwMlnO3VUB2yCVybatGqqRxs6vgbt CQqwn7Q0q1AWFVoMPs+J60ic2d6q7zYb+9STyLmZ0HM5qvTSg+PLyI21NMnOgXpVZHw1 rpJ9KdBz15x//2PwnAEqkvTEFBPY+Ldl+Yxbf2uZmgKdZ9RAUXlODs1QbsRtddvlUzO7 K9Ue7Es2PVKTx9yxKaDn+AIdOe7nwzqs1DfWWEOWb7gRV1GVyqxI5hXIU4vQv6sWV2nR Q09A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=NPDSA+x4oz9imX3uiByE603i/j50qlmE+SnCawov5Gk=; b=rXgvyLy/RV1GrojqSUwUts4ARENn3XohrRD/VMevM4t5jDaeiChdI4eTWBjvBzgCtO Zs6x3PGBv3xo59fh87BTjrMnNrjFrxgDFtv9pc4E7CScE9AU8at8LA2qvxRit25XDuFX gf5qsgmOZjrQJK7f25ecWInA9avpwXEk6UetekLktj0VyJYQnlFFQmHk/r3jLKa3Cupu r+jApxfOW//mGfVpBH+zVkhx8+2IaM9AUS0AdWSm/5q3f186mZ/p8ao4tM+pV613Ugqz GV0yetnTmFyRancIeSFF+v83jHvkHr0Qbwugln5NVlylsEhILGdcAOP4b7be61euZeeL Lusg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=J+hC8F71; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f9-20020aa79689000000b0063b7b02424fsi8820127pfk.250.2023.04.18.08.49.50; Tue, 18 Apr 2023 08:50:05 -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=@gmail.com header.s=20221208 header.b=J+hC8F71; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232358AbjDRPtR (ORCPT + 99 others); Tue, 18 Apr 2023 11:49:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231589AbjDRPtM (ORCPT ); Tue, 18 Apr 2023 11:49:12 -0400 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02C69AD3D; Tue, 18 Apr 2023 08:49:10 -0700 (PDT) Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-3f1763ee8f8so10348095e9.1; Tue, 18 Apr 2023 08:49:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681832948; x=1684424948; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=NPDSA+x4oz9imX3uiByE603i/j50qlmE+SnCawov5Gk=; b=J+hC8F71kco8Juht/1xZ6HvwdaZ1yKC/66ZDQkDWwb6JRvwGxhNRTSXnHHz42bMO25 DmuRwo9hXxa4Kcc+fn0Bc7/oB557sS2XTIiHyGcE56cNznhhujRB3aVvEU0i/VqEHHSN 4QQBvP+edSPhv2Q/URS3BYuFpezdoIpB65jUr4OluO2ZqtdoK/GzsDzTDVHPTG+yfsLM UnejDVErRWK6ELXtmYEklX4B8FWPaFJvA4bkW48mkxb9pTwpbAO7dtiwxsqhXil0ddt+ fMBxrFS7p6BsoAX4kPiFEgZHEnWVhrX5x3Cprq2UOwpQyBDI2OPIJz4zPj/LDfgyljp9 CSLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681832948; x=1684424948; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NPDSA+x4oz9imX3uiByE603i/j50qlmE+SnCawov5Gk=; b=NZCeP1BV2hm343Wblo9snTxnNOeijwbFUdmrFYZlLTr+qQhlqEy9We9Z97kx+v5vJX k4vETLkneVix0WsSfwLBj/iGe9fDS7jabdDRtFaeFe0AB6t0zqnGCx6sBwISY4dD4c9N ceKfww9Sf5GPLW+qBf6K7P1jv4JA/XaYcEB1p+HWPNWXDpjLdt7qxNe0XFh+q1WOmO85 8hOwXPYM/PSNRvOgWMaFUCyFYPijb3pkym45vpfrj9bz7YHASlbpRTEhLpy3+rx6Rcil wmOJoChEc+/FJk7KW/ip8Ld2l2cYz81CJK3mjwag7StUxQc32Sf4n1nbMYV9uzIFj58W UmCg== X-Gm-Message-State: AAQBX9d2jPzEtL5El8QHcv5JXQglGFNpckN8jEupWs0Symx+A/8rfn23 YyVJMVxqrsY7O/7S8Wo31PQ= X-Received: by 2002:adf:dbce:0:b0:2f9:5841:a4d4 with SMTP id e14-20020adfdbce000000b002f95841a4d4mr2063234wrj.27.1681832948536; Tue, 18 Apr 2023 08:49:08 -0700 (PDT) Received: from lucifer.home (host86-156-84-164.range86-156.btcentralplus.com. [86.156.84.164]) by smtp.googlemail.com with ESMTPSA id p11-20020a5d458b000000b002efb31d3c24sm13352583wrq.32.2023.04.18.08.49.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Apr 2023 08:49:07 -0700 (PDT) From: Lorenzo Stoakes To: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton , iommu@lists.linux.dev Cc: Matthew Wilcox , David Hildenbrand , kvm@vger.kernel.org, Jason Gunthorpe , Kevin Tian , Joerg Roedel , Will Deacon , Robin Murphy , Alex Williamson , Lorenzo Stoakes , Jason Gunthorpe Subject: [PATCH v4 2/6] mm/gup: remove unused vmas parameter from pin_user_pages_remote() Date: Tue, 18 Apr 2023 16:49:05 +0100 Message-Id: X-Mailer: git-send-email 2.40.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 No invocation of pin_user_pages_remote() uses the vmas parameter, so remove it. This forms part of a larger patch set eliminating the use of the vmas parameters altogether. Acked-by: David Hildenbrand Reviewed-by: Jason Gunthorpe Signed-off-by: Lorenzo Stoakes --- drivers/iommu/iommufd/pages.c | 4 ++-- drivers/vfio/vfio_iommu_type1.c | 2 +- include/linux/mm.h | 2 +- mm/gup.c | 8 +++----- mm/process_vm_access.c | 2 +- 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/drivers/iommu/iommufd/pages.c b/drivers/iommu/iommufd/pages.c index f8d92c9bb65b..9d55a2188a64 100644 --- a/drivers/iommu/iommufd/pages.c +++ b/drivers/iommu/iommufd/pages.c @@ -786,7 +786,7 @@ static int pfn_reader_user_pin(struct pfn_reader_user *user, user->locked = 1; } rc = pin_user_pages_remote(pages->source_mm, uptr, npages, - user->gup_flags, user->upages, NULL, + user->gup_flags, user->upages, &user->locked); } if (rc <= 0) { @@ -1787,7 +1787,7 @@ static int iopt_pages_rw_page(struct iopt_pages *pages, unsigned long index, rc = pin_user_pages_remote( pages->source_mm, (uintptr_t)(pages->uptr + index * PAGE_SIZE), 1, (flags & IOMMUFD_ACCESS_RW_WRITE) ? FOLL_WRITE : 0, &page, - NULL, NULL); + NULL); mmap_read_unlock(pages->source_mm); if (rc != 1) { if (WARN_ON(rc >= 0)) diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c index 493c31de0edb..e6dc8fec3ed5 100644 --- a/drivers/vfio/vfio_iommu_type1.c +++ b/drivers/vfio/vfio_iommu_type1.c @@ -562,7 +562,7 @@ static int vaddr_get_pfns(struct mm_struct *mm, unsigned long vaddr, mmap_read_lock(mm); ret = pin_user_pages_remote(mm, vaddr, npages, flags | FOLL_LONGTERM, - pages, NULL, NULL); + pages, NULL); if (ret > 0) { int i; diff --git a/include/linux/mm.h b/include/linux/mm.h index b14cc4972d0b..ec9875c59f6d 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -2378,7 +2378,7 @@ long get_user_pages_remote(struct mm_struct *mm, long pin_user_pages_remote(struct mm_struct *mm, unsigned long start, unsigned long nr_pages, unsigned int gup_flags, struct page **pages, - struct vm_area_struct **vmas, int *locked); + int *locked); long get_user_pages(unsigned long start, unsigned long nr_pages, unsigned int gup_flags, struct page **pages); long pin_user_pages(unsigned long start, unsigned long nr_pages, diff --git a/mm/gup.c b/mm/gup.c index 7e454d6b157e..931c805bc32b 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -3093,8 +3093,6 @@ EXPORT_SYMBOL_GPL(pin_user_pages_fast); * @gup_flags: flags modifying lookup behaviour * @pages: array that receives pointers to the pages pinned. * Should be at least nr_pages long. - * @vmas: array of pointers to vmas corresponding to each page. - * Or NULL if the caller does not require them. * @locked: pointer to lock flag indicating whether lock is held and * subsequently whether VM_FAULT_RETRY functionality can be * utilised. Lock must initially be held. @@ -3109,14 +3107,14 @@ EXPORT_SYMBOL_GPL(pin_user_pages_fast); long pin_user_pages_remote(struct mm_struct *mm, unsigned long start, unsigned long nr_pages, unsigned int gup_flags, struct page **pages, - struct vm_area_struct **vmas, int *locked) + int *locked) { int local_locked = 1; - if (!is_valid_gup_args(pages, vmas, locked, &gup_flags, + if (!is_valid_gup_args(pages, NULL, locked, &gup_flags, FOLL_PIN | FOLL_TOUCH | FOLL_REMOTE)) return 0; - return __gup_longterm_locked(mm, start, nr_pages, pages, vmas, + return __gup_longterm_locked(mm, start, nr_pages, pages, NULL, locked ? locked : &local_locked, gup_flags); } diff --git a/mm/process_vm_access.c b/mm/process_vm_access.c index 78dfaf9e8990..0523edab03a6 100644 --- a/mm/process_vm_access.c +++ b/mm/process_vm_access.c @@ -104,7 +104,7 @@ static int process_vm_rw_single_vec(unsigned long addr, mmap_read_lock(mm); pinned_pages = pin_user_pages_remote(mm, pa, pinned_pages, flags, process_pages, - NULL, &locked); + &locked); if (locked) mmap_read_unlock(mm); if (pinned_pages <= 0) -- 2.40.0