]> git.baikalelectronics.ru Git - kernel.git/commit
ARM: 9247/1: mm: set readonly for MT_MEMORY_RO with ARM_LPAE
authorWang Kefeng <wangkefeng.wang@huawei.com>
Fri, 16 Sep 2022 11:10:49 +0000 (12:10 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Oct 2022 11:22:22 +0000 (13:22 +0200)
commit884cb8feff22bae41dc1b785e3e17d692b9e72a7
tree8294b754970f4e59befe0dde528f855516c63bc4
parentf4e4c99980ac651dab90b73c7ee0acc97fa8a696
ARM: 9247/1: mm: set readonly for MT_MEMORY_RO with ARM_LPAE

[ Upstream commit 898e722e91136e828e6072d473fb022e88376067 ]

MT_MEMORY_RO is introduced by commit 1e30e57aa377 ("ARM: 9210/1:
Mark the FDT_FIXED sections as shareable"), which is a readonly
memory type for FDT area, but there are some different between
ARM_LPAE and non-ARM_LPAE, we need to setup PMD_SECT_AP2 and
L_PMD_SECT_RDONLY for MT_MEMORY_RO when ARM_LAPE enabled.

non-ARM_LPAE 0xff800000-0xffa00000           2M PGD KERNEL      ro NX SHD
ARM_LPAE 0xff800000-0xffc00000           4M PMD RW NX SHD
ARM_LPAE+fix 0xff800000-0xffc00000           4M PMD ro NX SHD

Fixes: 1e30e57aa377 ("ARM: 9210/1: Mark the FDT_FIXED sections as shareable")
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/arm/mm/mmu.c