From nobody Mon Feb 9 17:24:15 2026 Received: from pegase2.c-s.fr (pegase2.c-s.fr [93.17.235.10]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 76657322DD4; Fri, 17 Oct 2025 10:50:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=93.17.235.10 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760698229; cv=none; b=dyg+363Eq8EiOTLqA8RVvhDj83HWl7CYpiNEE9S+US+dCskJLBuW0gIooSiQrQvVhmCU4LBTHs743dhND2EfLltEArOg4MNDOLrjt0NnzNSdF4cW2FIGEVkTaoC8j9Xr63pkuXmQ4/VNQrZh8Ld3EzUSKn/bKk7oOR0m4QRQWaI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760698229; c=relaxed/simple; bh=KnzlfUS7b6A05GpPdjrBHv7ZFNA1ZFx8E2W+mgIICCo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dt45XfbmDZvEfKzjU7070hOQGWY8ofmLnspg7uXGxZyPsVwQsp9cHyWcjCcAbx1uSuSii1pVUv6sHXkfw7wEX+MVsJLN7epovKRU4TyPe8fZkwfk+fl6O3u4SUjjhh2SO8IgE/EmpPuI98B+3wCGgKlec56kMqVjSh6O7xcaElM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=csgroup.eu; spf=pass smtp.mailfrom=csgroup.eu; arc=none smtp.client-ip=93.17.235.10 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=csgroup.eu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=csgroup.eu Received: from localhost (mailhub4.si.c-s.fr [172.26.127.67]) by localhost (Postfix) with ESMTP id 4cp17s5Wfbz9sSf; Fri, 17 Oct 2025 12:21:29 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from pegase2.c-s.fr ([172.26.127.65]) by localhost (pegase2.c-s.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6yjdANs33xzn; Fri, 17 Oct 2025 12:21:29 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase2.c-s.fr (Postfix) with ESMTP id 4cp17s4ZMHz9sSd; Fri, 17 Oct 2025 12:21:29 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 8780F8B786; Fri, 17 Oct 2025 12:21:29 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id ArRtS1RISlwm; Fri, 17 Oct 2025 12:21:29 +0200 (CEST) Received: from PO20335.idsi0.si.c-s.fr (unknown [192.168.235.99]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 5A1988B780; Fri, 17 Oct 2025 12:21:28 +0200 (CEST) From: Christophe Leroy To: Alexander Viro , Christian Brauner , Jan Kara , Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Darren Hart , Davidlohr Bueso , "Andre Almeida" , Andrew Morton , Eric Dumazet , Kuniyuki Iwashima , Paolo Abeni , Willem de Bruijn , "David S. Miller" , Jakub Kicinski , Simon Horman , Daniel Borkmann , Dave Hansen , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin Cc: Christophe Leroy , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: [PATCH v3 05/10] powerpc/uaccess: Remove unused size and from parameters from allow_access_user() Date: Fri, 17 Oct 2025 12:21:01 +0200 Message-ID: <62374ab8b781365da76cadba5d9cceb57127f856.1760529207.git.christophe.leroy@csgroup.eu> X-Mailer: git-send-email 2.49.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=5364; i=christophe.leroy@csgroup.eu; h=from:subject:message-id; bh=KnzlfUS7b6A05GpPdjrBHv7ZFNA1ZFx8E2W+mgIICCo=; b=owGbwMvMwCV2d0KB2p7V54MZT6slMWR8kph8e+rcVP1jbU9s/s5dd0dic7reD2ud5dXzUz40B /1ZPkkiuaOUhUGMi0FWTJHl+H/uXTO6vqTmT92lDzOHlQlkCAMXpwBMREWT4X/S1hSL4NVd1WZO EzwPNJ4Kyjsg8PupmNQkm2NLd6bM7Eth+B8kbF61y6FlnvSDDzf258lN4Ws6/p1XYvdVm+CFJQn bwnkB X-Developer-Key: i=christophe.leroy@csgroup.eu; a=openpgp; fpr=10FFE6F8B390DE17ACC2632368A92FEB01B8DD78 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Since commit 16132529cee5 ("powerpc/32s: Rework Kernel Userspace Access Protection") the size parameter is unused on all platforms. And the 'from' parameter has never been used. Remove them. Signed-off-by: Christophe Leroy --- v2: Also remove 'from' param. --- arch/powerpc/include/asm/book3s/32/kup.h | 3 +-- arch/powerpc/include/asm/book3s/64/kup.h | 6 ++---- arch/powerpc/include/asm/kup.h | 9 ++++----- arch/powerpc/include/asm/nohash/32/kup-8xx.h | 3 +-- arch/powerpc/include/asm/nohash/kup-booke.h | 3 +-- 5 files changed, 9 insertions(+), 15 deletions(-) diff --git a/arch/powerpc/include/asm/book3s/32/kup.h b/arch/powerpc/includ= e/asm/book3s/32/kup.h index 873c5146e3261..a3558419c41b1 100644 --- a/arch/powerpc/include/asm/book3s/32/kup.h +++ b/arch/powerpc/include/asm/book3s/32/kup.h @@ -97,8 +97,7 @@ static __always_inline unsigned long __kuap_get_and_asser= t_locked(void) } #define __kuap_get_and_assert_locked __kuap_get_and_assert_locked =20 -static __always_inline void allow_user_access(void __user *to, const void = __user *from, - u32 size, unsigned long dir) +static __always_inline void allow_user_access(void __user *to, unsigned lo= ng dir) { BUILD_BUG_ON(!__builtin_constant_p(dir)); =20 diff --git a/arch/powerpc/include/asm/book3s/64/kup.h b/arch/powerpc/includ= e/asm/book3s/64/kup.h index 03aec3c6c851c..9ccf8a5e0926f 100644 --- a/arch/powerpc/include/asm/book3s/64/kup.h +++ b/arch/powerpc/include/asm/book3s/64/kup.h @@ -353,8 +353,7 @@ __bad_kuap_fault(struct pt_regs *regs, unsigned long ad= dress, bool is_write) return (regs->amr & AMR_KUAP_BLOCK_READ) =3D=3D AMR_KUAP_BLOCK_READ; } =20 -static __always_inline void allow_user_access(void __user *to, const void = __user *from, - unsigned long size, unsigned long dir) +static __always_inline void allow_user_access(void __user *to, unsigned lo= ng dir) { unsigned long thread_amr =3D 0; =20 @@ -383,8 +382,7 @@ static __always_inline unsigned long get_kuap(void) =20 static __always_inline void set_kuap(unsigned long value) { } =20 -static __always_inline void allow_user_access(void __user *to, const void = __user *from, - unsigned long size, unsigned long dir) +static __always_inline void allow_user_access(void __user *to, unsigned lo= ng dir) { } =20 #endif /* !CONFIG_PPC_KUAP */ diff --git a/arch/powerpc/include/asm/kup.h b/arch/powerpc/include/asm/kup.h index f2009d7c8cfa7..3963584ac1cf1 100644 --- a/arch/powerpc/include/asm/kup.h +++ b/arch/powerpc/include/asm/kup.h @@ -72,8 +72,7 @@ static __always_inline void __kuap_kernel_restore(struct = pt_regs *regs, unsigned * platforms. */ #ifndef CONFIG_PPC_BOOK3S_64 -static __always_inline void allow_user_access(void __user *to, const void = __user *from, - unsigned long size, unsigned long dir) { } +static __always_inline void allow_user_access(void __user *to, unsigned lo= ng dir) { } static __always_inline void prevent_user_access(unsigned long dir) { } static __always_inline unsigned long prevent_user_access_return(void) { re= turn 0UL; } static __always_inline void restore_user_access(unsigned long flags) { } @@ -134,18 +133,18 @@ static __always_inline void kuap_assert_locked(void) =20 static __always_inline void allow_read_from_user(const void __user *from, = unsigned long size) { - allow_user_access(NULL, from, size, KUAP_READ); + allow_user_access(NULL, KUAP_READ); } =20 static __always_inline void allow_write_to_user(void __user *to, unsigned = long size) { - allow_user_access(to, NULL, size, KUAP_WRITE); + allow_user_access(to, KUAP_WRITE); } =20 static __always_inline void allow_read_write_user(void __user *to, const v= oid __user *from, unsigned long size) { - allow_user_access(to, from, size, KUAP_READ_WRITE); + allow_user_access(to, KUAP_READ_WRITE); } =20 static __always_inline void prevent_read_from_user(const void __user *from= , unsigned long size) diff --git a/arch/powerpc/include/asm/nohash/32/kup-8xx.h b/arch/powerpc/in= clude/asm/nohash/32/kup-8xx.h index 08486b15b2075..efffb5006d190 100644 --- a/arch/powerpc/include/asm/nohash/32/kup-8xx.h +++ b/arch/powerpc/include/asm/nohash/32/kup-8xx.h @@ -49,8 +49,7 @@ static __always_inline void uaccess_end_8xx(void) "i"(SPRN_MD_AP), "r"(MD_APG_KUAP), "i"(MMU_FTR_KUAP) : "memory"); } =20 -static __always_inline void allow_user_access(void __user *to, const void = __user *from, - unsigned long size, unsigned long dir) +static __always_inline void allow_user_access(void __user *to, unsigned lo= ng dir) { uaccess_begin_8xx(MD_APG_INIT); } diff --git a/arch/powerpc/include/asm/nohash/kup-booke.h b/arch/powerpc/inc= lude/asm/nohash/kup-booke.h index d6bbb6d78bbe4..cb2d5a96c3df7 100644 --- a/arch/powerpc/include/asm/nohash/kup-booke.h +++ b/arch/powerpc/include/asm/nohash/kup-booke.h @@ -73,8 +73,7 @@ static __always_inline void uaccess_end_booke(void) "i"(SPRN_PID), "r"(0), "i"(MMU_FTR_KUAP) : "memory"); } =20 -static __always_inline void allow_user_access(void __user *to, const void = __user *from, - unsigned long size, unsigned long dir) +static __always_inline void allow_user_access(void __user *to, unsigned lo= ng dir) { uaccess_begin_booke(current->thread.pid); } --=20 2.49.0