# git rev-parse -q --verify 66be4e66a7f422128748e3c3ef6ee72b20a6197b^{commit} 66be4e66a7f422128748e3c3ef6ee72b20a6197b already have revision, skipping fetch # git checkout -q -f -B kisskb 66be4e66a7f422128748e3c3ef6ee72b20a6197b # git clean -qxdf # < git log -1 # commit 66be4e66a7f422128748e3c3ef6ee72b20a6197b # Author: Linus Torvalds # Date: Mon Jun 3 13:26:20 2019 -0700 # # rcu: locking and unlocking need to always be at least barriers # # Herbert Xu pointed out that commit bb73c52bad36 ("rcu: Don't disable # preemption for Tiny and Tree RCU readers") was incorrect in making the # preempt_disable/enable() be conditional on CONFIG_PREEMPT_COUNT. # # If CONFIG_PREEMPT_COUNT isn't enabled, the preemption enable/disable is # a no-op, but still is a compiler barrier. # # And RCU locking still _needs_ that compiler barrier. # # It is simply fundamentally not true that RCU locking would be a complete # no-op: we still need to guarantee (for example) that things that can # trap and cause preemption cannot migrate into the RCU locked region. # # The way we do that is by making it a barrier. # # See for example commit 386afc91144b ("spinlocks and preemption points # need to be at least compiler barriers") from back in 2013 that had # similar issues with spinlocks that become no-ops on UP: they must still # constrain the compiler from moving other operations into the critical # region. # # Now, it is true that a lot of RCU operations already use READ_ONCE() and # WRITE_ONCE() (which in practice likely would never be re-ordered wrt # anything remotely interesting), but it is also true that that is not # globally the case, and that it's not even necessarily always possible # (ie bitfields etc). # # Reported-by: Herbert Xu # Fixes: bb73c52bad36 ("rcu: Don't disable preemption for Tiny and Tree RCU readers") # Cc: stable@kernel.org # Cc: Boqun Feng # Cc: Paul E. McKenney # Signed-off-by: Linus Torvalds # < /opt/cross/kisskb/gcc-4.6.3-nolibc/sh4-linux/bin/sh4-linux-gcc --version # < /opt/cross/kisskb/gcc-4.6.3-nolibc/sh4-linux/bin/sh4-linux-ld --version # < git log --format=%s --max-count=1 66be4e66a7f422128748e3c3ef6ee72b20a6197b # < make -s -j 48 ARCH=sh O=/kisskb/build/linus_sh7724_generic_defconfig_sh4 CROSS_COMPILE=/opt/cross/kisskb/gcc-4.6.3-nolibc/sh4-linux/bin/sh4-linux- sh7724_generic_defconfig # make -s -j 48 ARCH=sh O=/kisskb/build/linus_sh7724_generic_defconfig_sh4 CROSS_COMPILE=/opt/cross/kisskb/gcc-4.6.3-nolibc/sh4-linux/bin/sh4-linux- Generating include/generated/machtypes.h /kisskb/src/arch/sh/kernel/cpu/sh4/../sh3/../../entry-common.S: Assembler messages: /kisskb/src/arch/sh/kernel/cpu/sh4/../sh3/../../entry-common.S:385: Warning: overflow in branch to syscall_exit_work; converted into longer instruction sequence /kisskb/src/arch/sh/kernel/cpu/sh4/../sh3/../../entry-common.S:388: Warning: overflow in branch to syscall_exit_work; converted into longer instruction sequence /kisskb/src/kernel/printk/printk.c: In function 'devkmsg_sysctl_set_loglvl': /kisskb/src/kernel/printk/printk.c:194:16: warning: 'old' 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/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/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/i2c/busses/i2c-sh_mobile.c: In function 'sh_mobile_i2c_isr': /kisskb/src/drivers/i2c/busses/i2c-sh_mobile.c:399:26: warning: 'data' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/i2c/busses/i2c-sh_mobile.c:372:16: note: 'data' was declared here /kisskb/src/drivers/sh/clk/cpg.c: In function 'r8': /kisskb/src/drivers/sh/clk/cpg.c:41:2: warning: passing argument 1 of 'ioread8' discards 'const' qualifier from pointer target type [enabled by default] /kisskb/src/include/asm-generic/iomap.h:29:21: note: expected 'void *' but argument is of type 'const void *' /kisskb/src/drivers/sh/clk/cpg.c: In function 'r16': /kisskb/src/drivers/sh/clk/cpg.c:46:2: warning: passing argument 1 of 'ioread16' discards 'const' qualifier from pointer target type [enabled by default] /kisskb/src/include/asm-generic/iomap.h:30:21: note: expected 'void *' but argument is of type 'const void *' /kisskb/src/drivers/sh/clk/cpg.c: In function 'r32': /kisskb/src/drivers/sh/clk/cpg.c:51:2: warning: passing argument 1 of 'ioread32' discards 'const' qualifier from pointer target type [enabled by default] /kisskb/src/include/asm-generic/iomap.h:32:21: note: expected 'void *' but argument is of type 'const void *' Kernel: arch/sh/boot/zImage is ready Completed OK # rm -rf /kisskb/build/linus_sh7724_generic_defconfig_sh4 # Build took: 0:00:23.115487