]> git.ipfire.org Git - thirdparty/linux.git/commit
powerpc/net: Inline checksum wrappers and convert to scoped user access
authorChristophe Leroy (CS GROUP) <chleroy@kernel.org>
Tue, 10 Mar 2026 10:05:54 +0000 (11:05 +0100)
committerMadhavan Srinivasan <maddy@linux.ibm.com>
Wed, 1 Apr 2026 03:51:07 +0000 (09:21 +0530)
commitcae734710dd156e2fbb4d66cdb22bbd5080beb52
tree9edf06f904390663eb0b2d64618e0d1a271ec485
parentcd54714e938d4951abc671e562d10c2308613901
powerpc/net: Inline checksum wrappers and convert to scoped user access

Commit 861574d51bbd ("powerpc/uaccess: Implement masked user access")
provides optimised user access by avoiding the cost of access_ok().

Convert csum_and_copy_to_user() and csum_and_copy_from_user() to
scoped user access to benefit from masked user access.

csum_and_copy_to_user() and csum_and_copy_from_user() are only
called respectively by csum_and_copy_to_iter() and
csum_and_copy_from_iter_full() and they are only called twice.

Those functions used to be large but they were first reduced by
commit c693cc4676a0 ("saner calling conventions for
csum_and_copy_..._user()") then commit 70d65cd555c5 ("ppc: propagate
the calling conventions change down to csum_partial_copy_generic()").
With the additional size reduction provided by conversion to scoped
user access they are not worth being kept out of line.

  $ ./scripts/bloat-o-meter vmlinux.0 vmlinux.1
  add/remove: 0/2 grow/shrink: 2/0 up/down: 136/-176 (-40)
  Function                                     old     new   delta
  csum_and_copy_to_iter                       2416    2488     +72
  csum_and_copy_from_iter_full                2272    2336     +64
  csum_and_copy_to_user                         88       -     -88
  csum_and_copy_from_user                       88       -     -88
  Total: Before=11514471, After=11514431, chg -0.00%

Signed-off-by: Christophe Leroy (CS GROUP) <chleroy@kernel.org>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/f44e1b2760dbed35b237040001a91bc8304b726b.1773137098.git.chleroy@kernel.org
arch/powerpc/include/asm/checksum.h
arch/powerpc/lib/Makefile
arch/powerpc/lib/checksum_wrappers.c [deleted file]