armv8/layerscape: Update MMU table with execute-never bits
PATCH 1/1 armv8/layerscape: Update MMU table with execute-never bits
For most device addresses excution shouldn't be allowed. Revise the MMU table to enforce execute-never bits. OCRAM, DDR and IFC are allowed for excution.
Signed-off-by York Sun <[email protected]>
Signed-off-by Alison Wang <[email protected]>
Reported-by Zhichun Hua <[email protected]>
--- arch/arm/cpu/armv8/cache_v8.c | 4 +- arch/arm/cpu/armv8/fsl-layerscape/cpu.c | 2 +- arch/arm/include/asm/arch-fsl-layerscape/cpu.h | 79 +++++++++++++++++--------- arch/arm/include/asm/armv8/mmu.h | 2 +- 4 files changed, 56 insertions(+), 31 deletions(-)
arch/arm/cpu/armv8/cache_v8.c +2 -2
@@ -13,13 +13,13 @@ DECLARE_GLOBAL_DATA_PTR;#ifndef CONFIG_SYS_DCACHE_OFF inline void set_pgtable_section (u64 *page_table,u64 index,u64 section, -u64 memory_type,u64 share) +u64 memory_type,u64 attribute) {u64 value; value = section |PMD_TYPE_SECT |PMD_SECT_AF ; value |=PMD_ATTRINDX (memory_type); - value |= share; + value |= attribute; page_table[index] = value; }
arch/arm/cpu/armv8/fsl-layerscape/cpu.c +1 -1
@@ -76,7 +76,7 @@ static int set_block_entry(const struct sys_mmu_table *list, index, block_addr, list->memory_type, - list->share); + list->attribute); block_addr += block_size; index++; }
arch/arm/include/asm/arch-fsl-layerscape/cpu.h +52 -27
154 lines not on this page · raw message
arch/arm/include/asm/armv8/mmu.h +1 -1
@@ -119,7 +119,7 @@void set_pgtable_section (u64 *page_table,u64 index,u64 section,u64 memory_type, -u64 share); +u64 attribute);void set_pgtable_table (u64 *page_table,u64 index,u64 *table_addr);
Signature · 1 line
2.1.0.27.g96db324
York Sun
AppliedPATCH 1/1 armv8/layerscape: Update MMU table with execute-never bits
Quoted 7 lines · Alison Wang
For most device addresses excution shouldn't be allowed. Revise the MMU table to enforce execute-never bits. OCRAM, DDR and IFC are allowed for excution.
Signed-off-by York Sun <[email protected]>Signed-off-by Alison Wang <[email protected]>Reported-by Zhichun Hua <[email protected]>
Quoted 7 lines
--- arch/arm/cpu/armv8/cache_v8.c | 4 +- arch/arm/cpu/armv8/fsl-layerscape/cpu.c | 2 +- arch/arm/include/asm/arch-fsl-layerscape/cpu.h | 79 +++++++++++++++++--------- arch/arm/include/asm/armv8/mmu.h | 2 +- 4 files changed, 56 insertions(+), 31 deletions(-)
Applied to fsl-qoriq master. Thanks.
York