From patchwork Mon Feb 26 12:03:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Roberts X-Patchwork-Id: 13572036 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E3C6DC54E4A for ; Mon, 26 Feb 2024 12:03:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2253894002C; Mon, 26 Feb 2024 07:03:36 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1D466440147; Mon, 26 Feb 2024 07:03:36 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 09BC694002F; Mon, 26 Feb 2024 07:03:36 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id EE33394002C for ; Mon, 26 Feb 2024 07:03:35 -0500 (EST) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 47F5BC08A4 for ; Mon, 26 Feb 2024 12:03:35 +0000 (UTC) X-FDA: 81833820390.22.C4B905D Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf29.hostedemail.com (Postfix) with ESMTP id AE83F12001A for ; Mon, 26 Feb 2024 12:03:33 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf29.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1708949013; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ybjrp8rX3TGU6X+DN+R2cZPMTNdzgOnRSM6yDztGhH0=; b=k8A8R4kZdePeqrnFD+HENuFSlXwoJSN53zg8f+6TSKOPJBOU4GPwUhbyWyegtmZ4pt+kYb 279yw5CVIwxuSIKcgldmjIzp4ZRFmPt05DyqhC+4aiSsWxTp740oaZ03GUH7Co0lPeOWdH 5pSM0OHlO3fcw0k5g8XIeQkmfhgiUkI= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf29.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1708949013; a=rsa-sha256; cv=none; b=g3N5FPgj8Zv4syAAc9rurCEJy7UfTRZgXsOoXvrkEnOvy0At41iAXVQ+evf+kD1cjq/+Iu t94BvJffWRSCPfRrOqJOIVHzRdb6Z3HIoslzoVl7QtegOHmPSVpxUUt/UdYKBGMLEAq55S 33+MiBrHItW8bk7rcAbsCz0w5j+nx0c= Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 72F411424; Mon, 26 Feb 2024 04:04:11 -0800 (PST) Received: from e125769.cambridge.arm.com (e125769.cambridge.arm.com [10.1.196.27]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C79383F73F; Mon, 26 Feb 2024 04:03:31 -0800 (PST) From: Ryan Roberts To: Andrew Morton , Catalin Marinas , Mark Rutland , John Hubbard Cc: Ryan Roberts , linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org Subject: [PATCH 1/2] arm64/mm: Export contpte symbols only to GPL users Date: Mon, 26 Feb 2024 12:03:20 +0000 Message-Id: <20240226120321.1055731-2-ryan.roberts@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240226120321.1055731-1-ryan.roberts@arm.com> References: <20240226120321.1055731-1-ryan.roberts@arm.com> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: AE83F12001A X-Stat-Signature: hy3yn6xqhzazs7ytad1ghsxzbr5f5a5n X-HE-Tag: 1708949013-777171 X-HE-Meta: U2FsdGVkX1/1p0EYIveIMZXRax6lx/mO29tmRBbZ8w9BcOjgns1FPLiip3gP39Uzm+PA05U6zomdNouuAoV6SLxbOfGBqbIN+c+BPMK/E+AiUSmlyEfFmPy8gsGKi17Sc6E2OUg24eLZkmJLehpgJouurmsKdU4oGkCp4PGC/p2hNAn/qNMutf7rxea7lLHNcijLqz+aBCpkploidRj2FuLSjj3Z0BRQjjINJp3NVmrD8Jy9+woOn00HufGsiUSYbmL5D+NOV9Ner+AiE22HUVdu1YVGW8ZxkWdYY1K9AW4hg70n4tJYv0GEVDCZbZ0KIb2/P06e46lH+/1FCvDAjB33cnfcJOfanRQZjHZcPHpwJNOVUlJKGsXGJLfx668FagKymKzHc/ZSEJ8+FzZfXQUQpz0PkP7LFAeGTN2jN9G9oE9UqJHmnBlImfxtGObLeAQ9YncXx5H+bGFovmci7ep5RgrB+8Hx6Ddr0OR2g0gGIywtnejpnBbEbKqjuvkraAgesKDZguiFTrU6oK+L68Idd7xtpO0SpXL/jtwVthccMsR2OdPxon1dmkeFRZjxRbob0YkaFGAo7+YAX6ujApkf5fyn/MNydBPSk4SPeLZ6RA3qIsgXIFdvk1A6JXmm6woSQmVY7gzHzUkO5hfmex8TuwwPS/sCgqIadMo8oo0fAebf+8/p0dPy0AyMKQ33terBz39EKiSuwO1aw3U1ovdJcgjQsA9QCSDvzvoTKr33XDKiLgk2FsGVhbNQfHkTLvqCfnzFrsfUxyqQ4TYR3DxjtBu9s3f5u1n+3uKcd3rAgOd+HvwSKUxY1U/SRSy/99k0ruy7lsHqj+qAXzBtrVGZzp5MhhLa 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: List-Subscribe: List-Unsubscribe: The contpte symbols must be exported since some of the public inline ptep_* APIs are called from modules and these inlines now call the contpte functions. Originally they were exported as EXPORT_SYMBOL() for fear of breaking out-of-tree modules. But we subsequently concluded that EXPORT_SYMBOL_GPL() should be safe since these functions are deeply core mm routines, and any module operating at this level is not going to be able to survive on EXPORT_SYMBOL alone. Link: https://lore.kernel.org/linux-mm/f9fc2b31-11cb-4969-8961-9c89fea41b74@nvidia.com/ Signed-off-by: Ryan Roberts Acked-by: David Hildenbrand Reviewed-by: John Hubbard Acked-by: Catalin Marinas --- arch/arm64/mm/contpte.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/arch/arm64/mm/contpte.c b/arch/arm64/mm/contpte.c index 16788f07716d..be0a226c4ff9 100644 --- a/arch/arm64/mm/contpte.c +++ b/arch/arm64/mm/contpte.c @@ -135,7 +135,7 @@ void __contpte_try_fold(struct mm_struct *mm, unsigned long addr, pte = pte_mkcont(pte); contpte_convert(mm, addr, orig_ptep, pte); } -EXPORT_SYMBOL(__contpte_try_fold); +EXPORT_SYMBOL_GPL(__contpte_try_fold); void __contpte_try_unfold(struct mm_struct *mm, unsigned long addr, pte_t *ptep, pte_t pte) @@ -150,7 +150,7 @@ void __contpte_try_unfold(struct mm_struct *mm, unsigned long addr, pte = pte_mknoncont(pte); contpte_convert(mm, addr, ptep, pte); } -EXPORT_SYMBOL(__contpte_try_unfold); +EXPORT_SYMBOL_GPL(__contpte_try_unfold); pte_t contpte_ptep_get(pte_t *ptep, pte_t orig_pte) { @@ -178,7 +178,7 @@ pte_t contpte_ptep_get(pte_t *ptep, pte_t orig_pte) return orig_pte; } -EXPORT_SYMBOL(contpte_ptep_get); +EXPORT_SYMBOL_GPL(contpte_ptep_get); pte_t contpte_ptep_get_lockless(pte_t *orig_ptep) { @@ -231,7 +231,7 @@ pte_t contpte_ptep_get_lockless(pte_t *orig_ptep) return orig_pte; } -EXPORT_SYMBOL(contpte_ptep_get_lockless); +EXPORT_SYMBOL_GPL(contpte_ptep_get_lockless); void contpte_set_ptes(struct mm_struct *mm, unsigned long addr, pte_t *ptep, pte_t pte, unsigned int nr) @@ -274,7 +274,7 @@ void contpte_set_ptes(struct mm_struct *mm, unsigned long addr, } while (addr != end); } -EXPORT_SYMBOL(contpte_set_ptes); +EXPORT_SYMBOL_GPL(contpte_set_ptes); void contpte_clear_full_ptes(struct mm_struct *mm, unsigned long addr, pte_t *ptep, unsigned int nr, int full) @@ -282,7 +282,7 @@ void contpte_clear_full_ptes(struct mm_struct *mm, unsigned long addr, contpte_try_unfold_partial(mm, addr, ptep, nr); __clear_full_ptes(mm, addr, ptep, nr, full); } -EXPORT_SYMBOL(contpte_clear_full_ptes); +EXPORT_SYMBOL_GPL(contpte_clear_full_ptes); pte_t contpte_get_and_clear_full_ptes(struct mm_struct *mm, unsigned long addr, pte_t *ptep, @@ -291,7 +291,7 @@ pte_t contpte_get_and_clear_full_ptes(struct mm_struct *mm, contpte_try_unfold_partial(mm, addr, ptep, nr); return __get_and_clear_full_ptes(mm, addr, ptep, nr, full); } -EXPORT_SYMBOL(contpte_get_and_clear_full_ptes); +EXPORT_SYMBOL_GPL(contpte_get_and_clear_full_ptes); int contpte_ptep_test_and_clear_young(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep) @@ -316,7 +316,7 @@ int contpte_ptep_test_and_clear_young(struct vm_area_struct *vma, return young; } -EXPORT_SYMBOL(contpte_ptep_test_and_clear_young); +EXPORT_SYMBOL_GPL(contpte_ptep_test_and_clear_young); int contpte_ptep_clear_flush_young(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep) @@ -337,7 +337,7 @@ int contpte_ptep_clear_flush_young(struct vm_area_struct *vma, return young; } -EXPORT_SYMBOL(contpte_ptep_clear_flush_young); +EXPORT_SYMBOL_GPL(contpte_ptep_clear_flush_young); void contpte_wrprotect_ptes(struct mm_struct *mm, unsigned long addr, pte_t *ptep, unsigned int nr) @@ -355,7 +355,7 @@ void contpte_wrprotect_ptes(struct mm_struct *mm, unsigned long addr, contpte_try_unfold_partial(mm, addr, ptep, nr); __wrprotect_ptes(mm, addr, ptep, nr); } -EXPORT_SYMBOL(contpte_wrprotect_ptes); +EXPORT_SYMBOL_GPL(contpte_wrprotect_ptes); int contpte_ptep_set_access_flags(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep, @@ -401,4 +401,4 @@ int contpte_ptep_set_access_flags(struct vm_area_struct *vma, return 1; } -EXPORT_SYMBOL(contpte_ptep_set_access_flags); +EXPORT_SYMBOL_GPL(contpte_ptep_set_access_flags);