Patch "ARM: 9247/1: mm: set readonly for MT_MEMORY_RO with ARM_LPAE" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    ARM: 9247/1: mm: set readonly for MT_MEMORY_RO with ARM_LPAE

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     arm-9247-1-mm-set-readonly-for-mt_memory_ro-with-arm.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit a2feffa4c418e154eec2ab008f56a8453e88d563
Author: Wang Kefeng <wangkefeng.wang@xxxxxxxxxx>
Date:   Fri Sep 16 12:10:49 2022 +0100

    ARM: 9247/1: mm: set readonly for MT_MEMORY_RO with ARM_LPAE
    
    [ Upstream commit 14ca1a4690750bb54e1049e49f3140ef48958a6e ]
    
    MT_MEMORY_RO is introduced by commit 598f0a99fa8a ("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: 598f0a99fa8a ("ARM: 9210/1: Mark the FDT_FIXED sections as shareable")
    Signed-off-by: Kefeng Wang <wangkefeng.wang@xxxxxxxxxx>
    Signed-off-by: Russell King (Oracle) <rmk+kernel@xxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index cd17e324aa51..83a91e0ab848 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -300,7 +300,11 @@ static struct mem_type mem_types[] __ro_after_init = {
 		.prot_pte  = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY |
 			     L_PTE_XN | L_PTE_RDONLY,
 		.prot_l1   = PMD_TYPE_TABLE,
+#ifdef CONFIG_ARM_LPAE
+		.prot_sect = PMD_TYPE_SECT | L_PMD_SECT_RDONLY | PMD_SECT_AP2,
+#else
 		.prot_sect = PMD_TYPE_SECT,
+#endif
 		.domain    = DOMAIN_KERNEL,
 	},
 	[MT_ROM] = {



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux