From nobody Fri Apr 3 07:55:41 2026 Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8D2BE1EB5F8 for ; Thu, 19 Feb 2026 06:35:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.254.224.33 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771482920; cv=none; b=b1hm6JwMcqPP+myoxR+p9fxwrTVuTLwzYGyyEmdtQFOYeK7E5zz2hGIQP25cRaa/o4mB8ebXBq8Z+Fwxv8vpsoXEd/Ma4vclZM3Ha4MB9uRv8/2m2DvAvvgTUeff0lF9Fq/9lUxMLTXETrRc8KvHxdQFwxzv8E3eQclOqanP9pA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771482920; c=relaxed/simple; bh=YHqM/XJTQ/iR1XNcgiQY92RRbqcQVXqNL7RqbZGjwvQ=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Content-Type: References; b=JTs5MORuKFW9Tbj5k43m5lNS5ltbaX24fb1S8ONOWsGSiGqboCpqWd/+AfTkwIzkTxLf5Cri8FpA+Cl8n05KxqGN/sB8GeuLv1FhsVCVcqAdAmDAC8v6N+XxkkCNOJUgf9HTeKsF91wZlKQ7cjkFYdLSak4hlZBImDsYUc9Eohg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=qWXPew85; arc=none smtp.client-ip=203.254.224.33 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="qWXPew85" Received: from epcas1p1.samsung.com (unknown [182.195.41.45]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20260219063515epoutp0344bbb3c1e320519d3cb0450cfdafad2c~VklNjALTt2816928169epoutp03H for ; Thu, 19 Feb 2026 06:35:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20260219063515epoutp0344bbb3c1e320519d3cb0450cfdafad2c~VklNjALTt2816928169epoutp03H DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1771482915; bh=aloF7MkDLud0BSRnjOsxj2IOpjpppNDUaB9hMm+IoPs=; h=From:To:Cc:Subject:Date:References:From; b=qWXPew85r6IG5W3gx73mRYzHEDp0D+8g86aZEz2fBRX6ccurudJZ9C5ZRjXr4IkJ5 YcVHyb7QyUjFXxk38WM4NxDzenGsJSfFP1TUOWiXbnbDK/5jUZO+4pvME1MBc3zOtx 1jyEhPfI1puzw8V9nSXMy8pFYQmNQG5IBUinqtCU= Received: from epsnrtp03.localdomain (unknown [182.195.42.155]) by epcas1p1.samsung.com (KnoxPortal) with ESMTPS id 20260219063514epcas1p19a13513456955c828a2a6ebc020ae3e8~VklNByP640223502235epcas1p11; Thu, 19 Feb 2026 06:35:14 +0000 (GMT) Received: from epcas1p3.samsung.com (unknown [182.195.38.190]) by epsnrtp03.localdomain (Postfix) with ESMTP id 4fGkC62Vv0z3hhTN; Thu, 19 Feb 2026 06:35:14 +0000 (GMT) Received: from epsmtip2.samsung.com (unknown [182.195.34.31]) by epcas1p1.samsung.com (KnoxPortal) with ESMTPA id 20260219063513epcas1p15c63c2cdc21afdc58de9e5dd5e741833~VklMFQLR90223502235epcas1p1u; Thu, 19 Feb 2026 06:35:13 +0000 (GMT) Received: from U22PB1-0412.tn.corp.samsungelectronics.net (unknown [10.91.134.171]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20260219063513epsmtip2e76aff6f7aa8ad043e142729f46cb468~VklMAPEV01618616186epsmtip2K; Thu, 19 Feb 2026 06:35:13 +0000 (GMT) From: Seongsu Park To: catalin.marinas@arm.com, will@kernel.org, maddy@linux.ibm.com, mpe@ellerman.id.au, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, akpm@linux-foundation.org, Liam.Howlett@oracle.com, lorenzo.stoakes@oracle.com Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org, Seongsu Park Subject: [PATCH] mm/pkeys: Remove unused tsk parameter from arch_set_user_pkey_access() Date: Thu, 19 Feb 2026 15:35:06 +0900 Message-Id: <20260219063506.545148-1-sgsu.park@samsung.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CMS-MailID: 20260219063513epcas1p15c63c2cdc21afdc58de9e5dd5e741833 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" CMS-TYPE: 101P cpgsPolicy: CPGSC10-711,Y X-CFilter-Loop: Reflected X-CMS-RootMailID: 20260219063513epcas1p15c63c2cdc21afdc58de9e5dd5e741833 References: The tsk parameter in arch_set_user_pkey_access() is never used in the function implementations across all architectures (arm64, powerpc, x86). Signed-off-by: Seongsu Park --- arch/arm64/include/asm/pkeys.h | 3 +-- arch/arm64/mm/mmu.c | 2 +- arch/powerpc/include/asm/pkeys.h | 8 +++----- arch/powerpc/mm/book3s64/pkeys.c | 3 +-- arch/x86/include/asm/pkeys.h | 3 +-- arch/x86/kernel/fpu/xstate.c | 3 +-- arch/x86/mm/pkeys.c | 3 +-- mm/mprotect.c | 2 +- 8 files changed, 10 insertions(+), 17 deletions(-) diff --git a/arch/arm64/include/asm/pkeys.h b/arch/arm64/include/asm/pkeys.h index 0ca5f83ce148..cd286d3a9c94 100644 --- a/arch/arm64/include/asm/pkeys.h +++ b/arch/arm64/include/asm/pkeys.h @@ -12,8 +12,7 @@ =20 #define arch_max_pkey() 8 =20 -int arch_set_user_pkey_access(struct task_struct *tsk, int pkey, - unsigned long init_val); +int arch_set_user_pkey_access(int pkey, unsigned long init_val); =20 static inline bool arch_pkeys_enabled(void) { diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index 9ae7ce00a7ef..3fc8566708ea 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c @@ -2207,7 +2207,7 @@ void __cpu_replace_ttbr1(pgd_t *pgdp, bool cnp) } =20 #ifdef CONFIG_ARCH_HAS_PKEYS -int arch_set_user_pkey_access(struct task_struct *tsk, int pkey, unsigned = long init_val) +int arch_set_user_pkey_access(int pkey, unsigned long init_val) { u64 new_por; u64 old_por; diff --git a/arch/powerpc/include/asm/pkeys.h b/arch/powerpc/include/asm/pk= eys.h index 28e752138996..bd20d4106471 100644 --- a/arch/powerpc/include/asm/pkeys.h +++ b/arch/powerpc/include/asm/pkeys.h @@ -143,10 +143,8 @@ static inline int arch_override_mprotect_pkey(struct v= m_area_struct *vma, return __arch_override_mprotect_pkey(vma, prot, pkey); } =20 -extern int __arch_set_user_pkey_access(struct task_struct *tsk, int pkey, - unsigned long init_val); -static inline int arch_set_user_pkey_access(struct task_struct *tsk, int p= key, - unsigned long init_val) +extern int __arch_set_user_pkey_access(int pkey, unsigned long init_val); +static inline int arch_set_user_pkey_access(int pkey, unsigned long init_v= al) { if (!mmu_has_feature(MMU_FTR_PKEY)) return -EINVAL; @@ -160,7 +158,7 @@ static inline int arch_set_user_pkey_access(struct task= _struct *tsk, int pkey, if (pkey =3D=3D 0) return init_val ? -EINVAL : 0; =20 - return __arch_set_user_pkey_access(tsk, pkey, init_val); + return __arch_set_user_pkey_access(pkey, init_val); } =20 static inline bool arch_pkeys_enabled(void) diff --git a/arch/powerpc/mm/book3s64/pkeys.c b/arch/powerpc/mm/book3s64/pk= eys.c index a974baf8f327..2002331b05ba 100644 --- a/arch/powerpc/mm/book3s64/pkeys.c +++ b/arch/powerpc/mm/book3s64/pkeys.c @@ -335,8 +335,7 @@ static inline void init_iamr(int pkey, u8 init_bits) * Set the access rights in AMR IAMR and UAMOR registers for @pkey to that * specified in @init_val. */ -int __arch_set_user_pkey_access(struct task_struct *tsk, int pkey, - unsigned long init_val) +int __arch_set_user_pkey_access(int pkey, unsigned long init_val) { u64 new_amr_bits =3D 0x0ul; u64 new_iamr_bits =3D 0x0ul; diff --git a/arch/x86/include/asm/pkeys.h b/arch/x86/include/asm/pkeys.h index 2e6c04d8a45b..06ed2cd2592e 100644 --- a/arch/x86/include/asm/pkeys.h +++ b/arch/x86/include/asm/pkeys.h @@ -9,8 +9,7 @@ */ #define arch_max_pkey() (cpu_feature_enabled(X86_FEATURE_OSPKE) ? 16 : 1) =20 -extern int arch_set_user_pkey_access(struct task_struct *tsk, int pkey, - unsigned long init_val); +extern int arch_set_user_pkey_access(int pkey, unsigned long init_val); =20 static inline bool arch_pkeys_enabled(void) { diff --git a/arch/x86/kernel/fpu/xstate.c b/arch/x86/kernel/fpu/xstate.c index 48113c5193aa..0caf91a7e062 100644 --- a/arch/x86/kernel/fpu/xstate.c +++ b/arch/x86/kernel/fpu/xstate.c @@ -1080,8 +1080,7 @@ void __user *get_xsave_addr_user(struct xregs_state _= _user *xsave, int xfeature_ * This will go out and modify PKRU register to set the access * rights for @pkey to @init_val. */ -int arch_set_user_pkey_access(struct task_struct *tsk, int pkey, - unsigned long init_val) +int arch_set_user_pkey_access(int pkey, unsigned long init_val) { u32 old_pkru, new_pkru_bits =3D 0; int pkey_shift; diff --git a/arch/x86/mm/pkeys.c b/arch/x86/mm/pkeys.c index 7418c367e328..1dfcfaf77e23 100644 --- a/arch/x86/mm/pkeys.c +++ b/arch/x86/mm/pkeys.c @@ -42,8 +42,7 @@ int __execute_only_pkey(struct mm_struct *mm) * Set up PKRU so that it denies access for everything * other than execution. */ - ret =3D arch_set_user_pkey_access(current, execute_only_pkey, - PKEY_DISABLE_ACCESS); + ret =3D arch_set_user_pkey_access(execute_only_pkey, PKEY_DISABLE_ACCESS); /* * If the PKRU-set operation failed somehow, just return * 0 and effectively disable execute-only support. diff --git a/mm/mprotect.c b/mm/mprotect.c index 283889e4f1ce..fea7d56f55e3 100644 --- a/mm/mprotect.c +++ b/mm/mprotect.c @@ -978,7 +978,7 @@ SYSCALL_DEFINE2(pkey_alloc, unsigned long, flags, unsig= ned long, init_val) if (pkey =3D=3D -1) goto out; =20 - ret =3D arch_set_user_pkey_access(current, pkey, init_val); + ret =3D arch_set_user_pkey_access(pkey, init_val); if (ret) { mm_pkey_free(current->mm, pkey); goto out; --=20 2.34.1