Giulio Benetti
7ae0262748
ARM: 9266/1: mm: fix no-MMU ZERO_PAGE() implementation
...
[ Upstream commit 340a982825f76f1cff0daa605970fe47321b5ee7 ]
Actually in no-MMU SoCs(i.e. i.MXRT) ZERO_PAGE(vaddr) expands to
```
virt_to_page(0)
```
that in order expands to:
```
pfn_to_page(virt_to_pfn(0))
```
and then virt_to_pfn(0) to:
```
((((unsigned long)(0) - PAGE_OFFSET) >> PAGE_SHIFT) +
PHYS_PFN_OFFSET)
```
where PAGE_OFFSET and PHYS_PFN_OFFSET are the DRAM offset(0x80000000) and
PAGE_SHIFT is 12. This way we obtain 16MB(0x01000000) summed to the base of
DRAM(0x80000000).
When ZERO_PAGE(0) is then used, for example in bio_add_page(), the page
gets an address that is out of DRAM bounds.
So instead of using fake virtual page 0 let's allocate a dedicated
zero_page during paging_init() and assign it to a global 'struct page *
empty_zero_page' the same way mmu.c does and it's the same approach used
in m68k with commit dc068f462179 as discussed here[0]. Then let's move
ZERO_PAGE() definition to the top of pgtable.h to be in common between
mmu.c and nommu.c.
[0]: https://lore.kernel.org/linux-m68k/2a462b23-5b8e-bbf4-ec7d-778434a3b9d7@google.com/T/#m1266ceb63
ad140743174d6b3070364d3c9a5179b
Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com >
Reviewed-by: Arnd Bergmann <arnd@arndb.de >
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2022-12-14 11:37:15 +01:00
..
2021-02-01 19:44:30 +00:00
2022-07-21 21:24:16 +02:00
2020-08-06 10:57:30 +02:00
2021-04-23 11:33:50 +02:00
2022-07-12 16:35:08 +02:00
2019-06-25 19:49:18 +02:00
2021-01-21 17:42:46 +00:00
2019-06-19 17:09:07 +02:00
2022-03-11 12:22:35 +01:00
2021-05-26 13:20:50 +02:00
2019-02-01 22:05:50 +00:00
2018-07-30 11:45:53 +01:00
2017-11-02 11:10:55 +01:00
2019-06-19 17:09:55 +02:00
2021-05-07 00:26:34 -07:00
2019-06-19 17:09:55 +02:00
2020-10-25 14:51:49 -07:00
2021-09-03 09:58:13 -07:00
2017-11-02 11:10:55 +01:00
2020-08-20 15:45:16 -04:00
2020-03-21 15:23:54 +01:00
2021-05-26 13:20:50 +02:00
2017-11-02 11:10:55 +01:00
2020-03-21 15:24:03 +01:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2021-06-28 14:04:24 -07:00
2019-01-02 10:37:05 +00:00
2017-11-02 11:10:55 +01:00
2019-06-05 17:36:37 +02:00
2017-11-02 11:10:55 +01:00
2020-06-30 11:59:48 +02:00
2021-08-20 11:39:28 +01:00
2020-09-25 06:15:32 +02:00
2020-10-06 07:07:05 +02:00
2020-10-06 07:07:05 +02:00
2022-08-03 12:03:55 +02:00
2019-06-19 17:09:55 +02:00
2019-10-10 22:23:19 +01:00
2017-11-02 11:10:55 +01:00
2019-05-30 11:29:52 -07:00
2022-01-05 12:42:34 +01:00
2020-12-22 13:34:27 -08:00
2022-08-17 14:24:23 +02:00
2017-12-17 22:14:21 +00:00
2017-11-02 11:10:55 +01:00
2019-06-19 17:09:55 +02:00
2020-12-22 13:34:27 -08:00
2020-05-12 19:34:52 +03:00
2019-06-05 17:37:06 +02:00
2021-08-04 13:30:04 +02:00
2021-06-07 12:56:20 +01:00
2020-05-07 00:41:47 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2021-08-10 12:16:07 +01:00
2020-11-23 10:31:05 +01:00
2020-12-04 23:35:34 +01:00
2019-06-05 17:37:06 +02:00
2020-06-03 20:09:46 -07:00
2019-11-15 22:21:08 +00:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2021-03-31 09:16:55 +01:00
2017-11-02 11:10:55 +01:00
2020-10-25 14:51:49 -07:00
2021-06-07 12:56:20 +01:00
2022-05-18 10:26:56 +02:00
2017-11-02 11:10:55 +01:00
2020-11-23 10:31:05 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2020-10-27 12:11:08 +00:00
2020-10-27 12:11:10 +00:00
2020-12-29 15:36:49 -08:00
2021-02-05 10:23:29 +00:00
2021-03-09 10:25:35 +00:00
2018-05-19 11:53:46 +01:00
2020-10-27 12:11:51 +00:00
2018-10-17 13:14:33 -07:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2019-06-19 17:09:55 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2021-08-10 12:17:25 +01:00
2020-10-26 16:45:06 +01:00
2017-11-16 12:50:35 -08:00
2021-06-07 12:56:20 +01:00
2020-09-25 00:36:41 +09:00
2018-05-19 11:53:46 +01:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2020-03-18 12:27:04 +01:00
2019-05-30 11:26:41 -07:00
2019-05-21 11:28:39 +02:00
2019-06-19 17:09:55 +02:00
2019-06-05 17:37:06 +02:00
2019-06-19 17:09:55 +02:00
2020-04-10 15:36:21 -07:00
2021-03-11 16:17:52 +01:00
2017-11-02 11:10:55 +01:00
2019-10-27 21:14:40 +00:00
2020-07-30 13:01:04 -07:00
2022-12-14 11:37:15 +01:00
2021-07-01 11:06:03 -07:00
2019-06-19 17:09:55 +02:00
2019-06-05 17:37:06 +02:00
2020-12-22 13:34:27 -08:00
2019-06-05 17:37:06 +02:00
2019-06-05 17:37:06 +02:00
2021-07-08 11:48:22 -07:00
2019-06-19 17:09:55 +02:00
2022-12-14 11:37:15 +01:00
2022-12-14 11:37:15 +01:00
2019-05-30 11:26:41 -07:00
2019-06-19 17:09:55 +02:00
2022-02-01 17:26:59 +01:00
2019-06-19 17:09:55 +02:00
2020-10-27 12:10:59 +00:00
2019-05-30 11:26:41 -07:00
2019-06-03 15:49:07 +02:00
2022-07-21 21:24:12 +02:00
2020-11-20 11:16:34 -08:00
2020-03-24 10:56:05 +00:00
2018-05-08 14:50:42 +02:00
2021-04-18 19:15:11 +01:00
2020-10-25 14:51:49 -07:00
2017-11-02 11:10:55 +01:00
2020-11-23 10:31:05 -06:00
2017-11-02 11:10:55 +01:00
2017-11-16 14:05:12 -08:00
2019-02-01 21:44:10 +00:00
2022-08-17 14:24:23 +02:00
2017-11-02 11:10:55 +01:00
2022-03-16 14:23:42 +01:00
2017-11-02 11:10:55 +01:00
2021-03-22 02:45:52 +01:00
2018-12-12 13:20:07 -08:00
2017-11-02 11:10:55 +01:00
2020-10-27 12:11:06 +00:00
2019-02-26 11:32:54 +00:00
2017-11-02 11:10:55 +01:00
2019-12-08 14:37:32 +01:00
2021-05-26 13:20:50 +02:00
2021-08-20 11:39:26 +01:00
2017-11-02 11:10:55 +01:00
2021-06-13 18:16:48 +01:00
2020-10-25 14:51:49 -07:00
2017-11-02 11:10:55 +01:00
2021-09-09 13:25:49 -07:00
2019-06-19 17:09:55 +02:00
2022-05-30 09:29:14 +02:00
2020-10-13 18:38:31 -07:00
2021-06-29 10:53:52 -07:00
2017-11-02 11:10:55 +01:00
2020-10-08 17:17:27 +02:00
2020-06-09 09:39:10 -07:00
2021-08-20 11:39:27 +01:00
2022-02-01 17:26:59 +01:00
2021-08-04 13:30:04 +02:00
2021-08-20 11:39:28 +01:00
2019-07-11 10:09:44 -07:00
2020-06-09 09:39:10 -07:00
2019-06-19 17:09:55 +02:00
2017-11-02 11:10:55 +01:00
2019-02-01 21:44:19 +00:00
2019-11-15 22:21:12 +00:00
2018-03-24 14:27:49 +00:00
2020-04-23 10:50:26 +09:00
2020-07-21 16:33:39 +01:00
2020-07-21 16:33:39 +01:00
2017-11-02 11:10:55 +01:00
2020-03-24 10:56:05 +00:00
2019-12-10 10:12:55 +01:00
2022-03-11 12:22:35 +01:00
2017-11-02 11:10:55 +01:00
2019-06-19 17:09:55 +02:00