This is an automated email from the ASF dual-hosted git repository. xiaoxiang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push: new abfeafa876 arm64: XN should only be set when the attribute MT_EXECUTE_NEVER is set abfeafa876 is described below commit abfeafa87629ff91e7d9d5a9ed32ebd7848ed5be Author: zhangyuan21 <zhangyua...@xiaomi.com> AuthorDate: Thu Oct 12 19:14:22 2023 +0800 arm64: XN should only be set when the attribute MT_EXECUTE_NEVER is set Only when SCTLR_ELn.WXN is set to 1, regions that are writable at ELn are treated as non-executable. Therefore, when SCTLR_ELn.WXN is set to 0, regions that are writable at ELn can be executed, so the writable attribute cannot be used to restrict the executable attribute. Signed-off-by: zhangyuan21 <zhangyua...@xiaomi.com> --- arch/arm64/src/common/arm64_mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/src/common/arm64_mmu.c b/arch/arm64/src/common/arm64_mmu.c index 18476049fe..294845d860 100644 --- a/arch/arm64/src/common/arm64_mmu.c +++ b/arch/arm64/src/common/arm64_mmu.c @@ -336,7 +336,7 @@ static void set_pte_block_desc(uint64_t *pte, uint64_t addr_pa, { /* Make Normal RW memory as execute never */ - if ((attrs & MT_RW) || (attrs & MT_EXECUTE_NEVER)) + if (attrs & MT_EXECUTE_NEVER) { desc |= PTE_BLOCK_DESC_PXN; }