# git rev-parse -q --verify cf144f81a99d1a3928f90b0936accfd3f45c9a0a^{commit} cf144f81a99d1a3928f90b0936accfd3f45c9a0a already have revision, skipping fetch # git checkout -q -f -B kisskb cf144f81a99d1a3928f90b0936accfd3f45c9a0a # git clean -qxdf # < git log -1 # commit cf144f81a99d1a3928f90b0936accfd3f45c9a0a # Author: Daniel Jordan # Date: Tue Jul 16 12:32:53 2019 -0400 # # padata: use smp_mb in padata_reorder to avoid orphaned padata jobs # # Testing padata with the tcrypt module on a 5.2 kernel... # # # modprobe tcrypt alg="pcrypt(rfc4106(gcm(aes)))" type=3 # # modprobe tcrypt mode=211 sec=1 # # ...produces this splat: # # INFO: task modprobe:10075 blocked for more than 120 seconds. # Not tainted 5.2.0-base+ #16 # modprobe D 0 10075 10064 0x80004080 # Call Trace: # ? __schedule+0x4dd/0x610 # ? ring_buffer_unlock_commit+0x23/0x100 # schedule+0x6c/0x90 # schedule_timeout+0x3b/0x320 # ? trace_buffer_unlock_commit_regs+0x4f/0x1f0 # wait_for_common+0x160/0x1a0 # ? wake_up_q+0x80/0x80 # { crypto_wait_req } # entries in braces added by hand # { do_one_aead_op } # { test_aead_jiffies } # test_aead_speed.constprop.17+0x681/0xf30 [tcrypt] # do_test+0x4053/0x6a2b [tcrypt] # ? 0xffffffffa00f4000 # tcrypt_mod_init+0x50/0x1000 [tcrypt] # ... # # The second modprobe command never finishes because in padata_reorder, # CPU0's load of reorder_objects is executed before the unlocking store in # spin_unlock_bh(pd->lock), causing CPU0 to miss CPU1's increment: # # CPU0 CPU1 # # padata_reorder padata_do_serial # LOAD reorder_objects // 0 # INC reorder_objects // 1 # padata_reorder # TRYLOCK pd->lock // failed # UNLOCK pd->lock # # CPU0 deletes the timer before returning from padata_reorder and since no # other job is submitted to padata, modprobe waits indefinitely. # # Add a pair of full barriers to guarantee proper ordering: # # CPU0 CPU1 # # padata_reorder padata_do_serial # UNLOCK pd->lock # smp_mb() # LOAD reorder_objects # INC reorder_objects # smp_mb__after_atomic() # padata_reorder # TRYLOCK pd->lock # # smp_mb__after_atomic is needed so the read part of the trylock operation # comes after the INC, as Andrea points out. Thanks also to Andrea for # help with writing a litmus test. # # Fixes: 16295bec6398 ("padata: Generic parallelization/serialization interface") # Signed-off-by: Daniel Jordan # Cc: # Cc: Andrea Parri # Cc: Boqun Feng # Cc: Herbert Xu # Cc: Paul E. McKenney # Cc: Peter Zijlstra # Cc: Steffen Klassert # Cc: linux-arch@vger.kernel.org # Cc: linux-crypto@vger.kernel.org # Cc: linux-kernel@vger.kernel.org # Signed-off-by: Herbert Xu # < /opt/cross/kisskb/gcc-4.6.3-nolibc/powerpc-linux/bin/powerpc-linux-gcc --version # < /opt/cross/kisskb/gcc-4.6.3-nolibc/powerpc-linux/bin/powerpc-linux-ld --version # < git log --format=%s --max-count=1 cf144f81a99d1a3928f90b0936accfd3f45c9a0a # < make -s -j 24 ARCH=powerpc O=/kisskb/build/crypto_ppc64_defconfig+NO_TM_powerpc-gcc4.6 CROSS_COMPILE=/opt/cross/kisskb/gcc-4.6.3-nolibc/powerpc-linux/bin/powerpc-linux- ppc64_defconfig # Added to kconfig CONFIG_PPC_TRANSACTIONAL_MEM=n # yes \n | make -s -j 24 ARCH=powerpc O=/kisskb/build/crypto_ppc64_defconfig+NO_TM_powerpc-gcc4.6 CROSS_COMPILE=/opt/cross/kisskb/gcc-4.6.3-nolibc/powerpc-linux/bin/powerpc-linux- oldconfig yes: standard output: Broken pipe # make -s -j 24 ARCH=powerpc O=/kisskb/build/crypto_ppc64_defconfig+NO_TM_powerpc-gcc4.6 CROSS_COMPILE=/opt/cross/kisskb/gcc-4.6.3-nolibc/powerpc-linux/bin/powerpc-linux- /kisskb/src/kernel/printk/printk.c: In function 'devkmsg_sysctl_set_loglvl': /kisskb/src/kernel/printk/printk.c:193:16: warning: 'old' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/mm/hugetlb.c: In function 'alloc_pool_huge_page': /kisskb/src/mm/hugetlb.c:1464:5: warning: 'page' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/kernel/futex.c: In function 'do_futex': /kisskb/src/kernel/futex.c:1658:3: warning: 'oldval' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/kernel/futex.c:1633:6: note: 'oldval' was declared here /kisskb/src/fs/nfsd/nfs4xdr.c: In function 'nfsd4_encode_components_esc': /kisskb/src/fs/nfsd/nfs4xdr.c:2077:9: warning: 'str' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/fs/proc/inode.c: In function 'proc_reg_open': /kisskb/src/include/linux/list.h:65:12: warning: 'pdeo' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/fs/proc/inode.c:331:21: note: 'pdeo' was declared here /kisskb/src/drivers/base/regmap/regmap.c: In function 'regmap_raw_read': /kisskb/src/drivers/base/regmap/regmap.c:2589:6: warning: 'ret' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/base/regmap/regmap.c: In function '_regmap_raw_write': /kisskb/src/drivers/base/regmap/regmap.c:1850:6: warning: 'ret' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/fs/udf/unicode.c: In function 'udf_name_conv_char': /kisskb/src/fs/udf/unicode.c:132:8: warning: 'c' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/net/bridge/br_netlink.c: In function 'br_afspec.isra.28': /kisskb/src/net/bridge/br_netlink.c:652:7: warning: 'err' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/net/core/devlink.c: In function 'devlink_fmsg_snd.constprop.71': /kisskb/src/net/core/devlink.c:4394:6: warning: 'err' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/tty/serial/8250/8250_core.c: In function 'univ8250_release_irq': /kisskb/src/drivers/tty/serial/8250/8250_core.c:247:18: warning: 'i' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/tty/serial/8250/8250_core.c:227:19: note: 'i' was declared here /kisskb/src/drivers/net/tun.c: In function 'tun_get_user': /kisskb/src/drivers/net/tun.c:1851:30: warning: 'copylen' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/net/tun.c:1764:46: warning: 'linear' may be used uninitialized in this function [-Wuninitialized] WARNING: vmlinux.o(.text+0x3dc6): Section mismatch in reference from the variable start_here_multiplatform to the function .init.text:.early_setup() The function start_here_multiplatform() references the function __init .early_setup(). This is often because start_here_multiplatform lacks a __init annotation or the annotation of .early_setup is wrong. warning: same basename if the following are built as modules: arch/powerpc/platforms/powermac/nvram.ko drivers/char/nvram.ko Completed OK # rm -rf /kisskb/build/crypto_ppc64_defconfig+NO_TM_powerpc-gcc4.6 # Build took: 0:03:25.509479