From patchwork Mon Apr 12 08:00:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Zijlstra X-Patchwork-Id: 12197105 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EC6D7C43461 for ; Mon, 12 Apr 2021 08:09:20 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 75A9A61249 for ; Mon, 12 Apr 2021 08:09:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 75A9A61249 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 01FEB6B006E; Mon, 12 Apr 2021 04:09:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D92F76B0071; Mon, 12 Apr 2021 04:09:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C313D6B0070; Mon, 12 Apr 2021 04:09:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0142.hostedemail.com [216.40.44.142]) by kanga.kvack.org (Postfix) with ESMTP id A72756B006C for ; Mon, 12 Apr 2021 04:09:01 -0400 (EDT) Received: from smtpin35.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 6C670180ACF0D for ; Mon, 12 Apr 2021 08:09:01 +0000 (UTC) X-FDA: 78022989282.35.0C48B6F Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) by imf06.hostedemail.com (Postfix) with ESMTP id 330B2C0007D8 for ; Mon, 12 Apr 2021 08:09:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:MIME-Version:References: Subject:Cc:To:From:Date:Message-ID:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:In-Reply-To; bh=hnyJIpIgRwAiJphlWTzrQr9Y8jq97hs5NNvLYyocx0A=; b=WuNlZCexSZVXcdYaTJVvOhXT9y qzdukRmwjcgFaeguHENlqyTcuk2bJ3MUCGWFlCxuf0f52RWB1pCzoojZuCCdb5XjLonouEScQE4Un LAhRDouBPENjjQU5eFcl5UHIAUWJdWmn2jm4OK1sxw8FBoRR65DyvL+vms4hOa8fu2g7oyraEPPTq +7uU/o3K5eLwaaI1bVdOEOOOk7PPzPOkEz6CnrW1234yv56YAMOrYAVDLgQBxOr/xOhjd1AbArjjo UtD1OTVBuGaEQavMSq1vySIpcQS0I1ULwGRMWLotd3SB0wXe/ZjCGlka96oQi1OAt88cYboBfA2Y3 t3Yb19hA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1lVrcm-0063yS-8C; Mon, 12 Apr 2021 08:08:49 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id E5B1C3002C4; Mon, 12 Apr 2021 10:08:45 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 0) id 5075325F21534; Mon, 12 Apr 2021 10:08:44 +0200 (CEST) Message-ID: <20210412080611.969415860@infradead.org> User-Agent: quilt/0.66 Date: Mon, 12 Apr 2021 10:00:19 +0200 From: Peter Zijlstra To: akpm@linux-foundation.org Cc: linux-kernel@vger.kernel.org, peterz@infradead.org, boris.ostrovsky@oracle.com, jgross@suse.com, sstabellini@kernel.org, x86@kernel.org, jani.nikula@linux.intel.com, joonas.lahtinen@linux.intel.com, rodrigo.vivi@intel.com, chris@chris-wilson.co.uk, intel-gfx@lists.freedesktop.org, linux-mm@kvack.org, keescook@chromium.org, hch@lst.de Subject: [PATCH 7/7] mm: Unexport apply_to_page_range() References: <20210412080012.357146277@infradead.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 330B2C0007D8 X-Stat-Signature: pujs5gxnx9kphc4boijd9qe4ja3bmsyw X-Rspamd-Server: rspam02 Received-SPF: none (infradead.org>: No applicable sender policy available) receiver=imf06; identity=mailfrom; envelope-from=""; helo=desiato.infradead.org; client-ip=90.155.92.199 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1618214942-396708 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Now that all module users of apply_to_page_range() have been removed, unexport this function. This is an unsafe function in that it gives direct access to the page-tables. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Christoph Hellwig --- mm/memory.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/mm/memory.c +++ b/mm/memory.c @@ -2544,13 +2544,14 @@ static int __apply_to_page_range(struct /* * Scan a region of virtual memory, filling in page tables as necessary * and calling a provided function on each leaf page table. + * + * DO NOT EXPORT; this hands out our page-tables on a platter. */ int apply_to_page_range(struct mm_struct *mm, unsigned long addr, unsigned long size, pte_fn_t fn, void *data) { return __apply_to_page_range(mm, addr, size, fn, data, true); } -EXPORT_SYMBOL_GPL(apply_to_page_range); /* * Scan a region of virtual memory, calling a provided function on @@ -2558,6 +2559,8 @@ EXPORT_SYMBOL_GPL(apply_to_page_range); * * Unlike apply_to_page_range, this does _not_ fill in page tables * where they are absent. + * + * DO NOT EXPORT; this hands out our page-tables on a platter. */ int apply_to_existing_page_range(struct mm_struct *mm, unsigned long addr, unsigned long size, pte_fn_t fn, void *data)