Christophe Leroy
12f363511d
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: 63b2bc6195 ("powerpc/mm/32s: Use BATs for STRICT_KERNEL_RWX")
Reported-by: Serge Belyshev <belyshev@depni.sinp.msu.ru>
Acked-by: Segher Boessenkool <segher@kernel.crashing.org>
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2019-05-02 15:33:46 +10:00
..
2019-03-02 14:43:05 +11:00
2019-02-23 21:04:32 +11:00
2019-02-23 21:04:31 +11:00
2019-02-23 21:04:31 +11:00
2018-08-17 16:20:28 -07:00
2019-02-18 22:41:04 +11:00
2018-02-23 16:45:51 +11:00
2019-01-03 18:57:57 -08:00
2019-02-23 21:04:31 +11:00
2018-07-24 22:03:17 +10:00
2018-07-24 22:03:17 +10:00
2019-03-19 00:30:19 +11:00
2018-10-04 23:16:53 +10:00
2019-03-12 10:04:02 -07:00
2018-08-10 22:12:38 +10:00
2018-10-03 15:39:59 +10:00
2017-11-02 11:10:55 +01:00
2019-03-07 12:56:26 -08:00
2019-03-07 12:56:26 -08:00
2018-12-27 10:43:24 -08:00
2019-02-23 21:04:32 +11:00
2019-03-02 14:43:05 +11:00
2018-12-04 19:45:01 +11:00
2019-03-12 14:06:12 +11:00
2019-02-21 23:15:10 +11:00
2018-04-11 10:28:37 -07:00
2018-12-04 19:45:01 +11:00
2018-07-30 22:48:20 +10:00
2019-04-17 21:36:51 +10:00
2019-03-12 10:04:02 -07:00
2018-12-04 19:45:01 +11:00
2019-02-23 21:04:32 +11:00
2019-03-12 10:04:01 -07:00
2019-02-23 21:04:32 +11:00
2018-10-14 18:04:09 +11:00
2019-03-12 10:04:02 -07:00
2019-03-12 10:04:02 -07:00
2019-01-04 13:13:47 -08:00
2018-10-14 18:04:09 +11:00
2019-03-12 10:04:02 -07:00
2018-12-19 18:56:32 +11:00
2018-12-21 14:46:50 +11:00
2019-05-02 15:33:46 +10:00
2019-02-22 00:10:14 +11:00
2019-02-26 16:26:29 +11:00
2019-01-03 18:57:57 -08:00
2018-05-25 12:04:38 +10:00
2018-03-31 00:10:38 +11:00
2018-12-20 22:59:03 +11:00
2018-07-30 22:48:17 +10:00
2019-01-15 11:38:05 +11:00
2018-10-26 14:36:21 -07:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00