# git rev-parse -q --verify a180bd1d7e16173d965b263c5a536aa40afa2a2a^{commit} a180bd1d7e16173d965b263c5a536aa40afa2a2a already have revision, skipping fetch # git checkout -q -f -B kisskb a180bd1d7e16173d965b263c5a536aa40afa2a2a # git clean -qxdf # < git log -1 # commit a180bd1d7e16173d965b263c5a536aa40afa2a2a # Author: Linus Torvalds # Date: Sun Jul 4 16:12:42 2021 -0700 # # iov_iter: remove uaccess_kernel() warning from iov_iter_init() # # This warning was there to catch any architectures that still use # CONFIG_SET_FS, and that would mis-use iov_iter_init() for anything that # wasn't a proper user space pointer. So that # # WARN_ON_ONCE(uaccess_kernel()); # # makes perfect conceptual sense: you really shouldn't use a kernel # pointer with set_fs(KERNEL_DS) and then pass it to iov_iter_init(). # # HOWEVER. # # Guenter Roeck reports that this warning actually triggers in no-mmu # configurations of both ARM and m68k. And the reason isn't that they # pass in a kernel pointer under set_fs(KERNEL_DS) at all: the reason is # that in those configurations, "uaccess_kernel()" is simply not reliable. # # Those no-mmu setups set USER_DS and KERNEL_DS to the same values, so you # can't test for the difference. # # In particular, the no-mmu case for ARM does # # #define USER_DS KERNEL_DS # #define uaccess_kernel() (true) # # so USER_DS and KERNEL_DS have the same value, and uaccess_kernel() is # always trivially true. # # The m68k case is slightly different and not quite as obvious. It does # (spread out over multiple header files just to be extra exciting: # asm/processor.h, asm/segment.h and asm-generic/uaccess.h): # # #define TASK_SIZE (0xFFFFFFFFUL) # #define USER_DS MAKE_MM_SEG(TASK_SIZE) # #define KERNEL_DS MAKE_MM_SEG(~0UL) # #define get_fs() (current_thread_info()->addr_limit) # #define uaccess_kernel() (get_fs().seg == KERNEL_DS.seg) # # but the end result is the same: uaccess_kernel() will always be true, # because USER_DS and KERNEL_DS end up having the same value, even if that # value is defined differently. # # This is very arguably a misfeature in those implementations, but in the # end we don't really care. All modern architectures have gotten rid of # set_fs() already, and generic kernel code never uses it. And while the # sanity check was a nice idea, an architecture would have to go the extra # mile to actually break this. # # So this well-intentioned warning isn't really all that likely to find # anything but these known false positives, and as such just isn't worth # maintaining. # # Reported-by: Guenter Roeck # Fixes: 8cd54c1c8480 ("iov_iter: separate direction from flavour") # Cc: Matthew Wilcox # Cc: Al Viro # Signed-off-by: Linus Torvalds # < /opt/cross/kisskb/korg/gcc-8.1.0-nolibc/aarch64-linux/bin/aarch64-linux-gcc --version # < /opt/cross/kisskb/korg/gcc-8.1.0-nolibc/aarch64-linux/bin/aarch64-linux-ld --version # < git log --format=%s --max-count=1 a180bd1d7e16173d965b263c5a536aa40afa2a2a # < make -s -j 8 ARCH=arm64 O=/kisskb/build/linus_arm64-allmodconfig_arm64-gcc8 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.1.0-nolibc/aarch64-linux/bin/aarch64-linux- allmodconfig # < make -s -j 8 ARCH=arm64 O=/kisskb/build/linus_arm64-allmodconfig_arm64-gcc8 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.1.0-nolibc/aarch64-linux/bin/aarch64-linux- help # make -s -j 8 ARCH=arm64 O=/kisskb/build/linus_arm64-allmodconfig_arm64-gcc8 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.1.0-nolibc/aarch64-linux/bin/aarch64-linux- olddefconfig # make -s -j 8 ARCH=arm64 O=/kisskb/build/linus_arm64-allmodconfig_arm64-gcc8 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.1.0-nolibc/aarch64-linux/bin/aarch64-linux- /kisskb/src/kernel/trace/trace_osnoise.c: In function 'start_kthread': /kisskb/src/kernel/trace/trace_osnoise.c:1461:8: warning: 'main' is usually a function [-Wmain] void *main = osnoise_main; ^~~~ /kisskb/src/lib/test_scanf.c: In function 'numbers_list_field_width_val_width': /kisskb/src/lib/test_scanf.c:530:1: warning: the frame size of 2512 bytes is larger than 2048 bytes [-Wframe-larger-than=] } ^ /kisskb/src/lib/test_scanf.c: In function 'numbers_list_field_width_typemax': /kisskb/src/lib/test_scanf.c:488:1: warning: the frame size of 3008 bytes is larger than 2048 bytes [-Wframe-larger-than=] } ^ /kisskb/src/lib/test_scanf.c: In function 'numbers_list': /kisskb/src/lib/test_scanf.c:437:1: warning: the frame size of 2512 bytes is larger than 2048 bytes [-Wframe-larger-than=] } ^ In file included from /kisskb/src/include/linux/byteorder/little_endian.h:5, from /kisskb/src/arch/arm64/include/uapi/asm/byteorder.h:23, from /kisskb/src/include/asm-generic/bitops/le.h:7, from /kisskb/src/arch/arm64/include/asm/bitops.h:29, from /kisskb/src/include/linux/bitops.h:32, from /kisskb/src/include/linux/of.h:15, from /kisskb/src/include/linux/irqdomain.h:35, from /kisskb/src/include/linux/acpi.h:13, from /kisskb/src/drivers/infiniband/hw/hns/hns_roce_hw_v2.c:33: In function 'modify_qp_init_to_rtr', inlined from 'hns_roce_v2_set_abs_fields' at /kisskb/src/drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4798:9, inlined from 'hns_roce_v2_modify_qp' at /kisskb/src/drivers/infiniband/hw/hns/hns_roce_hw_v2.c:5001:8: /kisskb/src/include/linux/compiler_types.h:328:38: error: call to '__compiletime_assert_1857' declared with attribute error: FIELD_PREP: value too large for the field _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) ^ /kisskb/src/include/uapi/linux/byteorder/little_endian.h:33:51: note: in definition of macro '__cpu_to_le32' #define __cpu_to_le32(x) ((__force __le32)(__u32)(x)) ^ /kisskb/src/include/linux/compiler_types.h:316:2: note: in expansion of macro '__compiletime_assert' __compiletime_assert(condition, msg, prefix, suffix) ^~~~~~~~~~~~~~~~~~~~ /kisskb/src/include/linux/compiler_types.h:328:2: note: in expansion of macro '_compiletime_assert' _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) ^~~~~~~~~~~~~~~~~~~ /kisskb/src/include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert' #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg) ^~~~~~~~~~~~~~~~~~ /kisskb/src/include/linux/bitfield.h:49:3: note: in expansion of macro 'BUILD_BUG_ON_MSG' BUILD_BUG_ON_MSG(__builtin_constant_p(_val) ? \ ^~~~~~~~~~~~~~~~ /kisskb/src/include/linux/bitfield.h:94:3: note: in expansion of macro '__BF_FIELD_CHECK' __BF_FIELD_CHECK(_mask, 0ULL, _val, "FIELD_PREP: "); \ ^~~~~~~~~~~~~~~~ /kisskb/src/drivers/infiniband/hw/hns/hns_roce_common.h:91:52: note: in expansion of macro 'FIELD_PREP' *((__le32 *)ptr + (field_h) / 32) |= cpu_to_le32(FIELD_PREP( \ ^~~~~~~~~~ /kisskb/src/drivers/infiniband/hw/hns/hns_roce_common.h:95:39: note: in expansion of macro '_hr_reg_write' #define hr_reg_write(ptr, field, val) _hr_reg_write(ptr, field, val) ^~~~~~~~~~~~~ /kisskb/src/drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4422:2: note: in expansion of macro 'hr_reg_write' hr_reg_write(context, QPC_LP_PKTN_INI, lp_pktn_ini); ^~~~~~~~~~~~ /kisskb/src/include/linux/compiler_types.h:328:38: error: call to '__compiletime_assert_1864' declared with attribute error: FIELD_PREP: value too large for the field _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) ^ /kisskb/src/include/uapi/linux/byteorder/little_endian.h:33:51: note: in definition of macro '__cpu_to_le32' #define __cpu_to_le32(x) ((__force __le32)(__u32)(x)) ^ /kisskb/src/include/linux/compiler_types.h:316:2: note: in expansion of macro '__compiletime_assert' __compiletime_assert(condition, msg, prefix, suffix) ^~~~~~~~~~~~~~~~~~~~ /kisskb/src/include/linux/compiler_types.h:328:2: note: in expansion of macro '_compiletime_assert' _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) ^~~~~~~~~~~~~~~~~~~ /kisskb/src/include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert' #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg) ^~~~~~~~~~~~~~~~~~ /kisskb/src/include/linux/bitfield.h:49:3: note: in expansion of macro 'BUILD_BUG_ON_MSG' BUILD_BUG_ON_MSG(__builtin_constant_p(_val) ? \ ^~~~~~~~~~~~~~~~ /kisskb/src/include/linux/bitfield.h:94:3: note: in expansion of macro '__BF_FIELD_CHECK' __BF_FIELD_CHECK(_mask, 0ULL, _val, "FIELD_PREP: "); \ ^~~~~~~~~~~~~~~~ /kisskb/src/drivers/infiniband/hw/hns/hns_roce_common.h:91:52: note: in expansion of macro 'FIELD_PREP' *((__le32 *)ptr + (field_h) / 32) |= cpu_to_le32(FIELD_PREP( \ ^~~~~~~~~~ /kisskb/src/drivers/infiniband/hw/hns/hns_roce_common.h:95:39: note: in expansion of macro '_hr_reg_write' #define hr_reg_write(ptr, field, val) _hr_reg_write(ptr, field, val) ^~~~~~~~~~~~~ /kisskb/src/drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4426:2: note: in expansion of macro 'hr_reg_write' hr_reg_write(context, QPC_ACK_REQ_FREQ, lp_pktn_ini); ^~~~~~~~~~~~ make[5]: *** [/kisskb/src/scripts/Makefile.build:273: drivers/infiniband/hw/hns/hns_roce_hw_v2.o] Error 1 make[4]: *** [/kisskb/src/scripts/Makefile.build:516: drivers/infiniband/hw/hns] Error 2 make[3]: *** [/kisskb/src/scripts/Makefile.build:516: drivers/infiniband/hw] Error 2 make[2]: *** [/kisskb/src/scripts/Makefile.build:516: drivers/infiniband] Error 2 make[2]: *** Waiting for unfinished jobs.... make[1]: *** [/kisskb/src/Makefile:1847: drivers] Error 2 make: *** [Makefile:215: __sub-make] Error 2 Command 'make -s -j 8 ARCH=arm64 O=/kisskb/build/linus_arm64-allmodconfig_arm64-gcc8 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.1.0-nolibc/aarch64-linux/bin/aarch64-linux- ' returned non-zero exit status 2 # rm -rf /kisskb/build/linus_arm64-allmodconfig_arm64-gcc8 # Build took: 0:45:29.041836