Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mm/pkeys: remove unused tsk parameter from arch_set_user_pkey_access()

The tsk parameter in arch_set_user_pkey_access() is never used in the
function implementations across all architectures (arm64, powerpc, x86).

Link: https://lkml.kernel.org/r/20260219063506.545148-1-sgsu.park@samsung.com
Signed-off-by: Seongsu Park <sgsu.park@samsung.com>
Cc: "Borislav Petkov (AMD)" <bp@alien8.de>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Seongsu Park and committed by
Andrew Morton
3d443691 0e8cf9a3

+10 -17
+1 -2
arch/arm64/include/asm/pkeys.h
··· 12 12 13 13 #define arch_max_pkey() 8 14 14 15 - int arch_set_user_pkey_access(struct task_struct *tsk, int pkey, 16 - unsigned long init_val); 15 + int arch_set_user_pkey_access(int pkey, unsigned long init_val); 17 16 18 17 static inline bool arch_pkeys_enabled(void) 19 18 {
+1 -1
arch/arm64/mm/mmu.c
··· 2206 2206 } 2207 2207 2208 2208 #ifdef CONFIG_ARCH_HAS_PKEYS 2209 - int arch_set_user_pkey_access(struct task_struct *tsk, int pkey, unsigned long init_val) 2209 + int arch_set_user_pkey_access(int pkey, unsigned long init_val) 2210 2210 { 2211 2211 u64 new_por; 2212 2212 u64 old_por;
+3 -5
arch/powerpc/include/asm/pkeys.h
··· 143 143 return __arch_override_mprotect_pkey(vma, prot, pkey); 144 144 } 145 145 146 - extern int __arch_set_user_pkey_access(struct task_struct *tsk, int pkey, 147 - unsigned long init_val); 148 - static inline int arch_set_user_pkey_access(struct task_struct *tsk, int pkey, 149 - unsigned long init_val) 146 + extern int __arch_set_user_pkey_access(int pkey, unsigned long init_val); 147 + static inline int arch_set_user_pkey_access(int pkey, unsigned long init_val) 150 148 { 151 149 if (!mmu_has_feature(MMU_FTR_PKEY)) 152 150 return -EINVAL; ··· 158 160 if (pkey == 0) 159 161 return init_val ? -EINVAL : 0; 160 162 161 - return __arch_set_user_pkey_access(tsk, pkey, init_val); 163 + return __arch_set_user_pkey_access(pkey, init_val); 162 164 } 163 165 164 166 static inline bool arch_pkeys_enabled(void)
+1 -2
arch/powerpc/mm/book3s64/pkeys.c
··· 335 335 * Set the access rights in AMR IAMR and UAMOR registers for @pkey to that 336 336 * specified in @init_val. 337 337 */ 338 - int __arch_set_user_pkey_access(struct task_struct *tsk, int pkey, 339 - unsigned long init_val) 338 + int __arch_set_user_pkey_access(int pkey, unsigned long init_val) 340 339 { 341 340 u64 new_amr_bits = 0x0ul; 342 341 u64 new_iamr_bits = 0x0ul;
+1 -2
arch/x86/include/asm/pkeys.h
··· 9 9 */ 10 10 #define arch_max_pkey() (cpu_feature_enabled(X86_FEATURE_OSPKE) ? 16 : 1) 11 11 12 - extern int arch_set_user_pkey_access(struct task_struct *tsk, int pkey, 13 - unsigned long init_val); 12 + extern int arch_set_user_pkey_access(int pkey, unsigned long init_val); 14 13 15 14 static inline bool arch_pkeys_enabled(void) 16 15 {
+1 -2
arch/x86/kernel/fpu/xstate.c
··· 1080 1080 * This will go out and modify PKRU register to set the access 1081 1081 * rights for @pkey to @init_val. 1082 1082 */ 1083 - int arch_set_user_pkey_access(struct task_struct *tsk, int pkey, 1084 - unsigned long init_val) 1083 + int arch_set_user_pkey_access(int pkey, unsigned long init_val) 1085 1084 { 1086 1085 u32 old_pkru, new_pkru_bits = 0; 1087 1086 int pkey_shift;
+1 -2
arch/x86/mm/pkeys.c
··· 42 42 * Set up PKRU so that it denies access for everything 43 43 * other than execution. 44 44 */ 45 - ret = arch_set_user_pkey_access(current, execute_only_pkey, 46 - PKEY_DISABLE_ACCESS); 45 + ret = arch_set_user_pkey_access(execute_only_pkey, PKEY_DISABLE_ACCESS); 47 46 /* 48 47 * If the PKRU-set operation failed somehow, just return 49 48 * 0 and effectively disable execute-only support.
+1 -1
mm/mprotect.c
··· 978 978 if (pkey == -1) 979 979 goto out; 980 980 981 - ret = arch_set_user_pkey_access(current, pkey, init_val); 981 + ret = arch_set_user_pkey_access(pkey, init_val); 982 982 if (ret) { 983 983 mm_pkey_free(current->mm, pkey); 984 984 goto out;