Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp985555rdb; Sun, 1 Oct 2023 14:26:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEOzEQk+WZjvmodrYw6lCTcYoqGNgIsWm6O4sjEow3oKEqSQ8niudb/aSLsymw81LX+6tOB X-Received: by 2002:a05:6a00:1488:b0:693:3733:4b09 with SMTP id v8-20020a056a00148800b0069337334b09mr13197788pfu.13.1696195567537; Sun, 01 Oct 2023 14:26:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696195567; cv=none; d=google.com; s=arc-20160816; b=P8Vg2z/NmgLtKyfkggGfSPioD2FQDMvltGmhp7MhsycABCHcUfFp1h7Aem9uTaB9RK Sjr8w4Wux8I6ID06+lTzmS9gm0IB6Ow6HmxqVCW5hAJn8qha08VjpVKYz+N6TCGNOZDq nnV26lV2FYPlKDnEUFTDLVDalvJ22SfVoHlgF1TabpHXpf8KEyz6lfvFJWulASZ1Mr6m CGoBGd1wKjq5qWbS+fBMckegbgASfJr1/w3wC0A3AbwEJx+wzi/1lfd1C+JK4N2KYhco Gk/UA4cnLs3abMSgc7xwybVTDvr2LvPFLyNTI6tLg7S1w2u37DL9AjOlhRNGqSKyqn7R 5W0A== 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=pfhqMS4SBWNsRFumL7f2VoNpk2TCo8ZgiAHTNGqiqHs=; fh=mNvOpR73OaUnRrr53gRvslddDUjaIrpQi7RNpkp0Veo=; b=pXTmy6agokigxDnkLzcPNi0exVWDKzVwdBBfoUqgUeNsH832pRrdOaUW97v2qmkHzQ Eml+ykFGdEI4jUCQKeXKcC92/OfNd5yXoUmjtx9XLz+mHSTq39rIx1rIrhfveOn545qr 8J4jCzEyEbMT4rr1Jj8VtlJY9w2YuUIYtv72JOddf2wn31Cp4Gc0iaRLLSXASp7nhNAZ U5xTYBKFK5qjhp/F3zjNjkmU66yap+bPyxut59pV8NA0wgFeAKOGAQQNNAB75lhDVYXH 6JsZdqnw1K7H5NRjT4y4XrHh75mnI3MBL3DxMDB7JmagPEYr/EvWPjZ3rvvqsYFQ5tfM Nc5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=OL9jdxRb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id b19-20020a656693000000b005775e2f160fsi24131940pgw.667.2023.10.01.14.26.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Oct 2023 14:26:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=OL9jdxRb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 585B680CF557; Sun, 1 Oct 2023 09:00:20 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235093AbjJAQAR (ORCPT + 99 others); Sun, 1 Oct 2023 12:00:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235186AbjJAQAO (ORCPT ); Sun, 1 Oct 2023 12:00:14 -0400 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 471B5E3 for ; Sun, 1 Oct 2023 09:00:12 -0700 (PDT) Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-406618d0992so18458715e9.0 for ; Sun, 01 Oct 2023 09:00:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696176011; x=1696780811; darn=vger.kernel.org; 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=pfhqMS4SBWNsRFumL7f2VoNpk2TCo8ZgiAHTNGqiqHs=; b=OL9jdxRbNe4765piky1C++UOFN5BOfkLGtMtaUCnY05qx7TND1M+mmB3wInOdtdTxm dIYYB9JZI3uQpKMnzC7NrMJJtRIGF768eq9z5bT1QKwgZHokRcCfNIYmFQsZvrGRmVif aR+qF0sn0LknzKCaOiFfqAR0r8v/ybbj4YfTSA3/3J+i4B6eYSi+ekEUFooEyOOfG2m1 vLwUSZ3w92QTxt/8U3rpqVfO2e6h0JF6+bq4UqGwbv1J3u62Ew4gRNP42RiG2s9goLB/ 2HJrRilNNXjTHCvJ5+A2D3rDBFXdJzIre2NQ4YRomx9/2JJAml301z2HdYMceG6l1/W0 Vo3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696176011; x=1696780811; 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=pfhqMS4SBWNsRFumL7f2VoNpk2TCo8ZgiAHTNGqiqHs=; b=Qp4/cpL3+UmQtrnb4MREl2w32RGLVuP4RiOZuPIh7Ht9KPoqrstjSfaCRKujcsXx6k a/rArB7wSi4EUamQ37QsAHGRprNlOTXUuAX9NkKpmpPfwV48jMjN+Tkyxs14WA49y3mO OAlhCy2m1gHBbmGfIVOjI5fKm3YZQ7610T/it+AIFrpf1qSisyHeGJwAuZ5LL1ZDdNGf 2dMjYE73yyJrSSP8Hggl2NE3IAJO3PryGLVrW+K4YqF1GcU7zgQXqR0Xgw2SGe6xG3Hi J7kWfgFglhcbZRAnKcEWgWSuW5CJkvkmmS3G+g27oLffmzBOawKR1vXftyH+1ayl2tPv HPXg== X-Gm-Message-State: AOJu0YwqR7Sau8PcJmL1rSafyCWD/a7mQ4HIGSWgkawKh/NDw/VYFReh GkRfT9DeX557J1BowmUj5mg= X-Received: by 2002:a7b:cd15:0:b0:401:c52c:5ed9 with SMTP id f21-20020a7bcd15000000b00401c52c5ed9mr8350531wmj.32.1696176010384; Sun, 01 Oct 2023 09:00:10 -0700 (PDT) Received: from lucifer.home ([2a00:23c5:dc8c:8701:1663:9a35:5a7b:1d76]) by smtp.googlemail.com with ESMTPSA id s16-20020a05600c045000b0040536dcec17sm5487695wmb.27.2023.10.01.09.00.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Oct 2023 09:00:09 -0700 (PDT) From: Lorenzo Stoakes To: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton , Catalin Marinas , Will Deacon , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland Cc: Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter , Oleg Nesterov , Richard Cochran , Jason Gunthorpe , John Hubbard , Arnd Bergmann , Lorenzo Stoakes Subject: [PATCH 1/4] mm: make __access_remote_vm() static Date: Sun, 1 Oct 2023 17:00:02 +0100 Message-ID: <70436dcf596565770e604a4fc4e8f27a14c85166.1696174961.git.lstoakes@gmail.com> X-Mailer: git-send-email 2.42.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 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sun, 01 Oct 2023 09:00:20 -0700 (PDT) access_remote_vm() passes through parameters to __access_remote_vm() directly, so remove the __access_remote_vm() function from mm.h aand use access_remote_vm() in the one caller that needs it (ptrace_access_vm()). This allows future adjustments to the GUP-internal __access_remote_vm() function while keeping the access_remote_vm() function stable. Signed-off-by: Lorenzo Stoakes --- include/linux/mm.h | 2 -- kernel/ptrace.c | 2 +- mm/memory.c | 4 ++-- mm/nommu.c | 4 ++-- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 52c40b3d0813..7b89f7bd420d 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -2415,8 +2415,6 @@ extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, unsigned int gup_flags); extern int access_remote_vm(struct mm_struct *mm, unsigned long addr, void *buf, int len, unsigned int gup_flags); -extern int __access_remote_vm(struct mm_struct *mm, unsigned long addr, - void *buf, int len, unsigned int gup_flags); long get_user_pages_remote(struct mm_struct *mm, unsigned long start, unsigned long nr_pages, diff --git a/kernel/ptrace.c b/kernel/ptrace.c index 443057bee87c..d8b5e13a2229 100644 --- a/kernel/ptrace.c +++ b/kernel/ptrace.c @@ -59,7 +59,7 @@ int ptrace_access_vm(struct task_struct *tsk, unsigned long addr, return 0; } - ret = __access_remote_vm(mm, addr, buf, len, gup_flags); + ret = access_remote_vm(mm, addr, buf, len, gup_flags); mmput(mm); return ret; diff --git a/mm/memory.c b/mm/memory.c index d4820802b01b..e2743aa95b56 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -5881,8 +5881,8 @@ EXPORT_SYMBOL_GPL(generic_access_phys); /* * Access another process' address space as given in mm. */ -int __access_remote_vm(struct mm_struct *mm, unsigned long addr, void *buf, - int len, unsigned int gup_flags) +static int __access_remote_vm(struct mm_struct *mm, unsigned long addr, + void *buf, int len, unsigned int gup_flags) { void *old_buf = buf; int write = gup_flags & FOLL_WRITE; diff --git a/mm/nommu.c b/mm/nommu.c index 7f9e9e5a0e12..f9553579389b 100644 --- a/mm/nommu.c +++ b/mm/nommu.c @@ -1651,8 +1651,8 @@ vm_fault_t filemap_map_pages(struct vm_fault *vmf, } EXPORT_SYMBOL(filemap_map_pages); -int __access_remote_vm(struct mm_struct *mm, unsigned long addr, void *buf, - int len, unsigned int gup_flags) +static int __access_remote_vm(struct mm_struct *mm, unsigned long addr, + void *buf, int len, unsigned int gup_flags) { struct vm_area_struct *vma; int write = gup_flags & FOLL_WRITE; -- 2.42.0