Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1175512rwd; Sun, 14 May 2023 14:30:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ48EqzJ4YPxx4WJlqlH7ALYIzO5luN3MzlZBTHWv+Wl79v2SxIBpNK/Ak+s1bhFZcJCW0Yw X-Received: by 2002:a05:6a00:10d4:b0:63c:1be4:5086 with SMTP id d20-20020a056a0010d400b0063c1be45086mr40210725pfu.6.1684099840355; Sun, 14 May 2023 14:30:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684099840; cv=none; d=google.com; s=arc-20160816; b=YSE4pTyGXGbtPiSrtzC+Zvxz3wpJ7PfekDJzfoR8pQwhWWDP9VG0mUp+XuuVczYs/7 gV1ARJa3a9cDk+M8RBkS/0MnkD0GIq0CLgi/4J6yb9QDq7f0EhfJpkyqC0vX5/w+eTnv eE7Qpku4BD/AO7ctcwMOYFY2MCcVIHOi1efBNnYaGYFw8QIgLxwewKICcHkcSMWbyFGR 9XNTRFckvm4yBRxgifBs8UkDlB21LNAUNiJkuBPWxGQNHJMmDtjerc44xQ1lYOeV2m6y 2CtrbgF0IHZoTWoRaUqQzEVTaCxDQ8miN6yJ91ODzvCqvqmCO0VuaB/On7AiKe7ukJXg AwiQ== 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=ZmBAahwH3yBC6wiSFBmCvOUJZc6pQJuHBQHQjehZN04=; b=QOzjQCLHC6k7/hjxKgJx+Y8QiV3qpC1dc3RRbKqn7FzN2ZDOFyYD2VaYXNUgBlVsPS UO86/eYEPazvQzACITffi+zL88LdQa4Tl9MxI7vW0uPNzABkgdNuEEknMoZmioMuNYAY Mm16c78MQYl5uZISwY13LAhAmDXPpREbGTIhKv2AdVBh8f7Lj4WulCTW4476vOSM67gK 9tVB8+snaBoMqynvUv4Oq8wnqlgJ99/2p9lzZd5O57If0/zf84QZ+zxmi+IlWJ4k8o/m a9awxCImnJSNajjMwwp8cjBxL8nA//P6s9NPpWutRNFnfXN6l3x27IOE2wBAH1d9wsSH /nTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=P9v4mBU3; 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 g66-20020a636b45000000b0052c9e5561ebsi13952601pgc.821.2023.05.14.14.30.26; Sun, 14 May 2023 14:30:40 -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=P9v4mBU3; 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 S237855AbjENV1A (ORCPT + 99 others); Sun, 14 May 2023 17:27:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237652AbjENV0z (ORCPT ); Sun, 14 May 2023 17:26:55 -0400 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E6A7171B; Sun, 14 May 2023 14:26:53 -0700 (PDT) Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-3f4c6c4b51eso49947665e9.2; Sun, 14 May 2023 14:26:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684099612; x=1686691612; 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=ZmBAahwH3yBC6wiSFBmCvOUJZc6pQJuHBQHQjehZN04=; b=P9v4mBU31DGSqiMeXVGSxNgDot0QvCFZEg81a2ZqSRg8aNjpkh1heg2g0YDLwGP1WW pumh6XzLEJs+M0DyO1sdJOxuO5GXSIg7X98SLUQn5Aq+xU++Ezi5PFtH7qk9tEVHDcVU PtifjH/BqYn+H9IvTbDYymR3gOt7fAs8busLuz8pPLS9adFg/Q17UmH2jxfHUYC7/ffW O3fouSy/AkWD38T9QKesFhyoTZHE7Ndr/7ZPCy9pQbJ2TshQhoPGX6sP53+BdEOT6/6a XApfU798flXg+lhZw7l9ve1Ik8oxAjkwIqV0AzasmwGY7WoC2ffal7clqg7KJx8Mk/xe QpCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684099612; x=1686691612; 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=ZmBAahwH3yBC6wiSFBmCvOUJZc6pQJuHBQHQjehZN04=; b=ZpX3U9g0Pcp9PxHq2jvqYya/caFn8GgxvzFFN4GS0+MYrWBbnt0TcnBMkb/4wPhK8P w756pMU6yrz35RqUXq//WhvoQ6fS4aSLWEgwME0kKwsz0vx8ldgqOaK0T0s2ogYXp2PX y9SRnPYYVGJvKxcuttisCtMS2zSR0cxDg7+0em3tdeF0iScR7hBCMQc/zhJKl1KSAHMq M6VDGD2f+MIeLLa7NWrb9ckQk0pDUElGf4nVrRO/lTZyeS57Z4RxGD5rWke+vi1fKHt4 FA8IcK6xNvMC1snrTt1mhbNNOX4sEe0Q4XDVBjIxvPxx8N4d4SDDtvxnHjNkCsjMDRBR s+WQ== X-Gm-Message-State: AC+VfDzXJf/HnBUn0egbY4UlxK79kTTZgGMrZrRXM+EQedEcU5TbQJc4 +DhuyQsZexTU7Zb7HGfcT38= X-Received: by 2002:a05:600c:2207:b0:3f5:6e5:1689 with SMTP id z7-20020a05600c220700b003f506e51689mr1792509wml.17.1684099611749; Sun, 14 May 2023 14:26:51 -0700 (PDT) Received: from lucifer.home ([2a00:23c5:dc8c:8701:1663:9a35:5a7b:1d76]) by smtp.googlemail.com with ESMTPSA id l11-20020a05600c1d0b00b003f1978bbcd6sm25750205wms.3.2023.05.14.14.26.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 May 2023 14:26:50 -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 , Jens Axboe , Pavel Begunkov , John Hubbard , Lorenzo Stoakes , Jason Gunthorpe Subject: [PATCH v5 2/6] mm/gup: remove unused vmas parameter from pin_user_pages_remote() Date: Sun, 14 May 2023 22:26:47 +0100 Message-Id: <61f0d12058825a14feee6a3292e5a257662e719c.1684097002.git.lstoakes@gmail.com> X-Mailer: git-send-email 2.40.1 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 3c47846cc5ef..412ca96be128 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) { @@ -1799,7 +1799,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 3d4dd9420c30..3d2d9a944906 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 2c1a92bf5626..8ea82e9e7719 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -2380,7 +2380,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 b8189396f435..ce78a5186dbb 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -3243,8 +3243,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. @@ -3259,14 +3257,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.1