From nobody Wed Dec 17 09:27:47 2025 Received: from pegase2.c-s.fr (pegase2.c-s.fr [93.17.235.10]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1B64231985F; Thu, 6 Nov 2025 11:50:16 +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=1762429818; cv=none; b=QhprNwBxFubvpm2LUXejNdmyOfH9jkT79sLkVw+SQN37zD9WSjg05Byw4BkS9UMraO0JRw1YQ1jxbIcEDCrFXI48OdGAMqMjMVLIpBPi+aw0RD2R3HdAEga4tNqEzsZ2W58QjPmIGEulk3181yq/kxg1dL5B/8pFzCrhdL3Tt9w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762429818; c=relaxed/simple; bh=KnzlfUS7b6A05GpPdjrBHv7ZFNA1ZFx8E2W+mgIICCo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mAVOtJn02StU/h5O8iupvyOuNAqFuSLxh83xw8f7ON+WuTcxyTXMv+WUhzJDfhmL2oGQq4iaO48bmIXJREBJKNtvnZDzybxKG8HU4LiOctb2Xj/U8cd5DAROlLwZDPDP51PGIMBxWOy6mC7lG6aNpafMq31rNIxzJqe7JNQV6oQ= 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 4d2KmQ28qdz9sSf; Thu, 6 Nov 2025 12:32:22 +0100 (CET) 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 YVf_i7GoCn0I; Thu, 6 Nov 2025 12:32:22 +0100 (CET) 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 4d2KmJ4Mjpz9sSh; Thu, 6 Nov 2025 12:32:16 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 7C8418B792; Thu, 6 Nov 2025 12:32:16 +0100 (CET) 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 JO5LBR2iyzW5; Thu, 6 Nov 2025 12:32:16 +0100 (CET) Received: from PO20335.idsi0.si.c-s.fr (unknown [192.168.235.99]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 97B858B77B; Thu, 6 Nov 2025 12:32:15 +0100 (CET) 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 v4 05/10] powerpc/uaccess: Remove unused size and from parameters from allow_access_user() Date: Thu, 6 Nov 2025 12:31:23 +0100 Message-ID: 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=kA0DAAoW3ZBwJryrz1MByyZiAGkMhyqi7HXpCsd+qcBnUJl2gCnVLOzgpgcKPJ7chMABwclmX 4h1BAAWCgAdFiEEx/8LupiK9GVvlbov3ZBwJryrz1MFAmkMhyoACgkQ3ZBwJryrz1MeKwEAy0ha N7ps/87sD4oYwH26bIktbycULo/IbbKxgPhsgTsBANqE9t7CuwL1fTq/tdbdBaVJdXFbCT9dMNp HA5cqzQAK 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