summaryrefslogtreecommitdiff
path: root/include/linux/errqueue.h
diff options
context:
space:
mode:
authorChristophe Leroy (CS GROUP) <chleroy@kernel.org>2026-06-03 13:20:14 +0300
committerMadhavan Srinivasan <maddy@linux.ibm.com>2026-06-08 13:29:02 +0300
commit90b45dbf59d50e32c4f86072545ff44bec9cb28e (patch)
treeac080b983e435f16066e9616f177c2dfa1a16e8a /include/linux/errqueue.h
parent334f3f6d7a1660fd65597bad9960bfa33a716d35 (diff)
downloadlinux-90b45dbf59d50e32c4f86072545ff44bec9cb28e.tar.xz
powerpc: Simplify access_ok()
With the implementation of masked user access, we always have a memory gap between user memory space and kernel memory space, so use it to simplify access_ok() by relying on access fault in case of an access in the gap. Most of the time the size is known at build time. On powerpc64, the kernel space starts at 0x8000000000000000 which is always more than two times TASK_USER_MAX so when the size is known at build time and lower than TASK_USER_MAX, only the address needs to be verified. If not, a binary or of address and size must be lower than TASK_USER_MAX. As TASK_USER_MAX is a power of 2, just check that there is no bit set outside of TASK_USER_MAX - 1 mask. On powerpc32, there is a garanteed gap of 128KB so when the size is known at build time and not greater than 128KB, just check that the address is below TASK_SIZE. Otherwise use the original formula. Signed-off-by: Christophe Leroy (CS GROUP) <chleroy@kernel.org> Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com> Link: https://patch.msgid.link/f496ba4f309a2fb9fd0d8811e941bbcaf5d196cf.1780482002.git.chleroy@kernel.org
Diffstat (limited to 'include/linux/errqueue.h')
0 files changed, 0 insertions, 0 deletions