Skip to content

Commit fbc796c

Browse files
pussuwxiaoxiang781216
authored andcommitted
arm64_mmu: Do not set accessed-flag for table descriptors
The 12:0 bits in table descriptors are RES0 and AF is the 10th bit, so it is not valid to set it in this case. Fix this by moving AF to the common MMU_MT_NORMAL_FLAGS field
1 parent 00c4da7 commit fbc796c

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

arch/arm64/src/common/arm64_mmu.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -707,10 +707,6 @@ void mmu_ln_setentry(uint32_t ptlevel, uintptr_t lnvaddr, uintptr_t paddr,
707707

708708
index = XLAT_TABLE_VA_IDX(vaddr, ptlevel);
709709

710-
/* Setup the page descriptor and access flag */
711-
712-
mmuflags |= PTE_PAGE_DESC | PTE_BLOCK_DESC_AF;
713-
714710
/* Save it */
715711

716712
lntable[index] = (paddr | mmuflags);

arch/arm64/src/common/arm64_mmu.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,11 +223,11 @@
223223

224224
/* Flags for user page tables */
225225

226-
#define MMU_UPGT_FLAGS (0)
226+
#define MMU_UPGT_FLAGS (PTE_TABLE_DESC)
227227

228228
/* Flags for normal memory region */
229229

230-
#define MMU_MT_NORMAL_FLAGS (PTE_BLOCK_DESC_INNER_SHARE | PTE_BLOCK_DESC_MEMTYPE(MT_NORMAL))
230+
#define MMU_MT_NORMAL_FLAGS (PTE_PAGE_DESC | PTE_BLOCK_DESC_AF | PTE_BLOCK_DESC_INNER_SHARE | PTE_BLOCK_DESC_MEMTYPE(MT_NORMAL))
231231

232232
/* Flags for user FLASH (RX) and user RAM (RW) */
233233

@@ -240,7 +240,7 @@
240240

241241
/* Flags for kernel page tables */
242242

243-
#define MMU_KPGT_FLAGS (0)
243+
#define MMU_KPGT_FLAGS (PTE_TABLE_DESC)
244244

245245
/* Kernel FLASH and RAM are mapped globally */
246246

0 commit comments

Comments
 (0)