# git rev-parse -q --verify 12f363511d47f86c49b7766c349989cb33fd61a8^{commit} 12f363511d47f86c49b7766c349989cb33fd61a8 already have revision, skipping fetch # git checkout -q -f -B kisskb 12f363511d47f86c49b7766c349989cb33fd61a8 # git clean -qxdf # < git log -1 # commit 12f363511d47f86c49b7766c349989cb33fd61a8 # Author: Christophe Leroy # Date: Tue Apr 30 16:11:59 2019 +0000 # # powerpc/32s: Fix BATs setting with CONFIG_STRICT_KERNEL_RWX # # Serge reported some crashes with CONFIG_STRICT_KERNEL_RWX enabled # on a book3s32 machine. # # Analysis shows two issues: # - BATs addresses and sizes are not properly aligned. # - There is a gap between the last address covered by BATs and the # first address covered by pages. # # Memory mapped with DBATs: # 0: 0xc0000000-0xc07fffff 0x00000000 Kernel RO coherent # 1: 0xc0800000-0xc0bfffff 0x00800000 Kernel RO coherent # 2: 0xc0c00000-0xc13fffff 0x00c00000 Kernel RW coherent # 3: 0xc1400000-0xc23fffff 0x01400000 Kernel RW coherent # 4: 0xc2400000-0xc43fffff 0x02400000 Kernel RW coherent # 5: 0xc4400000-0xc83fffff 0x04400000 Kernel RW coherent # 6: 0xc8400000-0xd03fffff 0x08400000 Kernel RW coherent # 7: 0xd0400000-0xe03fffff 0x10400000 Kernel RW coherent # # Memory mapped with pages: # 0xe1000000-0xefffffff 0x21000000 240M rw present dirty accessed # # This patch fixes both issues. With the patch, we get the following # which is as expected: # # Memory mapped with DBATs: # 0: 0xc0000000-0xc07fffff 0x00000000 Kernel RO coherent # 1: 0xc0800000-0xc0bfffff 0x00800000 Kernel RO coherent # 2: 0xc0c00000-0xc0ffffff 0x00c00000 Kernel RW coherent # 3: 0xc1000000-0xc1ffffff 0x01000000 Kernel RW coherent # 4: 0xc2000000-0xc3ffffff 0x02000000 Kernel RW coherent # 5: 0xc4000000-0xc7ffffff 0x04000000 Kernel RW coherent # 6: 0xc8000000-0xcfffffff 0x08000000 Kernel RW coherent # 7: 0xd0000000-0xdfffffff 0x10000000 Kernel RW coherent # # Memory mapped with pages: # 0xe0000000-0xefffffff 0x20000000 256M rw present dirty accessed # # Fixes: 63b2bc619565 ("powerpc/mm/32s: Use BATs for STRICT_KERNEL_RWX") # Reported-by: Serge Belyshev # Acked-by: Segher Boessenkool # Signed-off-by: Christophe Leroy # Signed-off-by: Michael Ellerman # < /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 12f363511d47f86c49b7766c349989cb33fd61a8 # < make -s -j 10 ARCH=powerpc O=/kisskb/build/powerpc-fixes_pseries_defconfig+POWERNV=n_powerpc-gcc4.6 CROSS_COMPILE=/opt/cross/kisskb/gcc-4.6.3-nolibc/powerpc-linux/bin/powerpc-linux- pseries_defconfig # Added to kconfig CONFIG_PPC_POWERNV=n # yes \n | make -s -j 10 ARCH=powerpc O=/kisskb/build/powerpc-fixes_pseries_defconfig+POWERNV=n_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 10 ARCH=powerpc O=/kisskb/build/powerpc-fixes_pseries_defconfig+POWERNV=n_powerpc-gcc4.6 CROSS_COMPILE=/opt/cross/kisskb/gcc-4.6.3-nolibc/powerpc-linux/bin/powerpc-linux- :1478:2: warning: #warning syscall pidfd_send_signal not implemented [-Wcpp] :1481:2: warning: #warning syscall io_uring_setup not implemented [-Wcpp] :1484:2: warning: #warning syscall io_uring_enter not implemented [-Wcpp] :1487:2: warning: #warning syscall io_uring_register not implemented [-Wcpp] /kisskb/src/kernel/printk/printk.c: In function 'devkmsg_sysctl_set_loglvl': /kisskb/src/kernel/printk/printk.c:187:16: warning: 'old' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/kernel/trace/trace_dynevent.c: In function 'create_dyn_event': /kisskb/src/kernel/trace/trace_dynevent.c:89:5: warning: 'ret' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/mm/hugetlb.c: In function 'alloc_pool_huge_page': /kisskb/src/mm/hugetlb.c:1435:5: warning: 'page' 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:2594: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:1855:6: warning: 'ret' 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/drivers/i2c/i2c-core-base.c: In function 'i2c_generic_scl_recovery': /kisskb/src/drivers/i2c/i2c-core-base.c:235:5: warning: 'ret' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/fs/nfsd/nfs4xdr.c: In function 'nfsd4_encode_components_esc': /kisskb/src/fs/nfsd/nfs4xdr.c:2076: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:337:21: note: 'pdeo' was declared here /kisskb/src/net/netfilter/nf_nat_masquerade.c:15:21: warning: 'masq_refcnt6' defined but not used [-Wunused-variable] /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/sunrpc/xprtsock.c: In function 'xs_read_stream.constprop.18': /kisskb/src/net/sunrpc/xprtsock.c:529:2: warning: 'read' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/net/sunrpc/xprtsock.c:498:15: note: 'read' was declared here /kisskb/src/net/sunrpc/xprtsock.c:529:2: warning: 'ret' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/net/sunrpc/xprtsock.c:499:10: note: 'ret' was declared here /kisskb/src/drivers/net/tun.c: In function 'tun_get_user': /kisskb/src/drivers/net/tun.c:1845:30: warning: 'copylen' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/net/tun.c:1755:46: warning: 'linear' 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 Completed OK # rm -rf /kisskb/build/powerpc-fixes_pseries_defconfig+POWERNV=n_powerpc-gcc4.6 # Build took: 0:02:42.132211