# 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/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/mipsel-linux-gcc --version # < /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/mipsel-linux-ld --version # < git log --format=%s --max-count=1 12f363511d47f86c49b7766c349989cb33fd61a8 # < make -s -j 8 ARCH=mips O=/kisskb/build/powerpc-fixes_mips-defconfig_mipsel CROSS_COMPILE=/opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/mipsel-linux- defconfig # make -s -j 8 ARCH=mips O=/kisskb/build/powerpc-fixes_mips-defconfig_mipsel CROSS_COMPILE=/opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/mipsel-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/net/sunrpc/xprtsock.c: In function 'xs_read_stream_request.constprop': /kisskb/src/net/sunrpc/xprtsock.c:525:10: warning: 'read' may be used uninitialized in this function [-Wmaybe-uninitialized] return read; ^ /kisskb/src/net/sunrpc/xprtsock.c:529:9: warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized] return ret < 0 ? ret : read; ^ In file included from /kisskb/src/include/linux/printk.h:7:0, from /kisskb/src/include/linux/kernel.h:15, from /kisskb/src/include/linux/fs_context.h:15, from /kisskb/src/fs/fs_parser.c:13: /kisskb/src/fs/fs_parser.c: In function 'fs_validate_description': /kisskb/src/include/linux/kern_levels.h:5:18: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'int' [-Wformat=] #define KERN_SOH "\001" /* ASCII Start Of Header */ ^ /kisskb/src/include/linux/kern_levels.h:11:18: note: in expansion of macro 'KERN_SOH' #define KERN_ERR KERN_SOH "3" /* error conditions */ ^ /kisskb/src/include/linux/printk.h:302:9: note: in expansion of macro 'KERN_ERR' printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) ^ /kisskb/src/fs/fs_parser.c:413:6: note: in expansion of macro 'pr_err' pr_err("VALIDATE %s: e[%lu] enum val for %s\n", ^ :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] FIT description: Linux 5.1.0-rc2-g12f363511d47 Created: Thu May 2 17:33:40 2019 Image 0 (kernel@0) Description: Linux 5.1.0-rc2-g12f363511d47 Created: Thu May 2 17:33:40 2019 Type: Kernel Image Compression: gzip compressed Data Size: 4547381 Bytes = 4440.80 KiB = 4.34 MiB Architecture: MIPS OS: Linux Load Address: 0x80100000 Entry Point: 0x80867490 Hash algo: sha1 Hash value: 884c5d54c5a939f2df8bfc9df8cfdf2c161564a1 Image 1 (fdt@boston) Description: img,boston Device Tree Created: Thu May 2 17:33:40 2019 Type: Flat Device Tree Compression: uncompressed Data Size: 3793 Bytes = 3.70 KiB = 0.00 MiB Architecture: MIPS Hash algo: sha1 Hash value: 4799f50d688573234da6e9d7701234d394759ef4 Image 2 (fdt@ni169445) Description: NI 169445 device tree Created: Thu May 2 17:33:40 2019 Type: Flat Device Tree Compression: uncompressed Data Size: 1871 Bytes = 1.83 KiB = 0.00 MiB Architecture: MIPS Hash algo: sha1 Hash value: 51b89b31605ee62038c8468c429af091dfc75ec7 Image 3 (fdt@xilfpga) Description: MIPSfpga (xilfpga) Device Tree Created: Thu May 2 17:33:40 2019 Type: Flat Device Tree Compression: uncompressed Data Size: 2708 Bytes = 2.64 KiB = 0.00 MiB Architecture: MIPS Hash algo: sha1 Hash value: 63d058b780f65e22da30f0a183433765f1807f1d Default Configuration: 'conf@default' Configuration 0 (conf@default) Description: Generic Linux kernel Kernel: kernel@0 Configuration 1 (conf@boston) Description: Boston Linux kernel Kernel: kernel@0 FDT: fdt@boston Configuration 2 (conf@ni169445) Description: NI 169445 Linux Kernel Kernel: kernel@0 FDT: fdt@ni169445 Configuration 3 (conf@xilfpga) Description: MIPSfpga Linux kernel Kernel: kernel@0 FDT: fdt@xilfpga Completed OK # rm -rf /kisskb/build/powerpc-fixes_mips-defconfig_mipsel # Build took: 0:02:46.446923